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

running the pdk container requires building the 'strscan' gem native extension #60

Closed
gerardkok opened this issue May 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gerardkok
Copy link

Describe the Bug

We run the latest pdk container in a CI/CD pipeline. Starting today, this fails, because the 'strscan' gem native extension needs to be build, but the container doesn't have the tools to do that:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/root/.pdk/cache/ruby/2.7.0/gems/strscan-3.1.0/ext/strscan
/opt/puppetlabs/pdk/private/ruby/2.7.8/bin/ruby -I
/opt/puppetlabs/pdk/private/ruby/2.7.8/lib/ruby/site_ruby/2.7.0 extconf.rb
checking for onig_region_memsize() in ruby.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
...
An error occurred while installing strscan (3.1.0), and Bundler cannot continue.
In Gemfile:
  puppet_litmus was resolved to 1.4.0, which depends on
    bolt was resolved to 3.29.0, which depends on
      CFPropertyList was resolved to 3.0.7, which depends on
        rexml was resolved to 3.2.8, which depends on
          strscan
pdk (FATAL): Unable to install missing Gemfile dependencies.

Expected Behavior

For pdk to run without errors.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run pdk test unit in a pdk container

Environment

  • Version: 3.2.0.1
  • Platform: kubernetes running on amd64

Additional Context

I get the impression that this is caused by the rexml gem since version 3.2.7 depending on strscan.

A workaround is to allow the container to build the gem native extension, by installing the build-essential package in the container before running the pdk command. A fix could be to include the build-essential package in the container, but a better fix would probably be to not depend on strscan. I'm afraid I don't know how to do that, though.

@gerardkok gerardkok added the bug Something isn't working label May 16, 2024
@jordanbreen28
Copy link
Contributor

hey @gerardkok thanks for raising this one. Please run pdk update before in the module and that should resolve the issue as we pinned the version of CFPropertyList being used in the latest pdk templates (v3.2.0).

Please re-open if you're still seeing some issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants