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

netbsd.sys: fix build #119793

Merged
merged 5 commits into from Apr 18, 2021
Merged

netbsd.sys: fix build #119793

merged 5 commits into from Apr 18, 2021

Conversation

alyssais
Copy link
Member

Motivation for this change

Tested with

nix-build -A pkgsCross.x86_64-netbsd.netbsd.sys

I haven't tested what happens if I try to build it on Linux without going through pkgsCross.

Note that despite the comment above the package definition, this is not the full NetBSD kernel, only the headers, firmware and bootloader. I would like it to also build the kernel, but haven't managed to get that working yet (but I'm probably close).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Permanently changing the directory here was breaking the kernel build,
which needs to do other things after moveUsrDir.
Required to build the NetBSD kernel.
Otherwise, would try to install firmware to /libdata/firmware.
@sternenseemann
Copy link
Member

Native compilation on x86_64-linux fails:

In file included from /nix/store/m82xc9v1h6p06vhvva2gbl69mjsdvddm-glibc-2.32-40-dev/include/features.h:489,
                 from /nix/store/g9iwhx99jvwv3mh9fr5l7jv1ad4qpnha-compat-netbsd-8.0/include/compat_defs.h:27,
                 from /nix/store/g9iwhx99jvwv3mh9fr5l7jv1ad4qpnha-compat-netbsd-8.0/include/nbtool_config.h:875,
                 from <command-line>:
/nix/store/m82xc9v1h6p06vhvva2gbl69mjsdvddm-glibc-2.32-40-dev/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
    7 | # include <gnu/stubs-32.h>
      |           ^~~~~~~~~~~~~~~~
compilation terminated.
*** [mbr.o] Error code 1

@alyssais
Copy link
Member Author

Native compilation on x86_64-linux fails

I think that's fine. This package should probably be NetBSD-only, but the meta.platforms line is commented out for some reason. I'd like to leave it that way for now until I have a better handle on why that might have been.

Sound okay to you?

@sternenseemann
Copy link
Member

Sound okay to you?

Sure, don't see why we necessarily need the NetBSD kernel on Linux…

FWIW, pkgsCross.x86_64-netbsd.netbsd.sys builds for me as well. pkgsCross.x86_64-netbsd-llvm.netbsd.sys chokes on csu, something we should tackle somewhere else (if feasible).

uudecode also compiles with the native linux stdenv.

No real comments from my side.

I don't think there's any reason for this not to be set.  Maybe it was
from before netbsd.headers overrode meta.platforms for its
constituents.
@alyssais
Copy link
Member Author

Yeah, I've changed my mind and added the meta.platforms line.

@Ericson2314 Ericson2314 merged commit 3ad122f into NixOS:staging Apr 18, 2021
@alyssais alyssais deleted the netbsd-sys branch April 18, 2021 18:58
@alyssais alyssais added the 6.topic: bsd Running or building packages on BSD label Apr 18, 2021
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.

None yet

3 participants