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

llvmPackages: add support for native FreeBSD #311777

Merged
merged 2 commits into from
May 27, 2024

Conversation

rhelmot
Copy link
Contributor

@rhelmot rhelmot commented May 14, 2024

Description of changes

part of #296581

Tests were done with llvmPackages_16

  • asan doesn't work quite right, disable it
  • support for 32-bit FreeBSD uses by default logic tuned for a very old FreeBSD; fix that
  • Some llvm tests fail for the same reason as MacOS; disable them
  • libcxx no longer needs a FreeBSD special case
  • add a flag for the inclusion of terminfo, which helps compile static bootstrap files

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • x86_64-freebsd
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.]

Add a 👍 reaction to pull requests you find important.

Comment on lines 396 to 397
] ++ optionals (!enableTerminfo) [
"-DLLVM_ENABLE_TERMINFO=OFF"
Copy link
Contributor

@rrbutani rrbutani May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not opposed to this, just curious: what required this?

EDIT: sorry, missed your comment about bootstrap (though I don't see this option used in #296581...)

Do we want to also gate the ncurses dep on this option? It's currently disabled only for cross:
https://github.com/NixOS/nixpkgs/blob/e58c6b2579f01721118025823a14379c87e00eda/pkgs/development/compilers/llvm/common/llvm/default.nix#L121

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By plunging into the icy depths of the commit history from several branches ago, I was able to determine this was added while I was trying to get a bunch of things to compile cross-static for the bootstrap files. Sounds like I couldn't get a staticlib out of terminfo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention this in the commit message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I was also able to clarify some of the other parts of the commit message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do lib.cmakeBool for this if it is going to staging? Though I am not at all sure we need to go to staging.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't see that, haha. But why is it the case? The code looks pretty innocent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Let's just add a comment outside the script in Nix code then. And next staging we should move the rest of the comment outside too so we don't get this problem again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it even matter if it went through staging? There's no binary cache for FreeBSD anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alyssais Good point. But I guess it's still nice to quickly test that cross still works etc. too so that can help.

@rhelmot rhelmot added the 6.topic: bsd Running or building packages on BSD label May 15, 2024
@ofborg ofborg bot requested a review from rrbutani May 15, 2024 05:27
@rhelmot rhelmot force-pushed the freebsd-minimal3/llvmPackages branch 2 times, most recently from a718ea3 to 0a693be Compare May 17, 2024 19:48
@rhelmot
Copy link
Contributor Author

rhelmot commented May 17, 2024

I integrated the above discussion into a comment in common/llvm/default.nix. I think things have been addressed at this point, so I'm open to new reviews.

@ofborg ofborg bot requested a review from Ericson2314 May 17, 2024 20:48
@rhelmot rhelmot force-pushed the freebsd-minimal3/llvmPackages branch from 3d49478 to dc6f078 Compare May 17, 2024 21:09
* asan doesn't work quite right, disable it
* support for 32-bit FreeBSD uses by default logic tuned for a very old
  FreeBSD; fix that
* Some llvm tests fail for the same reason as MacOS; disable them
* libcxx no longer needs a FreeBSD special case
* Add an option to conditionally disable terminfo. terminfo doesn't seem
  to cross-compile static for FreeBSD, which means that it needs to be
  disabled when building the very early FreeBSD bootstrap tools.

Co-authored-by: John Ericson <git@JohnEricson.me>
@rhelmot
Copy link
Contributor Author

rhelmot commented May 18, 2024

well... with the new cmakeBool we are now mass-rebuilding linux too. Might as well just get the comment movement done now.

This is being done now because a mass rebuild is eminent anyway.
@Ericson2314 Ericson2314 merged commit 85536b3 into NixOS:staging May 27, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants