Change all SBT target directories to the outside of the source - scala

I am having a hard time running SBT in a "read-only" directory (directory I have permissions but I cannot/shouldn't write).
I want basically to move all the target directories to another location.
Half the problem is solved with:
target := file("</full/path/to/new/location>")
but it is still creating target directories inside the project/* directory.
I would also like this to be done in the run command, not by changing the sbt files.
The current command I am using is:
sbt 'set target := file("</full/path/to/new/location>")' compile
Adding some kind of system wide sbt configuration would be a possibility, but I also could not make it work.
Any ideas how to accomplish this?

So here is my suggestion using symlinks:
$ mkdir -p have_access/project
$ ln -sr read_only/src have_access/
$ ln -sr read_only/build.sbt have_access/
$ ln -sr read_only/project/build.properties have_access/project/
$ cd have_access
$ sbt test

Related

Yocto: : does bitbake cleanall ,cleans dependencies as well

bitbake cleanall
Removes all output files, shared state cache, and downloaded source files for a target
It is not clear or documented if it cleans all build time dependencies as well
If you want to clean everything do,
bitbake world -c cleanall --continue
The --continue will ignore any dependency errors while cleaning. Continue as much as possible after an error.
No, cleanall does not clean dependencies. eg
bitbake -c cleanall core-image-minimal
only removes the output of that named recipe.
What i usually do to clean "everything" is running cleanall on the receipe "world":
bitbake -c cleanall world
If that fails because of unresolvable packages like that:
ERROR: Nothing PROVIDES 'sg3-utils' (but /home/blubb/meta-freescale/recipes-devtools/utp-com/utp-com_git.bb DEPENDS on or otherwise requires it).
I just add the packages temporary to the ASSUME_PROVIDED variable like this :
bitbake -c cleanall world --ignore-deps=python-nativedtc-native --ignore-deps=sg3-utils
If nothing provides this packages it is unlikely that they where ever build.
Please read the mega-manual section do_cleanall .
do_cleanall removes:
all output files
shared state (sstate) cache
and downloaded source files for a target (i.e. the contents of DL_DIR).
You can run this task using BitBake as follows:
$ bitbake -c cleanall <recipe-name>
If recipe name is not passed to cleanall task it does not work.
Removes all output files, shared state (sstate) cache, and downloaded source files for a target (i.e. the contents of DL_DIR). Essentially, the do_cleanall task is identical to the do_cleansstate task with the added removal of downloaded source files.
You can run this task using BitBake as follows:
$ bitbake -c cleanall recipe
Typically, you would not normally use the cleanall task. Do so only if you want to start fresh with the do_fetch task.
Other folks have already answered that bitbake does not automatically clean dependencies, but you can create an Inter-task dependency (https://www.yoctoproject.org/docs/3.1/bitbake-user-manual/bitbake-user-manual.html#inter-task-dependencies) to clean your dependencies if needed by adding a command to the recipe:
do_task[depends] = "recipe:task"
We've extended bitbake to build native recipes and automatically run unit tests during a build. In that case we need to clean the native recipe when cleaning the target so you could add:
do_clean[depends] = "${PN}-native:do_clean"
do_cleanall[depends] = "${PN}-native:do_cleanall"
do_cleansstate[depends] = "${PN}-native:do_cleansstate"
That solution falls a bit short because the native recipes will attempt to clean ${PN}-native-native, so you'll need a conditional to not apply if it's already native:
do_clean[depends] += "${#'' if bb.data.inherits_class('native', d) else '${PN}-native:do_clean'}"
do_cleanall[depends] += "${#'' if bb.data.inherits_class('native', d) else '${PN}-native:do_cleanall'}"
do_cleansstate[depends] += "${#'' if bb.data.inherits_class('native', d) else '${PN}-native:do_cleansstate'}"

Cannot find or load main class com.yahoo.ycsb.Client

I'm trying to create a custom database binding, FooStore, for YCSB. I've compiled this via
mvn -pl com.yahoo.ycsb:foostore -am package
to a jar file, which I've tried to add to the classpath per Step 7
java -cp lib/foostore-0.13.0-SNAPSHOT.jar com.yahoo.ycsb.Client
-load -db com.yahoo.ycsb.db.FooStoreClient -P workloads/workloada
which I'm executing from the ycsb-0.12.0 directory (with my new jar file in the lib directory), which results in
Error: Could not find or load main class com.yahoo.ycsb.Client
Where should I be executing the java command from, and/or which jar(s) do I need to add to my classpath in order to fix this command?
Alternatively, how do I modify YCSB so that I can recompile it via mvn package and then simply execute ./bin/ycsb load foostore -P workloads/workloada
Have you tried to add a database keyword in ycsb?
Maven gave you a ycsb-foostore-binding-0.13.0-SNAPSHOT.tar.gz. Untar it (in another directory).
Edit ycsb-foostore-binding-0.13.0-SNAPSHOT/bin/ycsb and edit the DATABASES dictionary by adding a line like:
"foostore" : "com.yahoo.ycsb.db.FooStoreClient",
Run your custom YCSB:
cd ycsb-foostore-binding-0.13.0-SNAPSHOT/
/bin/ycsb load foostore -thread 1 -P workload/worloada -s

Compile rygel for yocto with plugins

I'm using bitbake to compile rygel for yocto from the meta-openembedded layer, with the plugins mpris and gst-launch.
As per the PACKAGECONFIG docs, I created a bbappend file and added the following:
EXTRA_OECONF = "--disable-introspection \
--disable-tracker-plugin \
--with-media-engine=gstreamer \
--enable-mpris-plugin \
--enable-gst-launch-plugin"
PR = "r1"
It compiles and installs, but has no plugins.
The append shows up when I run bitbake-layers show-appends, so at least bitbake is finding it. After running bitbake the directory tmp/work/core2-64-poky-linux/rygel/0.26.1-r1/image/usr/lib/rygel-2.6/plugins/ is populated. Then when I run the image /usr/lib/rygel-2.6/ contains an engines dir and nothing else.
Any idea where I'm going wrong?
I don't think your read all the way down to "If you want to change an existing PACKAGECONFIG block, you can do so one of two ways:".
From a bbappend, just do
PACKAGECONFIG_append = " mpris gst-launch"
In the recipe do_install, they remove some of the engines and plugins files. This might be the reason you do not see them in your image.
do_install_append() {
# Remove .la files for loadable modules
rm -f ${D}/${libdir}/rygel-${LIBV}/engines/*.la
rm -f ${D}/${libdir}/rygel-${LIBV}/plugins/*.la
}
your compiling plugins successfully and not able to see in board(rootfs)? if yes please add below line in your .bbappend file. '
FILES_${PN} += "${libdir}/*"
this will add all your compiled plugins to your rootfs image.

Cannot do "make eclipse-project" in an exsisting ROS package

When I create a new ROS package using:
$ roscreate-pkg test std_msgs rospy roscpp
and then I proceed to it, typing:
$ make eclipse-project
Everything is OK.
But when I roscd into an existing ROS package and type the above command, it returns :
make: *** No rule to make target `eclipse-project'. Stop.
Is it because the package isn't created by roscreate-pkg?
did you follow the steps here ? Ros Wiki on IDSs
I know the cause for make having no rule is when the rule isn't found in a Makefile.
I was having the same problem with my project and found that it had no Makefile.
Your question gave me the insight to run roscreate-pkg and voilĂ  that folder had a Makefile. The entire contents are:
include $(shell rospack find mk)/cmake.mk
I was able to solve the same problem by having a Makefile in my project with the same content. I did it by copying the Makefile from the dummy project I created via the following commands:
$ roscreate-pkg dummy std_msgs rospy roscpp
$ cp src/dummy/Makefile src/my-package/Makefile

Why is Netbeans complaining about my GNUmakefile?

I am making a Netbeans C++ project with an existing GNUmakefile. I went to File -> New Project -> C/C++ with Existing Sources and selected the folder with my current files (including the GNUmakefile).
However, when I run my app, I get the following error.
make: Makefile: No such file or directory
make: *** No rule to make target `Makefile'. Stop.
BUILD FAILED (exit value 2, total time: 67 ms)
I suspect that my Makefile is named "GNUmakefile", which differs from "Makefile." However, I do not want to rename "GNUmakefile," since I am working on this project with others who want to keep it the same.
Is that why Netbeans complains about my GNUmakefile? How can I tell Netbeans to use GNUmakefile instead?
It looks like you must be invoking make as make -f Makefile, so you are explicitly (whether you realize it or not) saying to use a makefile called Makefile. Otherwise, GNU make would happily use GNUmakefile:
$ ls
GNUmakefile
$ cat GNUmakefile
all: ; #echo done
$ make
done
$ make -f Makefile
make: Makefile: No such file or directory
make: *** No rule to make target `Makefile'. Stop.
Note that you only get the error you reported in the last case. So you just need to change how you are invoking GNU make. Alternatively you could symlink Makefile to GNUmakefile:
$ ln -s GNUmakefile Makefile
$ gmake -f Makefile
done