rake-compiler / rake-compiler-dock

Easy to use and reliable cross compiler environment for building Windows, Linux, Mac and JRuby binary gems.
MIT License
78 stars 30 forks source link

test: reproduce issues with missing compiler-rt symbols #59

Closed flavorjones closed 2 years ago

flavorjones commented 2 years ago

The clang macro __builtin_available uses ___isOSVersionAtLeast, which is defined in the compiler-rt runtime library. The compiler-rt library is not currently provided in the rake-compiler-dock environment, which means this symbol may end up being unresolved.

https://github.com/grpc/grpc/issues/28271 reports that the symbol ___isOSVersionAtLeast is undefined at runtime. This PR attempts to reproduce that error.

Presuming that his test is valid and reproduces the issue, I have a second PR ready to go which adds compiler-rt to the darwin build environments that should make this test pass.

flavorjones commented 2 years ago

Success, in that we're seeing the expected failure:

Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching rake 13.0.6
Installing rake 13.0.6
Using bundler 2.2.32
Fetching minitest 5.14.4
Fetching rake-compiler 1.1.1
Fetching rake-compiler-dock 1.1.0
Installing rake-compiler 1.1.1
Installing rake-compiler-dock 1.1.0
Installing minitest 5.14.4
Using rcd_test 1.0.0 from source at `.`
Bundle complete! 5 Gemfile dependencies, 6 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Run options: --seed 46435
dyld: lazy symbol binding failed: Symbol not found: ___isOSVersionAtLeast

  Referenced from: /Users/runner/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/rcd_test-1.0.0-x86_64-darwin/lib/rcd_test/3.0/rcd_test_ext.bundle
# Running:
  Expected in: flat namespace

.
dyld: Symbol not found: ___isOSVersionAtLeast
  Referenced from: /Users/runner/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/rcd_test-1.0.0-x86_64-darwin/lib/rcd_test/3.0/rcd_test_ext.bundle
  Expected in: flat namespace

rake aborted!
SignalException: SIGABRT

Tasks: TOP => test
(See full trace by running task with --trace)
Error: Process completed with exit code 1.

I'm going to submit a second PR that has both this test and the proposed fix.

flavorjones commented 2 years ago

Closing, see #60 for fix and followup.