-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DESTDIR make install variable in catkin_make for macports and other chroot build systems #499
Comments
That looks good, I missed that commit. It looks like build_cmake_package() is still writing env.sh to new_env_path on line 464, and new_env_path is set to install_target which resolves to "installspace if install else develspace". new_setup_path is hard-coded to install_target in there too. Is there any way to have it not install anything to installspace? |
Sorry, but I don't understand your question. catkin_make_isolated must always install each package. Without installation the next package can not find/rely on the package before. |
Macports requires files to be installed to a destdir, which is not the actual install prefix but somewhere buried in the build tree. The reason is so that it can manually register/activate files into the install prefix and thereby track what files are there in case they need to be uninstalled. The issue then is if something is written to the install prefix manually it will be a permissions error. The temp env.sh files which are used to chain builds of packages together cannot be written to the install prefix since thats not a writable area. I got around this in my port tree by not passing --install to catkin_make_isolated (which forces catkin to store these chained env.sh files in the develspace) and then patching builder.py to install anyway, using the env.sh files from the develspace. While this works, its something of a hack. It'd be better if the env.sh temp files could be written to always be stored somewhere else (e.g. develspace, or even DESTDIR), and called from there when chaining to the next package. I don't know enough about catkin to know how this would affect things (other than that when I tried that yesterday with a simple patch it broke catkin). |
With latest changes of catkin from the GitHub repo and setting DESTDIR there should be no files written to the install prefix but only to the dest dir. If that is not the case for you please describe the exact steps/commands to reproduce it. |
Ok sounds great, I'll give it a go as soon as I'm able (can't get latest from git to compile via macports for unrelated reasons atm). |
Unfortunately it looks like its still writing env.sh to the install-space. Here's the invocation (tcl script for macports, run in a directory that has groovy-desktop-full in it):
And the relevant part of the output:
In the ":info:build Command failed:" line you can see its being called with DESTDIR set to within the macports build hierarchy. The full log is 300k but I can paste it somewhere if needed. It appears to be line 464 in builder.py, which is the env.sh files I believe. |
I have committed a patch which fixes the issue for me. But since your example is overly complex and does not contain all information (the used variables as well as the content of the workspace is unknown) I was unable to run your example. Can you please try it with a current checkout of catkin in your workspace and report back if that solves the issue for you, too? |
Macports requires files to be staged in an install dir before being copied into the actual installation prefix. Unfortunately, catkin_make_isolated doesn't support passing flags to make install, which would be the usual solution to this problem via DESTDIR.
Simply appending a DESTDIR flag to the "make install" invocations in catkin/python/catkin/builder.py also doesnt work, because with --install mode toggled catkin_make wants to put env.sh files in the install dir specified by either --install or CMAKE_INSTALL_PREFIX. Unfortunately, with a staged install nothing can be directly installed into the install directory (e.g. ${prefix}), since the files are supposed to be installed to a destroot and then copied into the actual ${prefix} by macports.
I think the solution might be to have env.sh written to the develspace instead of the installspace. In the short term, I've hacked the port to work by not passing --install to catkin_make_isolated (so it doesnt touch installspace, since it thinks its not installing) and then patching builder.py to still run "make install" for both cmake and catkin packages with forced CMAKE_INSTALL_PREFIX and DESTDIR flags which are specific to macports.
Long term, a solution which allowed passing flags to make install and not writing other files to the installspace would be useful. Also possibly always pushing the env.sh to the develspace (I'm not sure what side effects this might cause).
The temporary patching of builder.py to work with macports can be seen at https://github.com/kyonifer/ros-macports/blob/master/devel/ros-desktop/Portfile starting at line 100. reinplace is a macports macro that does regular expression replaces within the file specified.
The text was updated successfully, but these errors were encountered: