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

add libyaml-devel to Dockerfile-ruby32 #143

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

chrishiestand
Copy link
Contributor

@chrishiestand chrishiestand commented Apr 18, 2024

This fixes a cdk deploy failure when the ruby gem psych is a dependency.

Description of changes:
Add libyaml-devel yum package to ruby32 docker image

The error that this commit fixes is:

Fetching psych 5.1.2
Installing psych 5.1.2 with native extensions
Fetching activesupport 7.1.3
Fetching aws-sdk-dynamodb 1.103.0
Installing aws-sdk-dynamodb 1.103.0
Installing activesupport 7.1.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /asset-output/ruby/3.2.0/gems/psych-5.1.2/ext/psych
/var/lang/bin/ruby extconf.rb
checking for yaml.h... no
yaml.h not found
*** 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.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/var/lang/bin/$(RUBY_BASE_NAME)
	--with-libyaml-source-dir
	--without-libyaml-source-dir
	--with-yaml-0.1-dir
	--without-yaml-0.1-dir
	--with-yaml-0.1-include
	--without-yaml-0.1-include=${yaml-0.1-dir}/include
	--with-yaml-0.1-lib
	--without-yaml-0.1-lib=${yaml-0.1-dir}/lib
	--with-yaml-0.1-config
	--without-yaml-0.1-config
	--with-pkg-config
	--without-pkg-config
	--with-libyaml-dir
	--without-libyaml-dir
	--with-libyaml-include
	--without-libyaml-include=${libyaml-dir}/include
	--with-libyaml-lib
	--without-libyaml-lib=${libyaml-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

  /asset-output/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.2/mkmf.log

extconf failed, exit code 1

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@chrishiestand chrishiestand requested a review from a team as a code owner April 18, 2024 00:15
@github-actions github-actions bot added pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Apr 18, 2024
Copy link
Contributor

@hnnasit hnnasit left a comment

Choose a reason for hiding this comment

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

Hi @chrishiestand, thanks for your contributions! Could you also add this dependency for ruby3.3 runtime for consistency?

@hnnasit hnnasit self-requested a review April 22, 2024 17:30
This fixes a `cdk deploy` failure when the ruby gem `psych` is a dependency.

The error that this commit fixes is:
```
Fetching psych 5.1.2
Installing psych 5.1.2 with native extensions
Fetching activesupport 7.1.3
Fetching aws-sdk-dynamodb 1.103.0
Installing aws-sdk-dynamodb 1.103.0
Installing activesupport 7.1.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /asset-output/ruby/3.2.0/gems/psych-5.1.2/ext/psych
/var/lang/bin/ruby extconf.rb
checking for yaml.h... no
yaml.h not found
*** 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.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/var/lang/bin/$(RUBY_BASE_NAME)
	--with-libyaml-source-dir
	--without-libyaml-source-dir
	--with-yaml-0.1-dir
	--without-yaml-0.1-dir
	--with-yaml-0.1-include
	--without-yaml-0.1-include=${yaml-0.1-dir}/include
	--with-yaml-0.1-lib
	--without-yaml-0.1-lib=${yaml-0.1-dir}/lib
	--with-yaml-0.1-config
	--without-yaml-0.1-config
	--with-pkg-config
	--without-pkg-config
	--with-libyaml-dir
	--without-libyaml-dir
	--with-libyaml-include
	--without-libyaml-include=${libyaml-dir}/include
	--with-libyaml-lib
	--without-libyaml-lib=${libyaml-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

  /asset-output/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.2/mkmf.log

extconf failed, exit code 1
```

f
@chrishiestand
Copy link
Contributor Author

chrishiestand commented Apr 22, 2024

@hnnasit The same change has now been applied to both ruby Dockerfiles. I pulled down the 3.3 Ruby docker image and made sure that the library uses the same name and installs fine - it does so I'm confident this will work for both image builds.

@hnnasit hnnasit merged commit 7170896 into aws:develop Apr 22, 2024
26 checks passed
@chrishiestand chrishiestand deleted the patch-1 branch April 22, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants