Skip to content
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

Closed
wants to merge 11 commits into from
Closed

FreeBSD support #10816

wants to merge 11 commits into from

Conversation

ysangkok
Copy link
Contributor

@ysangkok ysangkok commented Nov 4, 2015

This adds FreeBSD support by e.g. making bzip2's build-script use cc instead of gcc. This means that the result may be different for Linux systems that have cc linked to clang instead of gcc.

Not all packages build on FreeBSD yet, but I hope to work on this at NixCon.

@AndersonTorres
Copy link
Member

It's good to know! I also want to port NixOS to NetBSD, so I will watch your efforts.

@ysangkok
Copy link
Contributor Author

ysangkok commented Nov 4, 2015

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?

@ysangkok
Copy link
Contributor Author

ysangkok commented Nov 4, 2015

@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.

@domenkozar
Copy link
Member

cc @tomster

@AndersonTorres
Copy link
Member

@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.

@ysangkok
Copy link
Contributor Author

ysangkok commented Nov 7, 2015

@AndersonTorres
Currently there is incomplete support for FreeBSD in Nix, but I am expecting mjacob's patch to get merged.

Build farm sounds like a good idea, but what exactly needs to be designed? I can sponsor a jail if needed.

@rickynils rickynils added the 6.topic: non-nixos Running packages on non-NixOS Linux label Nov 16, 2015
@ysangkok
Copy link
Contributor Author

This depends on NixOS/nix#657 so maybe we should wait until that is merged...

@AndersonTorres
Copy link
Member

A thing: are you testing it using clang and llvm stack? They are the preferred ones on FreeBSD nowadays.

@ysangkok
Copy link
Contributor Author

@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.

@vcunat
Copy link
Member

vcunat commented Nov 23, 2015

Just for the record, the new darwin (almost pure) stdenv uses clang.

@ysangkok
Copy link
Contributor Author

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.

@ysangkok
Copy link
Contributor Author

@nbp How would you like me to document this?

@nbp
Copy link
Member

nbp commented Nov 24, 2015

@domenkozar should we add a release note section to the Nixpkgs manual?

@nbp
Copy link
Member

nbp commented Nov 24, 2015

@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.

@vcunat
Copy link
Member

vcunat commented Nov 24, 2015

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.

@ysangkok
Copy link
Contributor Author

@vcunat Bitcoin is building and runs now, I am satisfied with this and would like to get it reviewed for merging.

@vcunat
Copy link
Member

vcunat commented Nov 29, 2015

OK, queued in my TODO ;-)

@eliask
Copy link

eliask commented Dec 8, 2015

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).
I tested this with the package from the ports tree too and got the same result, so clearly this is not specific to the Nix package.

@ysangkok
Copy link
Contributor Author

@vcunat I rebased onto current master.

@vcunat
Copy link
Member

vcunat commented Dec 30, 2015

The stdenvNative changes (in pkgs/stdenv/native/default.nix) seem useless now that stdenvFreeBSD is used instead. It's used by cygwin, for example, and it isn't clear to me if it would be broken by those changes (the alias targets might not be provided).

@ysangkok
Copy link
Contributor Author

ysangkok commented Jan 1, 2016

@vcunat I undid those changes now, you are right, they were unnecessary.

@vcunat
Copy link
Member

vcunat commented Jan 3, 2016

While testing this, cyrus_sasl wouldn't build on x86_64-linux; for now I've made the fetched patch and autoreconfHook conditional.

vcunat added a commit that referenced this pull request Jan 5, 2016
@vcunat
Copy link
Member

vcunat commented Jan 6, 2016

Staged.

@vcunat vcunat closed this Jan 6, 2016
@ysangkok
Copy link
Contributor Author

ysangkok commented Jan 6, 2016

Thanks!

@FlorianHeigl
Copy link

@vcunat I'm also happy to help build-farm wise, whenever it's time.

@vcunat
Copy link
Member

vcunat commented Jan 7, 2016

@FlorianHeigl: You mean providing binaries for freebsd in some way?

vcunat added a commit that referenced this pull request Jan 10, 2016
I noticed the breakage but forgot this patch in another branch.
#10816 (comment)
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new 6.topic: non-nixos Running packages on non-NixOS Linux 9.needs: documentation 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants