Skip to content

RbConfig::CONFIG["ruby_version"]: full version or API version? #878

Open

Description

@tannevaled

rbgo answers RbConfig::CONFIG["ruby_version"] with the full version string (4.0.9 after the bump, 3.4.1 before it), from internal/vm/kernel_introspect.go's rubyVersion.

MRI may answer the API version there instead — 4.0.0 for every 4.0.x — because that key names the library directory (/usr/lib/ruby/<ruby_version>/), which is shared across teeny releases by design. If so, any gem computing a load path from it gets a directory rbgo's own rubylibdir does not match.

Noticed while bumping rubyVersion for #799. Not changed there, deliberately: nothing in ruby/spec asserts this key's value — library/rbconfig/ covers only unicode_version and unicode_emoji_version — so the corpus cannot settle it, and a version bump is not the place to change behaviour on a hunch.

To close this, read MRI's configure.ac/template/rbconfig.rb.tmpl at v4.0.9 for how ruby_version is defined, and check rubylibdir uses the same value. internal/vm/puppet_boot_modified_test.go carries the current expectation and a comment pointing here.

Refs #799

Activity

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