-
Notifications
You must be signed in to change notification settings - Fork 41
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
build: resurrect make deb
#1082
Conversation
2a488bc
to
32ebb75
Compare
32ebb75
to
0b76610
Compare
Hold off on merging this until #1083 is solved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @trws! The one issue I'm still fighting with is #1087. So far, from lots of online searching I've come up with this as the best way to install a link: diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index b4228f69..3efd2dd4 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -12,3 +12,22 @@ install(DIRECTORY fluxion
DESTINATION "${PYTHON_INSTALL_SITELIB}"
FILES_MATCHING PATTERN "*.py")
+set(PYNAME "python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
+set(PYDIR "${CMAKE_INSTALL_FULL_LIBDIR}/flux/${PYNAME}")
+set(LINKTARGET "${PYTHON_INSTALL_SITELIB}/fluxion")
+
+INSTALL(CODE "\
+ execute_process( \
+ COMMAND \
+ mkdir -p \$ENV{DESTDIR}/${PYDIR} \
+ )
+ execute_process( \
+ COMMAND \
+ rm -f \$ENV{DESTDIR}/${PYDIR}/fluxion \
+ )
+ MESSAGE (STATUS \
+ \"linking ${PYDIR}/fluxion -> ${PYTHON_INSTALL_SITELIB}/fluxion\")
+ execute_process( \
+ COMMAND \
+ ln -s ${LINKTARGET} \$ENV{DESTDIR}/${PYDIR}/fluxion \
+ )") Actually I was going to report that this works for Also, is there some way to prevent cmake from rebuilding the whole project when you touch one file? That makes it really painful to work on the install target when you end up building from scratch with each test (especially with Fluxion)... |
Problem: dh detects an autoconf build system when building a debian package, but the fake 'configure' script doesn't support all the necessary options to build a package. Since dh appears to support cmake, force a cmake build system so the package build works.
Problem: The 'make deb' target was dropped in the conversion to cmake, but having an easy way to build test .deb packages has become an essential component of testing. Add a custom 'deb' target to CmakeLists.txt. Since this target requires 'make dist', add a 'dist' custom target as well. Some versions of git do not support the `--add-virtual-file` option, so instead of using that to add the flux-sched.ver file to the archive, just create the file, add it, and subsequently remove it. Fixes flux-framework#1072
Problem: The cmake-based build installs flux-ion-R.py to <libdir>/libexec/cmd/ instead of <libexecdir>/flux/cmd. Fix FLUX_CMD_DIR so that this program is installed to the correct path. Fixes flux-framework#1083
Problem: In the previous autotools based build system, a soft link from libdir/python<ver>/fluxion was created to point to the real fluxion directory in python site packages. This was done because the flux(1) command driver actually prepends this non-standard PATH to PYTHONPATH in order to prepend just the path to the Flux modules instead of the path to all site-installed modules. In the conversion to cmake this link was dropped from `make install`. Re-establish this python link in `make install`. Fixes flux-framework#1087
Problem: The build of flux-sched now requires cmake, but this is not reflected in debian/control. Add cmake to build requirements in debian/control.
Problem: dh_auto_configure(1) does not seem to set libexecdir automatically for package builds. Add -DCMAKE_INSTALL_LIBEXECDIR to get the correct libexecdir for debian systems in the cmake based build.
4719df2
to
74c2219
Compare
Codecov Report
@@ Coverage Diff @@
## master #1082 +/- ##
========================================
- Coverage 71.7% 71.7% -0.1%
========================================
Files 89 89
Lines 11665 11665
========================================
- Hits 8374 8371 -3
- Misses 3291 3294 +3 |
Ok, I've pushed the latest hopefully working set of changes. @garlick, want to give this branch a try? |
That looks reasonable. Usually it's best practice to use the I'm looking into the rebuild issue. To be honest I'm not sure, I have a feeling it's being defensive due to the use of some of the custom commands, but I'm not completely sure why yet. |
Blarg, yes, there are some dirty edges because I missed specifying explicit inputs for a couple of targets. Hopefully that will take care of it once I clean those up. |
Looking good! I did notice a couple formerly "noinst" programs have leaked into the install
but that's not an issue with the deb per se so I'll approve and set MWP. Thank you! It will be good to be able to install test releases of fluxion on my test cluster again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR brings back the
make deb
target, which we've been using to build and install packages on test systems.A
make dist
target, required byscripts/debbuild.sh
, is added (and is now used bymake distcheck
), andmake dist
is fixed to work with slightly older versions ofgit-archive
that do not support the--add-virtual-file
option. Finally, the build system is forced tocmake
indebian/rules
since the fakeconfigure
script doesn't support all the requisite options.