#61899 closed defect (fixed)
ruby27 @2.7.2: pre-built archive for Big Sur contains hardcoded path to 11.0 SDK
Reported by: | michaellass (Michael Lass) | Owned by: | kimuraw (kimura wataru) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | ruby27 |
Description
When ruby27 is installed from the pre-built archive (https://packages.macports.org/ruby27/ruby27-2.7.2_0.darwin_20.x86_64.tbz2), there are two files included with hardcoded paths to the 11.0 SDK:
- /opt/local/lib/ruby2.7/2.7.0/x86_64-darwin20/rbconfig.rb
- /opt/local/lib/pkgconfig/ruby-2.7.pc
The entries in the first file (rbconfig.rb) cause gem to fail building native extensions on macOS 11.1:
Building native extensions. This could take a while... ERROR: Error installing iStats: ERROR: Failed to build gem native extension. current directory: /Users/lass/.gem/ruby/gems/iStats-1.6.1/ext/osx_stats /opt/local/bin/ruby2.7 -I /opt/local/lib/ruby2.7/2.7.0 -r ./siteconf20201223-83991-j5zrwi.rb extconf.rb creating Makefile current directory: /Users/lass/.gem/ruby/gems/iStats-1.6.1/ext/osx_stats make "DESTDIR=" clean current directory: /Users/lass/.gem/ruby/gems/iStats-1.6.1/ext/osx_stats make "DESTDIR=" compiling smc.c clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk' [-Wmissing-sysroot] smc.c:20:10: fatal error: 'stdio.h' file not found #include <stdio.h> ^~~~~~~~~ 1 error generated. make: *** [smc.o] Error 1 make failed, exit code 2
Either changing the files manually from 11.0 to 11.1 or building ruby27 from source fixes the issue.
I'm not sure how this could be fixed properly to work on 11.0 and 11.1. Maybe it is possible to specify /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk as SDK in the portfile such that this more universal symlink is stored in those files instead.
Change History (8)
comment:1 Changed 4 years ago by jmroot (Joshua Root)
Cc: | kimuraw removed |
---|---|
Owner: | set to kimuraw |
Status: | new → assigned |
comment:3 Changed 4 years ago by kimuraw (kimura wataru)
Status: | assigned → accepted |
---|
comment:4 Changed 4 years ago by michaellass (Michael Lass)
I just noticed that gcc10 (and maybe other compilers) suffer from similar problems as well, looking for the 11.0 SDK when installed from a binary archive. There is still a bug report open from the last time this happened: https://trac.macports.org/ticket/59665
The workaround is similar to the one for ruby27: port upgrade -s -n --force gcc10
comment:5 Changed 4 years ago by kimuraw (kimura wataru)
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
The approach used by python is to detect at runtime when an -isysroot flag points to an SDK that doesn't exist, and remove it. Until and unless the ruby project wants to implement something similar, it may be best to simply delete all -isysroot flags from rbconfig.rb. That will result in the default SDK being used when one is not specified, but will still follow one specified in the environment if present. The .pc file should not contain any flags specifying an SDK in any case.