Skip to content

RUBY_TARGET not set properly when using rb-sys-dock --platform x86_64-linux-gnu #510

@stanhu

Description

@stanhu

In this CI job, the oxidize-rb/actions/cross-gem@v1 action runs:

 rb-sys-dock --platform x86_64-linux-gnu --directory . --ruby-versions 3.1,3.2,3.3,3.4 --build

This now correctly pulls down the image rbsys/x86_64-linux-gnu:0.9.109, which is an alias for rbsys/x86_64-linux:0.9.109.

However, the RUBY_TARGET is set here:

ENV RUBY_TARGET="x86_64-linux" \

This should actually be x86_64-linux-gnu, not x86_64-linux. As a result, the build ends in failure:

Don't know how to build task 'native:x86_64-linux' (See the list of available tasks with `rake --tasks`)
Did you mean?  native:x86_64-linux-gnu
/tmp/rb-sys-dock/bundle/ruby/3.4.0/gems/rake-13.2.1/exe/rake:27:in '<top (required)>'
/usr/local/rbenv/versions/3.4.1/bin/bundle:25:in 'Kernel#load'
/usr/local/rbenv/versions/3.4.1/bin/bundle:25:in '<main>'

This distinction is important because gems compiled with x86_64-linux can work both on GNU and musl systems, but x86_64-linux-gnu is intended for GNU systems.

This probably can be solved by:

  1. Changing RUBY_TARGET from an ENV to an ARG.
  2. Having rb-sys-dock pass in -e RUBY_TARGET.

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