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

(PA-4774) Enable macOS 13 for agent-runtime main #680

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

shubhamshinde360
Copy link
Contributor

No description provided.

@shubhamshinde360 shubhamshinde360 requested review from a team as code owners June 5, 2023 11:38
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

⚠️ DISCLAIMER

This task is still experimental, it can be invoked locally provided that development dependencies are installed (bundle install --with development).

Ensure all your local changes are committed, then run bundle exec rake vanagon:component_diff -- [options].

Run the task with --help to see all available options. If you notice unexpected behavior or want to suggest improvements, ping #prod-puppet-agent on Slack.

Here is what your code changes would affect:

Project agent-runtime-main

Nothing is affected 😊

@shubhamshinde360 shubhamshinde360 changed the title (PA-4774) Add platform file for OSX 13 ARM 64 (PA-4774) Enable macOS 13 for agent-runtime main Jun 26, 2023
Copy link
Contributor

@joshcooper joshcooper left a comment

Choose a reason for hiding this comment

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

Hi @shubhamshinde360 this command is helpful to see which platforms will be affected by these changes. Unfortunately, many of the code paths are shared when compiling other platforms, so care must be taken to only modify the behavior for macOS 13 ARM:

$ bundle exec rake vanagon:component_diff -- -P agent-runtime-main -p all --from HEAD^ --to HEAD  | grep 'Platform name' 
Platform name: debian-10-armhf
Platform name: debian-10-amd64
Platform name: sles-12-ppc64le
Platform name: windowsfips-2012r2-x64
Platform name: windows-2012r2-x64
Platform name: sles-12-x86_64
Platform name: sles-11-i386
Platform name: debian-11-amd64
Platform name: el-6-x86_64
Platform name: el-8-ppc64le
Platform name: el-7-ppc64le
Platform name: el-6-i386
Platform name: redhatfips-8-x86_64
Platform name: el-8-x86_64
Platform name: el-7-ppc64
Platform name: el-7-x86_64
Platform name: sles-15-x86_64
Platform name: sles-11-x86_64
Platform name: ubuntu-18.04-aarch64
Platform name: windows-2012r2-x86
Platform name: ubuntu-20.04-aarch64
Platform name: redhatfips-7-x86_64
Platform name: osx-11-arm64
Platform name: osx-11-x86_64
Platform name: ubuntu-22.04-aarch64
Platform name: debian-11-armhf
Platform name: el-8-aarch64
Platform name: osx-12-x86_64
Platform name: windows-2019-x64
Platform name: el-9-x86_64
Platform name: aix-7.2-ppc
Platform name: fedora-36-x86_64
Platform name: ubuntu-20.04-amd64
Platform name: ubuntu-18.04-amd64
Platform name: ubuntu-22.04-amd64
Platform name: osx-12-arm64

We cross-compile for some non-mac platforms, so it's only safe to change platform.is_cross_compiled? if you're inside a platform.is_macos? condition.

@joshcooper
Copy link
Contributor

joshcooper commented Jul 7, 2023

Looks like this branch puppet-runtime#92a2c10b3 failed on macOS 11 x86_64

00:16:42 touch ruby-augeas-configure
00:16:42 export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin" && \
00:16:42 	export CONFIGURE_ARGS="--vendor" && \
00:16:42 	export PKG_CONFIG_PATH="/opt/puppetlabs/puppet/lib/pkgconfig:/usr/lib/pkgconfig" && \
00:16:42 	export CC="clang" && \
00:16:42 	export LDFLAGS="-L/opt/puppetlabs/puppet/lib" && \
00:16:42 	cd ruby-augeas-0.5.0 && \
00:16:42 	/usr/bin/patch --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../ruby-augeas-0.5.0-patch_c_extension.patch && \
00:16:42 	/opt/puppetlabs/puppet/bin/ruby ext/augeas/extconf.rb && \
00:16:42 	/usr/bin/make -e -j3
00:16:42 patching file ext/augeas/_augeas.c
00:16:42 *** ext/augeas/extconf.rb failed ***

But the same platform passes in puppet-runtime#master:

08:38:36 touch ruby-augeas-configure
08:38:36 export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/opt/pl-build-tools/bin:/usr/local/bin:/opt/csw/bin:/usr/ccs/bin:/usr/sfw/bin" && \
08:38:36 	export CONFIGURE_ARGS="--vendor" && \
08:38:36 	export PKG_CONFIG_PATH="/opt/puppetlabs/puppet/lib/pkgconfig:/usr/lib/pkgconfig" && \
08:38:36 	cd ruby-augeas-0.5.0 && \
08:38:36 	/usr/bin/patch --strip=2 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../ruby-augeas-0.5.0-patch_c_extension.patch && \
08:38:36 	/opt/puppetlabs/puppet/bin/ruby ext/augeas/extconf.rb && \
08:38:36 	/usr/bin/make -e -j3
08:38:36 patching file ext/augeas/_augeas.c
08:38:37 creating Makefile
08:38:37 compiling ext/augeas/_augeas.c

I'm guessing it's due to PATH (/usr/local/bin is missing), CC=cmake and/or LDFLAGS?

@shubhamshinde360
Copy link
Contributor Author

shubhamshinde360 commented Jul 10, 2023

Hi @joshcooper,

It seems LDFLAGS and CC are not supposed to be set for x86_64. Due to the changes, the is_macos? condition was being executed and the flags were being set.
I have added the add condition of platform.os_version.to_i >= 13 so that the flags are only set for macos version greater than 13 and x86_64 stays unaffected. Please review.

Also, the vanagon diff command returns all these platforms

puppet-runtime git:(PA-4774) ✗ bundle exec rake vanagon:component_diff -- -P agent-runtime-main -p all --from HEAD^ --to HEAD | grep 'Platform name'
fatal: No names found, cannot describe anything.
Platform name: osx-11-x86_64
Platform name: osx-12-arm64
Platform name: osx-13-arm64
Platform name: osx-12-x86_64
Platform name: osx-13-x86_64
Platform name: osx-11-arm64

For which I have ran the generic builder pipeline, which has succeeded for all these platform (except macos 13 x86_64, since that is yet to incorporated in puppet-runtime).

The artifacts links for the run: https://builds.delivery.puppetlabs.net/puppet-runtime/27a69d3d112fb1a6c673212b0fb1233b22f5acc9/artifacts/?C=M&O=D

@shubhamshinde360
Copy link
Contributor Author

Hi @joshcooper,

I have made the required changes as we discussed in the office hours call today.

The vanagon diff command returns differences related to the homebrew path changes only.

I have ran the generic pipeline as well on the impacted platforms and all platforms have succeeded.

Jenkins pipeline link to all platforms: https://jenkins-platform.delivery.puppetlabs.net/job/platform_vanagon-generic-builder_vanagon-packaging_generic-builder/

Artifacts build link: https://builds.delivery.puppetlabs.net/puppet-runtime/0a0f61bc6ca6681571eb706b4246bf12c259f99f/artifacts/?C=M&O=D

Thanks!

@joshcooper joshcooper merged commit 0108dfc into puppetlabs:master Jul 10, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants