-
Notifications
You must be signed in to change notification settings - Fork 150
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
Enable building on FreeBSD #427
Conversation
@quark17, thanks for doing this. I was stalled in #260 by the fact that the build system for the Haskell components assumes that packages are globally installed. When I started #260, FreeBSD provided system packages for Haskell packages but apparently this is no longer the recommended way of building Haskell things and now Haskell programs on FreeBSD are expected to use Cabal (or equivalent) to manage local copies of their dependencies. This apparently avoids problems where two programs need different and incompatible versions of Haskell packages. Unfortunately, my knowledge of Cabal and Haskell builds in general is precisely zero so I was stalled on how to make progress. Following the instructions from the other PR, I am getting closer:
I can't build the release because it looks as if the build has picked up a dependency on a massive blob of Ruby goo to generate an HTML file from the release notes. If I install the
Looking in You seem to have lost my yices changes (which I thought were upstreamed?), if I do a clean build of this branch it fails because it tries to run |
Move the computation of the TCL_INC_FLAGS and TCL_LIB_FLAGS from two places in the build to one place, in the top-level platform script. Expand that computation to include more cases. The existing build system conflated 'has BSD tools' vs 'has GNU tools', 'is ELF' vs 'is Mach-O', and 'is Linux' vs 'is Darwin'. I have not tried to clean up that conflation, only to add the missing case. Includes reviewer feedback.
25a50f9
to
78b75e6
Compare
Ah, yes, I had merged the Yices commit upstream, but had not pulled it back into my fork. The branch in my fork was branching from before the Yices commit. I've corrected that and force-pushed the new branch. So it should include the Yices commit if you pull and try again.
Yes, our Ubuntu and Mac CI VMs also no longer install the libraries via packages, and use cabal instead. We use the cabal v1 install (as mentioned in the README), which globally installs one global version (like the packages used to do). You could do that, too, I assume; but if the v2 install (plus setting GHC) is working for you, then that's great.
We can add something to Depending on what you're building for, you could also just make the (If
Does it help if you execute this:
I don't know anything about this, but some web-searching turned up that recommendation. |
Thanks!
I'd like to get this into a state where we can provide FreeBSD packages via the ports system. I'm not sure what the best way of doing this is. We shouldn't be installing Haskell things globally because that introduces the problem that removing them from the package repos was meant to solve. This might be okay though - it looks as if they're all statically linked, so it doesn't matter too much where they're installed.
That would be great, yes.
It works for me now that the yices issue is fixed, is that sufficient for a package? I don't mind not shipping the docs in the package, at least in the first cut. I was a bit confused that Looking at the licenses generated by the install-COPYING step, I was a bit surprised to learn that there's a GPLv3 dependency. It looks as if Yices is statically linked into the resulting binary, which adds some legal fun to the whole process of distributing it. #117 appears to be investigating alternatives. Referring to your comment on #404 about the lack of standard packages for SMT solvers, Z3 is packaged for pretty much everything (and is permissively licensed, so you can statically link it without issues). I'll probably hold off on packaging until the GPL issue is resolved.
That would leave me with a mix of Not specific to FreeBSD, but it look as if even with |
Is it OK to merge this PR and create an Issue for discussing any further changes needed? (If the commit message needs to change, to not overstate its contents, I can do that first.)
If you're able to use the v2-install, that's certainly preferable. (I can add the v2-install details to the Eventually, the Makefiles should use cabal in a way that automatically sets up any needed libraries (using the v2-install, implicitly). But we probably should continue to support people who have globally installed the libraries. Rather than setting
I grant that words like "install" and "PREFIX" can have various meanings, and that it's unclear what BSC means by them. If there's a convention that's common, I'm OK with changing BSC's Makefiles to use that convention; or I'm OK with renaming these targets and variables, to something that won't be confusing. All of the targets ( By default that installation directory is called
I'm happy to add a new target (or a script) that contains the commands for doing a global install (for those that want that). I don't have a sense of whether one set of commands would work for all the OS packagings, though. But I guess that we could have different scripts for the different forms, if necessary. If you have a draft of what the commands would be, we can check those in as a start. Here's my guess at what it'd look like:
Symlinks could be used to place certain libraries under
Yes. That should be made more clear, or eventually we replace Yices with Z3. I can't say when that would happen, though.
The |
Yup, with this I can build on FreeBSD. Thanks!
If I had more time to work on it, I'd suggest rewriting the build system in something more modern such as CMake. This would pick up existing portable solutions for a bunch of things (such as finding TCL, knowing what the system's C compiler is, finding other packages, installing things in standard locations, a clean system for exposing optional steps such as building the docs or generating HTML / PDF release nots, and so on). The existing build system is very fragile and I'm quite nervous about suggesting adding anything else to it.
That did work for me, yes (though on a 10-core machine setting it to 20, I still only had 70% CPU utilisation during the build). It would be nice if that could default to the number of CPUs, but getting the number of cores in a portable way is nontrivial (CMake has a helper that does it for you). |
For sure! Any suggestion I make about adjusting Makefiles should have an implied "for now until it all gets replaced by something like CMake" on the end. |
Regression introduced by PR B-Lang-org#427. The Tcl package may not have a version suffix.
Regression introduced by PR #427. The Tcl package may not have a version suffix.
This is a replacement for PR #260. I have separately committed an update to newer Yices as PR #426 (and specifically to a tagged release of Yices) and this PR contains the remaining changes, plus new edits to address my last comments, squashed into one commit.