-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
FreeBSD support #10816
FreeBSD support #10816
Conversation
It's good to know! I also want to port NixOS to NetBSD, so I will watch your efforts. |
I don't think I can do anything about these CI failures, looks like it is just timing out cause the build takes too long? |
@AndersonTorres Maybe we could merge the NetBSD and FreeBSD porting efforts, I guess it is mostly just replacing "isFreeBSD" with "isFreeBSD || isNetBSD". You could take the FreeBSD patch for nix and use it with this nixpkgs, and it might work. Then we could merge it together. |
cc @tomster |
@ysangkok there is some support for NetBSD or FreeBSD on Nix itself? Also, what about to design a build farm for BSD, using clang/llvm as default toolchain? It would be a good test case for Nix language itself, and the huge pkgsrc would be useful. |
@AndersonTorres Build farm sounds like a good idea, but what exactly needs to be designed? I can sponsor a jail if needed. |
This depends on NixOS/nix#657 so maybe we should wait until that is merged... |
A thing: are you testing it using clang and llvm stack? They are the preferred ones on FreeBSD nowadays. |
@AndersonTorres yes, I am using clang/llvm. But, I will push some commits switching to coreutils, since nixpkgs (the pcre package specifically) depend on them for patching binary files with patch(1). The manual also mentions coreutils. But on NixCon it seemed that there was consensus for making a pure stdenv for FreeBSD, which would be cross-compiled with a Linux-type compiler (which would also run on FreeBSD if binary emulation was working). That stdenv would then probably use gcc since this is what other pure stdenv's use. |
Just for the record, the new darwin (almost pure) stdenv uses clang. |
Ok, I stand corrected. But currently I am not focusing on the pure stdenv anyway, and most issues seem related to the use of clang. Once I hit the first issue with the FreeBSD clang that requires patching it, I will probably start working on the stdenv. For example, this is the issue I am currenly trying to work around: https://mariadb.atlassian.net/browse/MDEV-5944 which is a problem that would not be fixed by switching to our own stdenv. |
@nbp How would you like me to document this? |
@domenkozar should we add a release note section to the Nixpkgs manual? |
@ysangkok I was thinking of having a section of supported platforms in the Nixpkgs manual, where Linux, Darwin and Cygwin would already be listed, but I do not see any. If you want to add such documentation in a separate issue I would be fine too, as there is no existing documentation in place. |
That depends on what's meant by "supported". On Hydra.nixos.org we have CI only for three platforms currently (two Linux and one Darwin). For the rest the state might tend to rot (or we might not know), I'm afraid, and even the Darwin support level doesn't seem to be first-class yet. |
@vcunat Bitcoin is building and runs now, I am satisfied with this and would like to get it reviewed for merging. |
OK, queued in my TODO ;-) |
I tested building some stuff on FreeBSD 11.0-CURRENT and can attest that the workaround for m4 is also required for it (clang 3.7.0). In 11.0-CURRENT and m4, make check only fails for test 189 (but not for 084 as with FreeBSD 10). |
@vcunat I rebased onto current master. |
The |
…dd libelf-freebsd
…ibelf-freebsd, openldap, serf, guile, tet, shishi, gawk, gnugrep
@vcunat I undid those changes now, you are right, they were unnecessary. |
While testing this, |
Staged. |
Thanks! |
@vcunat I'm also happy to help build-farm wise, whenever it's time. |
@FlorianHeigl: You mean providing binaries for freebsd in some way? |
I noticed the breakage but forgot this patch in another branch. #10816 (comment)
This adds FreeBSD support by e.g. making bzip2's build-script use
cc
instead ofgcc
. This means that the result may be different for Linux systems that havecc
linked toclang
instead ofgcc
.Not all packages build on FreeBSD yet, but I hope to work on this at NixCon.