-
Notifications
You must be signed in to change notification settings - Fork 88
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
(PA-5594) Enable macOS 13 (ARM) puppet-runtime builds for agent-runtime-7.x #684
Conversation
configs/components/_base-ruby.rb
Outdated
@@ -50,7 +50,7 @@ | |||
pkg.environment 'optflags', settings[:cflags] + ' -O3' | |||
elsif platform.is_macos? | |||
pkg.environment 'optflags', settings[:cflags] | |||
if platform.is_cross_compiled? | |||
if platform.architecture == 'arm64' | |||
# Pin to an older version of ruby@2.5. This can be removed once we're no longer cross-compiling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be able to remove this conditional in pinning to ruby 2.5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can exclude this change after rebasing, see https://github.com/puppetlabs/puppet-runtime/pull/680/files#r1253820661.
Also @tvpartytonight is right that Ruby 2.5 is no longer needed (it was used in Puppet 6 which is EOL). If there isn't a PA ticket filed already about removing 6.x code from the runtime, can you file one and we can delete that code later?
Since macOS 13 ARM in puppet7 and 8 share many of the same components, e.g. augeas, ruby, etc, we're having to make the same set of changes in this PR and #680. For example, see my comment about cross-compiling in https://github.com/puppetlabs/puppet-runtime/pull/680/files#r1253820661. I talked with @shubhamshinde360 yesterday and I think we're close to landing his PR. Let's focus on getting that merged and then rebase this PR against upstream/master. I'll also leave some specific comments inline. |
@skyamgarp I was able to reproduce the build failure. The issue is a combination of brew bumping packages to depend on openssl 3 and the fact that we're doing native compiles on macOS 13 ARM. First, the build fails because it can't find
Next, we can see brew installed OpenSSL 3:
This can be fixed by passing cd ruby-2.7.8 && \
bash configure --enable-shared --enable-bundled-libyaml --disable-install-doc --disable-install-rdoc --prefix=/opt/puppetlabs/puppet --with-opt-dir=/opt/puppetlabs/puppet --with-baseruby=/opt/puppetlabs/puppet/bin/ruby --with-coroutine=arm64 --enable-dtrace --with-openssl-dir=/opt/puppetlabs/puppet This doesn't break the And I think Long story short, I think we should be adding Also for posterity, homebrew seems to require ruby >= 2.6.10, because it only installs it on macOS 11 and 12, but not 13. And those have different preinstalled ruby versions:
|
configs/components/ruby-2.7.8.rb
Outdated
elsif platform.is_cross_compiled? && platform.is_macos? | ||
elsif platform.is_macos? && platform.architecture == 'arm64' | ||
if platform.os_version.to_i >= 13 | ||
pkg.environment 'PATH', '/opt/homebrew/bin:$(PATH):/usr/local/bin' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest adding this for macOS 13+ ARM only for now:
special_flags += " --with-openssl-dir=#{settings[:prefix]} "
And then file a ticket to investigate adding to all native builds later (in both ruby-2.7.8.rb
and ruby-3.2.2.rb
)
special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} "
special_flags += "--with-openssl-dir=#{settings[:prefix]} " unless platform.is_cross_compiled?
37e4f84
to
664fc39
Compare
Hello,
The result of component diff :
`
Platform name: osx-13-arm64
Component 'openssl-1.1.1'
Field: configure[0]
--------------------
- [" ./Configure --prefix=/opt/puppetlabs/puppet --libdir=lib --openssldir=/opt/puppetlabs/puppet/ssl shared no-asm darwin64-x86_64-cc no-camellia no-ec2m no-md2 no-ssl3 no-dtls no-dtls1 no-idea no-seed no-weak-ssl-ciphers -DOPENSSL_NO_HEARTBEATS -I/opt/puppetlabs/puppet/include "]
+ [" ./Configure --prefix=/opt/puppetlabs/puppet --libdir=lib --openssldir=/opt/puppetlabs/puppet/ssl shared no-asm darwin64-arm64-cc no-camellia no-ec2m no-md2 no-ssl3 no-dtls no-dtls1 no-idea no-seed no-weak-ssl-ciphers -DOPENSSL_NO_HEARTBEATS -I/opt/puppetlabs/puppet/include "]
`
And vanagon generic pipeline
Also, Artifacts