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

ruby: fix build on darwin #101441

Merged
merged 1 commit into from Oct 25, 2020
Merged

ruby: fix build on darwin #101441

merged 1 commit into from Oct 25, 2020

Conversation

@marsam
Copy link
Contributor

@marsam marsam commented Oct 23, 2020

Motivation for this change

cc-tools 949.0.1 added a warning on linking which ruby misinterprets as
an error with LDFLAGS.
fixes #101330
cc: @r-burns

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
cc-tools 949.0.1 added a warning on linking which ruby misinterprets as
an error with LDFLAGS.
@r-burns
Copy link
Contributor

@r-burns r-burns commented Oct 23, 2020

Hmm, I still have the same issue with this. Fails at something wrong with LDFLAGS="" but works when using -Wl,-w.

@marsam
Copy link
Contributor Author

@marsam marsam commented Oct 23, 2020

that is weird, I can build it on darwin:

$ nix-build -A ruby
/nix/store/rvb7avdslzv8rc60cgj13pzkqyr0a8bx-ruby-2.6.6

did you use nixpkgs-review? could you please create a pastebin with the output?

@zowoq
Copy link
Contributor

@zowoq zowoq commented Oct 23, 2020

I'm also still getting the same error with this PR.

The output is the same as https://hydra.nixos.org/build/128219205/nixlog/2 except for the patch being applied:

patching sources
applying patch /nix/store/sg8ilal3zr70fislb01yhbn9afpwgx6s-ignore-cc-tools-ld-warning.patch
patching file tool/darwin-cc
autoreconfPhase

@marsam
Copy link
Contributor Author

@marsam marsam commented Oct 25, 2020

Would you mind checking whether it works with the following patch?

diff -Naur ruby.old/tool/darwin-cc ruby.new/tool/darwin-cc
--- ruby.old/tool/darwin-cc
+++ ruby.new/tool/darwin-cc
@@ -2,5 +2,6 @@
 exec 2> >(exec grep -v \
   -e '^ld: warning: The [a-z0-9_][a-z0-9_]* architecture is deprecated for macOS' \
   -e '^ld: warning: text-based stub file /System/Library/Frameworks/' \
+  -e '^ld: warning: passed two min versions' \
   >&2)
 exec "$@"

if it doesn't work, I think we can apply #101330 (comment)

@zowoq
Copy link
Contributor

@zowoq zowoq commented Oct 25, 2020

Would you mind checking whether it works with the following patch?

Same error unfortunately.

@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Oct 25, 2020

@marsam Does not work with the original PR or your change.

checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS=""
builder for '/nix/store/9vzh08m75bvh4xyazdj6ch6b3qqnfhra-ruby-2.6.6.drv' failed with exit code 1
cannot build derivation '/nix/store/94lf9wij83nhz7xrz41m8hrnfkh4h10c-ruby-2.6.6.drv': 1 dependencies couldn't be built
error: build of '/nix/store/94lf9wij83nhz7xrz41m8hrnfkh4h10c-ruby-2.6.6.drv' failed

#101330 (comment) works for me.

@marsam marsam force-pushed the marsam:fix-darwin-build branch from 07aa0fd to d73cc1e Oct 25, 2020
@marsam
Copy link
Contributor Author

@marsam marsam commented Oct 25, 2020

I opted to use @r-burns solution with LDFLAGS="-Wl,-w", because AFAIK that warning is harmless, and ruby is the only one affected

@r-burns
Copy link
Contributor

@r-burns r-burns commented Oct 25, 2020

Sounds good to me. I imagine we'll just revert this and #101602 once the underlying issue is fixed.

@zowoq
zowoq approved these changes Oct 25, 2020
Copy link
Contributor

@zowoq zowoq left a comment

Builds locally.

@marsam marsam merged commit cbe6fd3 into NixOS:master Oct 25, 2020
19 of 20 checks passed
19 of 20 checks passed
@github-actions
tests
Details
@github-actions
action
Details
@ofborg
ruby, ruby.passthru.tests on x86_64-darwin
Details
@ofborg
Evaluation Performance Report Evaluator Performance Report
Details
@github-actions
Wait for ofborg
Details
@ofborg
grahamcofborg-eval ^.^!
Details
@ofborg
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
@ofborg
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
@ofborg
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="d73cc1e"; rev="d73cc1e58601a4d12cfc353e7478fee8b18126cd"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
@ofborg
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="d73cc1e"; rev="d73cc1e58601a4d12cfc353e7478fee8b18126cd"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="d73cc1e"; rev="d73cc1e58601a4d12cfc353e7478fee8b18126cd"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="d73cc1e"; rev="d73cc1e58601a4d12cfc353e7478fee8b18126cd"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="d73cc1e"; rev="d73cc1e58601a4d12cfc353e7478fee8b18126cd"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="d73cc1e"; rev="d73cc1e58601a4d12cfc353e7478fee8b18126cd"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="d73cc1e"; rev="d73cc1e58601a4d12cfc353e7478fee8b18126cd"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
@ofborg
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@ofborg
ruby, ruby.passthru.tests on aarch64-linux Success
Details
@ofborg
ruby, ruby.passthru.tests on x86_64-linux Success
Details
@marsam marsam deleted the marsam:fix-darwin-build branch Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants