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 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 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 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 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 commented Oct 25, 2020

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

Same error unfortunately.

@SuperSandro2000
Copy link
Member

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
Copy link
Contributor Author

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 commented Oct 25, 2020

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

Copy link
Contributor

@zowoq zowoq left a comment

Choose a reason for hiding this comment

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

Builds locally.

@marsam marsam merged commit cbe6fd3 into NixOS:master Oct 25, 2020
@marsam marsam deleted the fix-darwin-build branch October 25, 2020 07:45
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.

cctools-port 949.0.1 broke various builds on macOS
4 participants