Skip to content

dmd: fix for #138376#138462

Closed
lionello wants to merge 1 commit intoNixOS:masterfrom
lionello:dmd-bootstrap-138376
Closed

dmd: fix for #138376#138462
lionello wants to merge 1 commit intoNixOS:masterfrom
lionello:dmd-bootstrap-138376

Conversation

@lionello
Copy link
Copy Markdown
Contributor

Motivation for this change

This is a suggested fix for #138376: autoPatchelfHook could not satisfy dependency ld-linux.so.2. I don't have a Linux machine to test this right now, but will spin up a VM.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages 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/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

autoPatchelfHook could not satisfy dependency ld-linux.so.2
@lionello lionello requested a review from vcunat September 18, 2021 21:16
@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Sep 18, 2021
@dukc
Copy link
Copy Markdown
Contributor

dukc commented Sep 23, 2021

No, this does not work. GLibc is already in propagatedBuildInputs and adding it to native build inputs changes nothing, at least for me. For me it seems it's looking for a linker, as a run-time dependency (but it wouldn't be first time I'm misreading error messages). I wonder why it compiled before but stopped now?

@trofi
Copy link
Copy Markdown
Contributor

trofi commented Sep 23, 2021

If it's of any help dmd started failing after this change:

commit b79483d
Author: Noah Fontes noah@noahfontes.com
Date: Sun Sep 12 15:07:15 2021 -0700

autoPatchelfHook: fix detection under crossSystem

In #84415, autoPatchelfHook was taught to use the correct path to the
readelf binary when a crossSystem is specified. Unfortunately, the
remainder of the functionality in the script depended on ldd, which only
reads ELF files of its own architecture. It has the further unfortunate
quality of not reporting any useful error, but rather that the file is
not a dynamic executable.

This change uses patchelf to directly analyze the DT_NEEDED tags in the
target files instead, which correctly works across architectures. It
also updates the use of objdump to be prefix-aware $OBJDUMP (which would
have been required in the PR mentioned above, but we never made it that
far into the script execution).

pkgs/build-support/setup-hooks/auto-patchelf.sh | 95 ++++++++++++++++++-------
1 file changed, 71 insertions(+), 24 deletions(-)

@lionello
Copy link
Copy Markdown
Contributor Author

Should've been fixed by #137886

@lionello lionello closed this Sep 25, 2021
@lionello lionello deleted the dmd-bootstrap-138376 branch September 25, 2021 15:28
@dukc
Copy link
Copy Markdown
Contributor

dukc commented Sep 25, 2021

Let's assume so for now. It hasn't hit the unstable channel in Hydra yet, though. I'll wait for that and then test.

@dukc
Copy link
Copy Markdown
Contributor

dukc commented Oct 13, 2021

Sorry a bit late with the testing, but yes DMD 2.097 now builds again with unstable channel on NixOS.

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

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants