Skip to content

New build failure on 2.7.4-alpine-amd64 (maybe revisit #364?) #365

Closed

Description

@keithlayne

Sure looks like #364 broke my build. Specifically, I'm on 2.7.4-alpine on amd64 and the short version is that every single gem with native dependencies that bundle tried to install failed.

FROM ruby:2.7.4-alpine
RUN apk add --no-cache build-base
WORKDIR /app
RUN printf "source 'https://rubygems.org'\nruby '2.7.4'\ngem 'racc'" > Gemfile
RUN bundle install

Building this will fail, but if you s/7.4/6.8/, it builds fine.

Activity

  1. keithlayne commented on Oct 27, 2021

    @keithlayne
    Author

    Also, just so this is clear, my image build failures began immediately after the most recent push to docker hub.

  2. bpo commented on Oct 27, 2021

    @bpo

    I'm seeing the same issue with all builds of native gems on the latest 2.7.4-alpine3.14 - complaints about "cannot find -lucontext", for example when building bcrypt:

    linking shared-object bcrypt_ext.so
    /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld:
    cannot find -lucontext
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:262: bcrypt_ext.so] Error 1
     
    make failed, exit code 2
    
  3. keithlayne commented on Oct 27, 2021

    @keithlayne
    Author

    Ugh, I feel dumb, I skimmed over those log lines and missed them, but those make it obvious I think that #364 is the culprit.

  4. keithlayne commented on Oct 27, 2021

    @keithlayne
    Author

    Found a workaround that also should have been obvious: add libucontext-dev via apk. Can confirm this fixes my build for the moment.

  5. keithlayne commented on Oct 27, 2021

    @keithlayne
    Author

    Seems like that's included for the build of ruby? So I more probably need to add libucontext because ruby needs it at runtime...will test.

  6. tianon commented on Oct 27, 2021

    @tianon
    Member

    Ooof, just went to file this issue myself -- thanks for chasing this down with some good details, folks. 😄

    I guess we ought to make #364 actually conditional and only apply it for architectures which do require it. 😩

    The other option would be to just always keep libucontext-dev installed, which would add ~249KB to our overall image size. 🤔

  7. tianon commented on Oct 27, 2021

    @tianon
    Member

    (To be clear - @yosifkit is currently typing up a solution and should have a PR open ASAP.)

  8. cameronbourgeois commented on Oct 27, 2021

    @cameronbourgeois
  9. keithlayne commented on Oct 27, 2021

    @keithlayne
    Author

    AFAICT the lib is only needed at build time for gems with native extensions...seems like using gems with native extensions works, even if -lucontext was passed to the linker during the build. I guess if it doesn't actually use the lib, then it's basically a no-op? Then I guess it's not actually getting used in the ruby build on x86_64? This is totally unimportant, and I'm totally curious 😁

  10. tianon commented on Oct 27, 2021

    @tianon
    Member

    @keithlayne correct -- it's only even necessary on three architectures, so fixing it to be architecture-conditional (and keeping libucontext-dev on the affected architectures) is #366

  11. cameronbourgeois commented on Oct 28, 2021

    @cameronbourgeois
  12. tianon commented on Oct 28, 2021

    @tianon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions