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

Fix Darwin build #1093

Closed
wants to merge 1 commit into from
Closed

Conversation

copumpkin
Copy link
Member

This should fix #1091, #1092, and #1013.

make installcheck shows that 10 tests failed, so this is effectively untested and I don't know whether that's expected. I don't really have a last known good state to check against.

@edolstra @shlevy can you give some guidance on how to test this properly? Are all tests expected to pass on Darwin?

Also, I'd prefer to delete the _XOPEN_SOURCE altogether if possible, but if we keep it, it should be 700.

@shlevy
Copy link
Member

shlevy commented Oct 19, 2016

No idea if tests are expected to pass, but I'm 👍 on this or just removing the define altogether. Anything in the commit logs indicate why it's there?

@copumpkin
Copy link
Member Author

It looks like it was added by copumpkin@77d2726, possibly to support large files? Not sure if it's still relevant.

@shlevy
Copy link
Member

shlevy commented Oct 19, 2016

I'd just nuke it.

@copumpkin
Copy link
Member Author

copumpkin commented Oct 19, 2016

Okay, I nuked it. Here are the failures (it claims there are 9 this time, but I see more FAIL errors than that):

error: syntax error, unexpected INT, expecting ID or OR_KW or DOLLAR_CURLY or '"', at /Users/copumpkin/Sandbox/nix/tests/lang/eval-okay-fromjson.nix:33:21
FAIL: eval-okay-fromjson should evaluate
error: attribute ‘partition’ missing, at /Users/copumpkin/Sandbox/nix/tests/lang/eval-okay-partition.nix:3:1
FAIL: eval-okay-partition should evaluate
error: syntax error, unexpected INT, expecting ID or OR_KW or DOLLAR_CURLY or '"', at /Users/copumpkin/Sandbox/nix/tests/lang/eval-okay-tojson.nix:11:11
FAIL: eval-okay-tojson should evaluate
error: syntax error, unexpected INT, expecting ID or OR_KW or DOLLAR_CURLY or '"', at /Users/copumpkin/Sandbox/nix/tests/lang/eval-okay-types.nix:16:15
FAIL: eval-okay-types should evaluate
error: syntax error, unexpected INT, expecting ID or OR_KW or DOLLAR_CURLY or '"', at /Users/copumpkin/Sandbox/nix/tests/lang/eval-okay-xml.nix:5:11
FAIL: eval-okay-xml should evaluate
FAIL: tests/lang.sh
+ echo 'hashDerivationModulo appears broken, got /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/qv9cs0jqna0p1f9la98pl6nl7b017b87-dependencies.drv'
hashDerivationModulo appears broken, got /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/qv9cs0jqna0p1f9la98pl6nl7b017b87-dependencies.drv
+ exit 1
FAIL: tests/simple.sh
+ '[' /var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/var/nix/gcroots/foo = /var/folders/vv/17b_hycx691699h20v458fnh0000gn/T//nix-test/var/nix/gcroots/foo ']'
FAIL: tests/gc.sh
+ nix-env --version
+ grep 1.12
FAIL: tests/misc.sh
nix-channel.sh: line 18: nix: command not found
FAIL: tests/nix-channel.sh
+ nix copy --recursive --to file:///var/folders/vv/17b_hycx691699h20v458fnh0000gn/T//nix-test/binary-cache /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/4rib1wqbnk9fj135akmp8vvlk3qay669-dependencies
binary-cache.sh: line 9: nix: command not found
FAIL: tests/binary-cache.sh
+ nix copy --recursive --to file:///var/folders/vv/17b_hycx691699h20v458fnh0000gn/T//nix-test/binary-cache /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/4rib1wqbnk9fj135akmp8vvlk3qay669-dependencies
repair.sh: line 49: nix: command not found
FAIL: tests/repair.sh
building path(s) ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/33s0ndqgzvwqz1zikfsw9mk12q559f7x-check-reqs-3’
output ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/33s0ndqgzvwqz1zikfsw9mk12q559f7x-check-reqs-3’ is not allowed to refer to path ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/lzfwi4wsmihajyjcpchn5qpwd5zac07q-check-reqs-dep2’
error: build of ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/6aasci6pgg9nb6rm0zms7w2b5awn9a2x-check-reqs-3.drv’ failed
+ grep -q check-reqs-dep1
FAIL: tests/check-reqs.sh
error: undefined variable ‘placeholder’ at (string):11:18
(use ‘--show-trace’ to show detailed location information)
FAIL: tests/placeholders.sh

I almost feel like the test is using the wrong Nix on my system, based on those test failures?

@shlevy
Copy link
Member

shlevy commented Oct 19, 2016

Yeah that's really strange...

@copumpkin
Copy link
Member Author

So yeah, I sandwiched a type a nix-build into one of the tests, and sure enough it prints out:

+ type -a nix-build
nix-build is /Users/copumpkin/.nix-profile/bin/nix-build

So something is wonky with make installcheck on my machine/platform.

@copumpkin
Copy link
Member Author

Okay, partial PEBKAC. I wasn't running make install before make installcheck, assuming that make install was going to actually install stuff somewhere and that installcheck would put it somewhere temporary 😄

After running make install, only 2 tests fail:

running test tests/simple.sh
++ nix-instantiate simple.nix
warning: you did not specify ‘--add-root’; the result might be removed by the garbage collector
+ drvPath=/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/zkha6c7sqn63cq6psfmjr2wxk9bij88r-simple.drv
++ nix-store -q --binding system /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/zkha6c7sqn63cq6psfmjr2wxk9bij88r-simple.drv
+ test x86_64-darwin = x86_64-darwin
+ echo 'derivation is /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/zkha6c7sqn63cq6psfmjr2wxk9bij88r-simple.drv'
derivation is /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/zkha6c7sqn63cq6psfmjr2wxk9bij88r-simple.drv
++ nix-store -rvv /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/zkha6c7sqn63cq6psfmjr2wxk9bij88r-simple.drv
these derivations will be built:
  /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/zkha6c7sqn63cq6psfmjr2wxk9bij88r-simple.drv
building path(s) ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple’
executing pre-build hook ‘/Users/copumpkin/Sandbox/nix/inst/libexec/nix/resolve-system-dependencies’
executing builder ‘/nix/store/jxk94adn3flzlb1xqay7c6k8wmnkkc0k-bash-4.3-p46/bin/bash’
PATH=
scanning for references inside ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple’
warning: you did not specify ‘--add-root’; the result might be removed by the garbage collector
+ outPath=/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple
+ echo 'output path is /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple'
output path is /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple
++ cat /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple/hello
+ text='Hello World!'
+ test 'Hello World!' '!=' 'Hello World!'
+ nix-store --delete /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple
finding garbage collector roots...
deleting ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple’
deleting ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/trash’
deleting unused links...
note: currently hard linking saves 0.00 MiB
1 store paths deleted, 0.00 MiB freed
+ test -e /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/9nks3d25ipksg6rya3rb22vvxwhhwp8r-simple/hello
++ NIX_REMOTE='local?store=/foo&real=/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T//real-store'
++ nix-instantiate --readonly-mode hash-check.nix
error: the path ‘/var’ is a symlink; this is not allowed for the Nix store and its parent directories
+ outPath=
FAIL: tests/simple.sh
running test tests/gc.sh
++ nix-instantiate dependencies.nix
warning: you did not specify ‘--add-root’; the result might be removed by the garbage collector
+ drvPath=/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/bhhsbdrbz2wzb21i13ilwczn8v3cy850-dependencies.drv
++ nix-store -rvv /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/bhhsbdrbz2wzb21i13ilwczn8v3cy850-dependencies.drv
warning: you did not specify ‘--add-root’; the result might be removed by the garbage collector
+ outPath=/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/fa98kdkn23jkgqihg9s8q68dy3jp96fl-dependencies
+ rm -f /var/folders/vv/17b_hycx691699h20v458fnh0000gn/T//nix-test/var/nix/gcroots/foo
+ ln -sf /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/fa98kdkn23jkgqihg9s8q68dy3jp96fl-dependencies /var/folders/vv/17b_hycx691699h20v458fnh0000gn/T//nix-test/var/nix/gcroots/foo
++ nix-store -q --roots /private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/store/fa98kdkn23jkgqihg9s8q68dy3jp96fl-dependencies
removing stale link from ‘/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/var/nix/gcroots/auto/1zbb5f7lwlg6wr0v7dkwv1ln7ja11fmw’ to ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-build-2191-0/result’
removing stale link from ‘/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/var/nix/gcroots/auto/i8xa0fwvs98v2fkfkdcfdjdmm6y2cyg6’ to ‘/private/var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-build-2191-0/derivation’
+ '[' /var/folders/vv/17b_hycx691699h20v458fnh0000gn/T/nix-test/var/nix/gcroots/foo = /var/folders/vv/17b_hycx691699h20v458fnh0000gn/T//nix-test/var/nix/gcroots/foo ']'
FAIL: tests/gc.sh

edolstra added a commit that referenced this pull request Oct 19, 2016
Done slightly differently from #1093.
@edolstra
Copy link
Member

I've just pushed a fix for that (af3db85).

@copumpkin
Copy link
Member Author

copumpkin commented Oct 19, 2016

Oh thanks. I assumed you were trying to avoid using environ 😄 any reason to prefer execvp with environ over execle? Also, any idea what's wrong with the last two tests?

@copumpkin
Copy link
Member Author

Oh sorry, misread your commit. You pushed a commit fixing the broken tests, and separately pushed a commit that fixed the broken build. Thanks!

@copumpkin
Copy link
Member Author

Build works and all tests now pass on Darwin on master!

@copumpkin copumpkin closed this Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

O_CLOEXEC requires a higher _XOPEN_SOURCE value
3 participants