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

gdb: Flexible target matching for darwin #36378

Merged
merged 1 commit into from Mar 7, 2018

Conversation

thefloweringash
Copy link
Member

Outside of the nix-build the target is x86_64-apple-darwin17.4.0,
while inside the target is x86_64-apple-darwin. This difference
causes the fallback target configuration for darwin, which disables
gdb. Add a patch to make the target matching more flexible.

This feels like patching a symptom more than a cause, is there a more principled alternative?

Motivation for this change

#35677

Things done
  • 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.

@thefloweringash
Copy link
Member Author

I filed this with the base branch of release-17.09, which was the subject of the bug report. Apologies if this is inappropriate. The package in master is similarly broken, and this patch can be trivially cherry-picked to master.

@LnL7
Copy link
Member

LnL7 commented Mar 6, 2018

Please target master instead, cherry-picking happens in the other direction.

@dtzWill
Copy link
Member

dtzWill commented Mar 6, 2018

Thanks for tackling this! 👍.

Outside of the nix-build the target is `x86_64-apple-darwin17.4.0`,
while inside the target is `x86_64-apple-darwin`. This difference
causes the fallback target configuration for darwin, which disables
gdb. Add a patch to make the target matching more flexible.
@thefloweringash thefloweringash changed the base branch from release-17.09 to master March 7, 2018 03:09
@thefloweringash
Copy link
Member Author

Retargeted to master.

@LnL7
Copy link
Member

LnL7 commented Mar 7, 2018

@GrahamcOfBorg build gdb

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

these paths will be fetched (8.27 MiB download, 53.84 MiB unpacked):
  /nix/store/0vj17gip63r5ix80qfjxixmjf3rpm6lh-mpfr-3.1.6
  /nix/store/36gpmflnfv3rhbvsb9qpvhpgi4956gza-hook
  /nix/store/gsli150kw9f1jpwzcal2s6md3k6k53hl-gdb-8.1
copying path '/nix/store/36gpmflnfv3rhbvsb9qpvhpgi4956gza-hook' from 'https://cache.nixos.org'...
copying path '/nix/store/0vj17gip63r5ix80qfjxixmjf3rpm6lh-mpfr-3.1.6' from 'https://cache.nixos.org'...
copying path '/nix/store/gsli150kw9f1jpwzcal2s6md3k6k53hl-gdb-8.1' from 'https://cache.nixos.org'...
/nix/store/gsli150kw9f1jpwzcal2s6md3k6k53hl-gdb-8.1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

/nix/store/cjh3bl77gbwmj56i1dm5b6rlhzwamvqx-gdb-8.1

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Partial log (click to expand)

make[3]: Leaving directory '/private/tmp/nix-build-gdb-8.1.drv-0/gdb-8.1/gdb'
make[2]: Leaving directory '/private/tmp/nix-build-gdb-8.1.drv-0/gdb-8.1/gdb'
make[1]: Nothing to be done for 'install-target'.
make[1]: Leaving directory '/private/tmp/nix-build-gdb-8.1.drv-0/gdb-8.1'
removed '/nix/store/zam77k38hpbpkfzlza506m9zsf9yfsr5-gdb-8.1/share/info/bfd.info'
post-installation fixup
gzipping man pages under /nix/store/zam77k38hpbpkfzlza506m9zsf9yfsr5-gdb-8.1/share/man/
strip is /nix/store/4sdh09gmvl15cy0zb6i7mbvxh5syz206-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/zam77k38hpbpkfzlza506m9zsf9yfsr5-gdb-8.1/bin
patching script interpreter paths in /nix/store/zam77k38hpbpkfzlza506m9zsf9yfsr5-gdb-8.1

Copy link
Member

@LnL7 LnL7 left a comment

Choose a reason for hiding this comment

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

Thanks!

@LnL7 LnL7 merged commit cbed7cd into NixOS:master Mar 7, 2018
@LnL7 LnL7 added the 8.has: port to stable A PR already has a backport to the stable release. label Mar 7, 2018
@LnL7
Copy link
Member

LnL7 commented Mar 7, 2018

cherry-picked in fe0728f and 17ff10a.

@ThomasMader
Copy link
Contributor

ThomasMader commented Apr 27, 2018

It looks like that commit broke the build for ldc on Darwin because gdb is used in some tests and doesn't work without a signed binary. https://hydra.nixos.org/build/72723666/nixlog/5

797: Unable to find Mach task port for process-id 85602: (os/kern) failure (0x5).
797: (please check gdb is codesigned - see taskgated(8))
797: thread.c:93: internal-error: struct thread_info *inferior_thread(): Assertion `tp' failed.
797: A problem internal to GDB has been detected,
797: further debugging may prove unreliable.

I guess this should be fixed as soon as #38624 is merged.

@LnL7
Copy link
Member

LnL7 commented Apr 27, 2018

We should disable the gdb related tests, we already do that in some other places.

@ThomasMader
Copy link
Contributor

I think you misunderstood.
LDC has a test suite in which two tests use gdb to test things. Those things are LDC specific.
Those tests are not done anywhere else.

@thefloweringash thefloweringash deleted the fix-gdb-darwin branch July 23, 2018 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 8.has: port to stable A PR already has a backport to the stable release. 10.rebuild-darwin: 101-500 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants