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

Enable installing static library for MRI 2.4 and 2.5 #43

Open
wants to merge 2 commits into
base: build
Choose a base branch
from

Conversation

d-unsed
Copy link

@d-unsed d-unsed commented Nov 29, 2017

  • Install both static and dynamic libraries for MRI 2.4.x

Hi! There was a breaking change introduced in Ruby 2.4 related to static and shared libraries.

Pre-2.4 behavior:

  • always install static library (libruby-static.a)
  • with --enable-shared option, additionally install shared library (libruby.x.y.z.so)

2.4.x behavor:

  • if no options given, install only static library
  • with --enable-shared, install only dynamic library
  • with --enable-shared and --enable-install-static-library, install both shared and static libs

By default RVM uses --enable-shared flag. So it means that currently the pre-built rubies for 2.4.x have only shared libs. Some projects (like ruby-sys or ruru) explicitly test linking for both kinds of libraries. So their builds for 2.4.x fail, because those RVM images don't have static libs.

This patch adds --enable-install-static-library to ruby-2.4*, so that their RVM images have both kind of libraries, like 2.3.x and prior versions.

Copy link
Contributor

@mpapis mpapis left a comment

Choose a reason for hiding this comment

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

looks good to me :)

build.sh Outdated
EXTRA_CONFIGURE_OPTS=",--enable-install-static-library"
fi

announce rvm install $RUBY $EXTRA_FLAGS --verify-downloads 1 $MOVABLE_FLAG --disable-install-doc -C --without-tcl,--without-tk,--without-gmp$EXTRA_CONFIGURE_OPTS;;

This comment was marked as spam.

This comment was marked as spam.

@d-unsed
Copy link
Author

d-unsed commented Nov 30, 2017

@mpapis,

I've implemented a slightly different solution from what you suggested. RVM docs say that custom configure options should be passed as a comma-separated list using -C parameter:

-C            - custom configure options, comma separated, double quote
                args that need quoting, default: --enable-shared=true

Also, I'm definitely not a shell scripting expert, so feel free to request for more changes :)

@mpapis
Copy link
Contributor

mpapis commented Dec 1, 2017 via email

@d-unsed d-unsed changed the title Enable installing static library for MRI 2.4.x Enable installing static library for MRI 2.4 and 2.5 Dec 4, 2017
@d-unsed
Copy link
Author

d-unsed commented Dec 4, 2017

Got it! I changed to use plain arrays for CONFIGURE_OPTS

 - Install both static and dynamic libraries for MRI 2.4 and 2.5
@d-unsed
Copy link
Author

d-unsed commented Dec 12, 2017

@mpapis, looks like there was some random failure related to GPG keys in the test env. I've restarted the build, all green now.

Copy link
Contributor

@mpapis mpapis left a comment

Choose a reason for hiding this comment

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

Slight change in new lines, otherwise it's good :)

@d-unsed
Copy link
Author

d-unsed commented Dec 13, 2017

Newlines fixed

@BanzaiMan
Copy link
Contributor

Sorry for overlooking this one. Does this apply to ruby-head these days?

BanzaiMan added a commit that referenced this pull request Nov 1, 2018
Enable installing static library for MRI 2.4 and 2.5
announce rvm install $RUBY $EXTRA_FLAGS --verify-downloads 1 $MOVABLE_FLAG --disable-install-doc -C --without-tcl,--without-tk,--without-gmp;;
CONFIGURE_OPTS=( --without-tcl --without-tk --without-gmp )
case $RUBY in
ruby-2.4*|ruby-2.5*)

This comment was marked as spam.

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