Hi! I have packaged oorexx 5.0.0 for pkgsrc, the package building framework for lots of different Unix and Unix-like systems. See http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/oorexx/ .
As part of the build, nearly at the end, the build procedure runs the just-built executable rexximage. This unfortunately has a few problems.
/tmp/pkgsrc/lang/oorexx/default/cmake-pkgsrc-build/bin/rexximage: Shared object "librexx.so.4" not found. It needs some shared libraries, but since they are built but not installed yet, they can't be found. This is annoying but can be worked around, unless the next item applies.x86_64 with a cross compiler which creates aarch64 binaries. Scenarios like this can not work.rexximage apparently starts a process rxapi which remains running after the build. Since pkgsrc bulk-builds packages, this pollutes the build system. There does not appear to be a method to cleanly get rid of this process. Obviously, running kill commands on a build server is not appropriate.The best solution would be to not run any build-products at all. This will solve all 3 issues.
Barring that, can we at least have some sort of fix for item 3? This is in my view the most pressing issue. Leaving processes running is just rude.
Thanks in advance,
-Olaf.
Anonymous
Hi Olaf!
It would be great if you could make it work for pkgsrc (which I am not really familiar with). Besides Win and macOS we do build for .deb, .rpm and .pkg. We build FreeBSD, OpenBSD, NetBSD, Manjaro, Arch Linux, OpenIndiana and Solaris so the build process it not a problem for us for those platforms but we only managed to build an installer that works on FreeBSD. Regarding 2 above I can confirm that crossbuilding works for macOS at least, for those two platforms you mention. Regarding 1 above maybe you can get some hints from looking at the attached log of our building FreeBSD, as well as hour build commands. You will notice that we build once locally a "portable" installer (a zipped copy of the necessary binaries basically) that can run from anywhere, look at CMakeLists.txt for more detail. At the end we use CPack to create an installer that can be distributed. But, as I said, this only works for us on FreeBSD so if you make ooRexx available on pggsrc that would be great.
Regarding 3 above I am not a developer but to my knowledge rxapi is the API used by the interpreter and yes, it stys behind, unless you kill it. We have a kill command in the build process to make sure we are using the right version of it. If you are not able to use pkill this might be problematic.
Hi Per! Thanks for your reply.
I was looking through the cmakefile stuff and found some steps to kill rxapi, but only on Windows (it says that otherwise the build fails; I suppose that the file is locked as long as it is being executed).
Pkgsrc and FreeBSD ports were, once upon a time, the same thing, one forked from the other and now they have some of the same principles but many different details. The main building part of the log looks very similar to what I get from pkgsrc.
I came up with a few patches (I tried to keep them fairly small) to add an argument to the
rxapicommand so that it terminates the currently running server. For that I turn the lock file into a pid file (containing the process ID of the server), which I was kind of missing anyway. When you runrxapi stopit consults the lock file and sends a SIGTERM signal to the process id that it finds.While browsing through the sources, I got the impression that just calling
LocalAPIManager::getInstance()->shutdown();should find the server and send it aSHUTDOWN_SERVERmessage. That would be cleaner than sending signals, but for some reason it didn't work for me.So I plan to add these patches in pkgsrc: (it seems the indenting gets mangled by sourceforge)
I offer this of course as a patch for you. You can probably make this a bit nicer and possibly also use this for terminating the Windows executable. Maybe it's even trivially possible to make my idea of
LocalAPIManager::getInstance()->shutdown();make work; I would prefer that over sending signals.I just committed a newer version of the patches above to pkgsrc. I made the condition to send the signal a bit stricter: only if the exclusive lock is not obtained. That should mean that an
rxapiprocess is actually running.Should be available from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/oorexx/patches/ soon.