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

(packaging) Add bootsnap dependency to bolt-runtime #384

Merged
merged 2 commits into from
Mar 4, 2021

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Oct 27, 2020

@jpogran jpogran force-pushed the add-bootsnap branch 2 times, most recently from b697fc7 to aa05faa Compare November 6, 2020 16:47
@jpogran jpogran force-pushed the add-bootsnap branch 2 times, most recently from 0bf11db to 31d7fb8 Compare December 7, 2020 17:08
@jpogran jpogran changed the base branch from master to bolt-3.0 December 7, 2020 19:14
@jpogran jpogran changed the base branch from bolt-3.0 to master January 4, 2021 20:39
@jpogran jpogran force-pushed the add-bootsnap branch 2 times, most recently from 801d6cd to 51be4f0 Compare January 12, 2021 20:58
@jpogran jpogran changed the base branch from master to bolt-3.0 January 12, 2021 20:58
@jpogran
Copy link
Contributor Author

jpogran commented Jan 12, 2021

target branch needs to be updated before merging

@jpogran jpogran force-pushed the add-bootsnap branch 2 times, most recently from e418496 to 2d0b296 Compare January 19, 2021 16:29
@jpogran jpogran marked this pull request as ready for review January 19, 2021 17:01
@jpogran jpogran requested a review from a team January 19, 2021 17:01
@jpogran jpogran requested a review from a team as a code owner January 19, 2021 17:01
@jpogran jpogran marked this pull request as draft January 21, 2021 15:16
@jpogran jpogran changed the base branch from bolt-3.0 to master February 11, 2021 18:12
Adds the bootsnap gem and sets up proper env to compile it's native extensions on windows.
@lucywyman lucywyman marked this pull request as ready for review March 2, 2021 20:59
@lucywyman
Copy link
Contributor

Mmk - I needed to make a few updates to get this far, including updating one md5 sum and pinning msgpack back to 1.3.3 since 1.4.2 did not publish a mingw version of the gem: jpogran#1

After that, I ran into this error:

touch rubygem-bootsnap-configure
touch rubygem-bootsnap-build
touch rubygem-bootsnap-check
export PATH="/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:/cygdrive/c/tools/pl-build-tools/bin:/cygdrive/c/tools/pl-build-tools/include:/cygdrive/c/ProgramFiles64Folder/PuppetLabs/Bolt/bin:/cygdrive/c/ProgramFiles64Folder/PuppetLabs/Bolt/bin:/cygdrive/c/ProgramFiles64Folder/PuppetLabs/Bolt/include:/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Packer/SysInternals:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Program Files/PowerShell/7" && \
export CONFIGURE_ARGS="--with-cflags='-IC:/ProgramFiles64Folder/PuppetLabs/Bolt/include/ruby-2.5.0'" && \
export GEM_HOME="C:/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0" && \
cd ./ && \
C:/ProgramFiles64Folder/PuppetLabs/Bolt/bin/gem.bat install --no-document --local --bindir=C:/ProgramFiles64Folder/PuppetLabs/Bolt/bin bootsnap-1.7.2.gem
Building native extensions. This could take a while...
ERROR:  Error installing bootsnap-1.7.2.gem:
	ERROR: Failed to build gem native extension.

    current directory: C:/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/ext/bootsnap
C:/ProgramFiles64Folder/PuppetLabs/Bolt/bin/ruby.exe -I C:/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/2.7.0 -r ./siteconf20210302-2716-wmwd7j.rb extconf.rb
creating Makefile

current directory: C:/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/ext/bootsnap
make "DESTDIR=" clean
make[1]: Entering directory '/cygdrive/c/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/ext/bootsnap'
make[1]: Leaving directory '/cygdrive/c/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/ext/bootsnap'

current directory: C:/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/ext/bootsnap
make "DESTDIR="
make[1]: Entering directory '/cygdrive/c/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/ext/bootsnap'
generating bootsnap-x64-mingw32.def
compiling bootsnap.c
bootsnap.c:15:10: fatal error: ruby.h: No such file or directory
   15 | #include "ruby.h"
      |          ^~~~~~~~
compilation terminated.
Makefile:244: recipe for target 'bootsnap.o' failed
make[1]: *** [bootsnap.o] Error 1
make[1]: Leaving directory '/cygdrive/c/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/ext/bootsnap'

make failed, exit code 2

Gem files will remain installed in C:/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2 for inspection.
Results logged to C:/ProgramFiles64Folder/PuppetLabs/Bolt/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/bootsnap-1.7.2/gem_make.out
Makefile:1011: recipe for target 'rubygem-bootsnap-install' failed

Which I suspect may be related to pinning msgpack back?

@jpogran
Copy link
Contributor Author

jpogran commented Mar 3, 2021

I don't think so, each gem compile is isolated in that respect. The error means it can't find the c ruby header files, and that's why I modified line 82, they are in the include directory. If it's erroring, we'll have to run the build by hand using artifacts from a failed build and inspect the environment variables and paths. Not trivial.

Thanks for the hash updates, I had updated the versions but missed updating the hashes.

This updates an md5 sum that seemed to be wrong, and uses msgpack 1.3.3
since 1.4.2 did not publish a mingw version. This also modifies the
rubygem-native-extension dependency to set the rubygem version to 2.7.0.
@lucywyman lucywyman added this to 🚧 Reviewing in Bolt Kanban via automation Mar 3, 2021
@lucywyman lucywyman merged commit 2e348a2 into puppetlabs:master Mar 4, 2021
@lucywyman lucywyman removed this from 🚧 Reviewing in Bolt Kanban Mar 4, 2021
# We don't want to install any packages from the chocolatey repo by accident
plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe upgrade -y chocolatey"
plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe sources remove -name chocolatey"
# plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe sources remove -name chocolatey"
Copy link
Contributor

Choose a reason for hiding this comment

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

@jpogran I think that by removing this, a newer cmake version is installed now(3.19.6, previously it was 3.5.2). This is breaking yaml-cpp build on agent-runtime. Would pining cmake to 3.5.2 work for bolt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies, this was my mistake. I was supposed to go back to using internal repo only. Will post a fix shortly

jpogran added a commit to jpogran/puppet-runtime that referenced this pull request Mar 8, 2021
During testing puppetlabs#384 the public chocolate repo source was added, but I did not remove it before merging. This removes the public repo to ensure the correct sources are used.
jpogran added a commit to jpogran/puppet-runtime that referenced this pull request Mar 17, 2021
During testing puppetlabs#384 the public chocolate repo source was added, but I did not remove it before merging. This removes the public repo to ensure the correct sources are used.
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.

None yet

3 participants