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

rw: init at 1.0 #39150

Merged
merged 2 commits into from Apr 19, 2018
Merged

rw: init at 1.0 #39150

merged 2 commits into from Apr 19, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Apr 19, 2018

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: rw

Partial log (click to expand)

cp rw.1 /nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0/share/man/man1/rw.1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0
shrinking /nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0/bin/rw
gzipping man pages under /nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0/share/man/
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0/bin
patching script interpreter paths in /nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0
checking for references to /build in /nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0...
/nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: rw

Partial log (click to expand)

rw.c:281:17: error: use of undeclared identifier 'CLOCK_MONOTONIC'
                clock_gettime(CLOCK_MONOTONIC, &now);
                              ^
rw.c:551:16: error: use of undeclared identifier 'CLOCK_MONOTONIC'
        clock_gettime(CLOCK_MONOTONIC, &start);
                      ^
1 warning and 3 errors generated.
make: *** [<builtin>: rw] Error 1
builder for '/nix/store/nf9sqg96d90fvj1pl8h4g9z2744vs9fm-rw-1.0.drv' failed with exit code 2
�[31;1merror:�[0m build of '/nix/store/nf9sqg96d90fvj1pl8h4g9z2744vs9fm-rw-1.0.drv' failed

@dtzWill
Copy link
Member Author

dtzWill commented Apr 19, 2018

Failure on x86_64-darwin (full log)

macports/macports-ports@03c5aa3#diff-b9ba10475be4170003c9abc6de63d1a2

Is there a good way to indicate required OSX version? (cc @NixOS/darwin-maintainers, @Ericson2314)

Would be nice to not have to mark it as known-"broken" on Darwin! :)

@copumpkin
Copy link
Member

copumpkin commented Apr 19, 2018

@dtzWill unfortunately not; instead of creating separate platforms for new OS releases, we opted (for ease of maintenance mostly) to homogenize the macOS platforms by papering over their differences. I think we currently do our best to look like 10.11, which means that clock_gettime isn't available. At some point we'll probably drop support for 10.11 and start pretending to be 10.12 or maybe even 10.13, and then this will work, but for now I think it'll be broken, unless you really want it to be available in nixpkgs, in which case you can hack around the limitation in this one derivation.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: rw

Partial log (click to expand)

cp rw.1 /nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0/share/man/man1/rw.1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0
shrinking /nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0/bin/rw
gzipping man pages under /nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0/share/man/
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0/bin
patching script interpreter paths in /nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0
checking for references to /build in /nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0...
/nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0

@matthewbauer
Copy link
Member

We might be able to hack it in without updating. It's actually pretty simple and lots of things use clock_gettime.

https://opensource.apple.com/source/Libc/Libc-1158.1.2/gen/clock_gettime.c.auto.html
https://opensource.apple.com/source/Libc/Libc-1158.1.2/include/time.h.auto.html

@LnL7
Copy link
Member

LnL7 commented Apr 19, 2018

I don't think we can because libSystem/Libc are impure. We explicity only reexport specific symbols so builds on 10.13 work on a 10.10 machine and the other way around.

@matthewbauer
Copy link
Member

Ok that complicates things a bit. Has anyone looked into making Libc pure? The xcbuild stuff could make it possible now.

@copumpkin
Copy link
Member

@matthewbauer yes, lots, but it's pretty hard, and parts of it are fundamentally impure because they're an unstable interface to a changing kernel.

Basically, libSystem comprises (among many others):

  • Libc (libsystem_c.dylib)
  • Xnu's libsystem_kernel.dylib

And Libc is the thing we could conceivably make pure, if we could avoid relying on specifics of libsystem_kernel.dylib. Having said that, the Libc build is a bit of a monster, and I've put some work into it in the past, but even with the native xcodebuild it's pretty tricky.

There's another intermediate "solution" here, which is that the libSystem.dylib we have right now that only reexports symbols doesn't have to limit itself to only reexporting symbols, and could actually contain a nontrivial implementation of functions not reexported, like clock_gettime. But having said that, I'd be wary of getting into the business of writing and maintaining our own libc functions 😄

@dtzWill
Copy link
Member Author

dtzWill commented Apr 19, 2018

Fascinating discussion/details, thanks!

Erm, I feel I should know how but.. anyone know how to best express "try to build everywhere other than darwin"? Is conditionally setting "broken" the way to go...? (cc @Ericson2314, JIC :))

@Ericson2314
Copy link
Member

Ericson2314 commented Apr 19, 2018

Yes I think conditionally setting broken is the way to go, especially since it's *supposed" to work on Darwin.

For more info, see discussion starting here:
NixOS#39150 (comment)
@dtzWill
Copy link
Member Author

dtzWill commented Apr 19, 2018

Yes I think conditionally setting broken is the way to go, especially since it's *supposed" to work on Darwin.

Great, thanks!

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: rw

Partial log (click to expand)

/nix/store/pvi0c1kpn1r63pc7xgdsqr4x6xzjp22q-rw-1.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: rw

Partial log (click to expand)

/nix/store/kv7lhqcpwnlccy39g58fdslpyfpk0yfj-rw-1.0

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: rw

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.


@dtzWill dtzWill merged commit 93814ed into NixOS:master Apr 19, 2018
@copumpkin
Copy link
Member

Thanks!

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

6 participants