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

Remove cruft from platform descriptions #34274

Closed
Ericson2314 opened this Issue Jan 25, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@Ericson2314
Member

Ericson2314 commented Jan 25, 2018

Simply put, I should be able to do

$ nix-build '<nixpkgs>' --arg crossSystem '{ config = "aarch64-unknown-linux-gnu"; }' -A stdenv

and that should work. I could make it work right now with a dirty white-list and fall-backs, but that's kind of defeats the point.

Currently, the biggest culprits are

  1. Random top-level fields, like withTLS and openssl.system. See https://github.com/NixOS/nixpkgs/blob/master/lib/systems/examples.nix
  2. The platform field, see https://github.com/NixOS/nixpkgs/blob/master/lib/systems/platforms.nix
  3. arch which overlaps with the far more principled parsed,arch. See elaborate https://github.com/NixOS/nixpkgs/blob/master/lib/systems/default.nix#L17.

The general design issue is we need to handle the per-package random crap in a more modular way, without giving up the possibility of the user to override with their own values. My GNU ld emulation picking logic at https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/bintools-wrapper/default.nix#L167-L179 is certainly in a more modular location, but also cannot be nicely overridden.

Checklist


CC @dtzWill @dezgeg @Infinisil @teto

@teto

This comment has been minimized.

Contributor

teto commented Jan 26, 2018

I have a PR in the works (should be ready tomorrow) that allows to do

my_kernel = buildLinux {
kernelAutoModules=true, ignoreConfigErrors=true, kernelPreferBuiltin
}

which makes for a much better experience as it looks more like your typical derivation.
I let the parameters kernelAutoModules etc as defaults in the platform sets. Do you suggest I remove these parameters from these platform sets https://github.com/NixOS/nixpkgs/blob/master/lib/systems/platforms.nix#L36 ?

@Ericson2314

This comment has been minimized.

Member

Ericson2314 commented Jan 26, 2018

@teto I'd say only leave things for kernel headers there, as that actually effects everything (on Linux).

@dezgeg

This comment has been minimized.

Contributor

dezgeg commented Jan 26, 2018

I agree for refactoring openssl and most of the kernel stuff out, but much of the other stuff seems quite hard to get rid of.

@dezgeg

This comment has been minimized.

Contributor

dezgeg commented Jan 26, 2018

I made some WIP stuff for the kernel one time: https://github.com/NixOS/nixpkgs/compare/master...dezgeg:kernel-plat-fix?expand=1, but IIRC some of the kernels failed to boot during runtime, still need to debug that one day.

Ericson2314 added a commit to obsidiansystems/nixpkgs that referenced this issue Jan 26, 2018

lib, glibc: Get rid of withTLS
glibc removed the underlying flag in 2011 in
83cd14204559abbb52635006832eaf4d2f42514a [1].

This gets us one step closer to fixing NixOS#34274: the cross stdenv for
aarch64-unknown-linux-gnu at least evals now.

Thanks to @dezgeg for doing all the research for this.

[1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=83cd14204559abbb52635006832eaf4d2f42514a

@Ericson2314 Ericson2314 referenced this issue Jan 26, 2018

Merged

lib, glibc: Get rid of withTLS #34303

0 of 8 tasks complete

Ericson2314 added a commit to obsidiansystems/nixpkgs that referenced this issue Jan 26, 2018

lib, glibc: Get rid of withTLS
glibc removed the underlying flag in 2011 in
83cd14204559abbb52635006832eaf4d2f42514a [1].

This gets us one step closer to fixing NixOS#34274: the cross stdenv for
aarch64-unknown-linux-gnu at least evals now.

Thanks to @dezgeg for doing all the research for this.

[1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=83cd14204559abbb52635006832eaf4d2f42514a

dezgeg added a commit that referenced this issue Jan 26, 2018

lib, glibc: Get rid of withTLS
glibc removed the underlying flag in 2011 in
83cd14204559abbb52635006832eaf4d2f42514a [1].

This gets us one step closer to fixing #34274: the cross stdenv for
aarch64-unknown-linux-gnu at least evals now.

Thanks to @dezgeg for doing all the research for this.

[1]: https://sourceware.org/git/?p=glibc.git;a=commit;h=83cd14204559abbb52635006832eaf4d2f42514a

@Ericson2314 Ericson2314 referenced this issue Jan 27, 2018

Merged

lib: Platform attribute cleanup #34315

0 of 8 tasks complete

@teto teto referenced this issue Jan 28, 2018

Merged

[RDY] buildLinux: Add more overrides #34351

3 of 8 tasks complete

@Ericson2314 Ericson2314 added this to the 18.03 milestone Jan 31, 2018

@Ericson2314

This comment has been minimized.

Member

Ericson2314 commented Feb 7, 2018

Per #34645 (comment) @dtzWill and I need to figure out whether to moved libc into parsed, or similar. @dezgeg or anyone else have any opinions? #34444 is also impacted.

@dtzWill

This comment has been minimized.

Contributor

dtzWill commented Feb 7, 2018

For what it's worth, I've started using just the "config" in my cross specifications and so far so good!

I don't cross-build kernels as part of my work or testing, and I note that is the remaining TODO item :). Just wanted to chime in that the rest is in a good place!

Minor convenience thing: it's annoying to specify --arg crossSystem '{ config = "x"; }' instead of something like --argstr crossConfig x, especially as the good work on this issue makes anything other than config unnecessary (at least usually). Is there a simple way we could allow the shorter syntax without compromising abstractions?
(similar to how we handle "system" today, minus special nix support)

@Ericson2314

This comment has been minimized.

Member

Ericson2314 commented Feb 7, 2018

@dtzWill Maybe we can get --argstr crossSystem.config to work for 1.12? Though I feel bad asking for new features for that release, I'm hesitant to add any more sugar as the platform stuff is already far too complicated.

made issue: NixOS/nix#1850

@dtzWill

This comment has been minimized.

Contributor

dtzWill commented Feb 8, 2018

@Ericson2314 thanks for the issue, and agreed not priority for nix update. I was just wanting to discuss it to see what you had in mind.

I'll follow that issue, neat idea!

I agree we shouldn't further complicate the platform stuff, haha, it's actually partly why I asked O:).

@Ericson2314

This comment has been minimized.

Member

Ericson2314 commented May 15, 2018

I made a bunch of changes so this is now true. All the examples contain at most config, platform, and additional platform-specific flags like useIosPrebuilt that are new and don't overlap. Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment