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

Error: Cannot parse bundler input: 2.0.0.pre.3 #439

Closed
2 tasks done
dblock opened this issue Jan 5, 2023 · 5 comments
Closed
2 tasks done

Error: Cannot parse bundler input: 2.0.0.pre.3 #439

dblock opened this issue Jan 5, 2023 · 5 comments

Comments

@dblock
Copy link

dblock commented Jan 5, 2023

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby),
    and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

GitHub-hosted runner

The workflow code or a link to the workflow file

- name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7
          bundler: '2.0.0.pre.3'
          bundler-cache: true

Link to the log of a failed workflow job, or to a gist with the output

https://github.com/mongoid/mongoid-grid_fs/actions/runs/3851008682/jobs/6561766355

The command and output of the failing step

023-01-05T22:55:37.9400155Z ##[group]Run ruby/setup-ruby@v1
2023-01-05T22:55:37.9400373Z with:
2023-01-05T22:55:37.9400559Z   ruby-version: 2.7
2023-01-05T22:55:37.9400753Z   bundler: 2.0.0.pre.3
2023-01-05T22:55:37.9400948Z   bundler-cache: false
2023-01-05T22:55:37.9401130Z env:
2023-01-05T22:55:37.9401343Z   BUNDLE_GEMFILE: gemfiles/mongoid-5.0.gemfile
2023-01-05T22:55:37.9401579Z ##[endgroup]
2023-01-05T22:55:38.2131451Z ##[group]Modifying PATH
2023-01-05T22:55:38.2135635Z Entries added to PATH to use selected Ruby:
2023-01-05T22:55:38.2138503Z   /opt/hostedtoolcache/Ruby/2.7.7/x64/bin
2023-01-05T22:55:38.2138936Z ##[endgroup]
2023-01-05T22:55:38.2164962Z ##[group]Downloading Ruby
2023-01-05T22:55:38.2167778Z https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.7.7-ubuntu-22.04.tar.gz
2023-01-05T22:55:38.4632093Z Took   0.25 seconds
2023-01-05T22:55:38.4635723Z ##[endgroup]
2023-01-05T22:55:38.4638863Z ##[group]Extracting  Ruby
2023-01-05T22:55:38.4673442Z [command]/usr/bin/tar -xz -C /opt/hostedtoolcache/Ruby/2.7.7 -f /home/runner/work/_temp/25c2651e-0063-4bbd-9f6c-eacac961f549
2023-01-05T22:55:38.8310920Z Took   0.37 seconds
2023-01-05T22:55:38.8311858Z ##[endgroup]
2023-01-05T22:55:38.8312813Z ##[group]Print Ruby version
2023-01-05T22:55:38.8326720Z [command]/opt/hostedtoolcache/Ruby/2.7.7/x64/bin/ruby --version
2023-01-05T22:55:38.8497100Z ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]
2023-01-05T22:55:38.8510830Z Took   0.02 seconds
2023-01-05T22:55:38.8511566Z ##[endgroup]
2023-01-05T22:55:38.8513043Z ##[group]Installing Bundler
2023-01-05T22:55:38.8519758Z Took   0.00 seconds
2023-01-05T22:55:38.8520312Z ##[endgroup]
2023-01-05T22:55:38.8604597Z ##[error]Error: Cannot parse bundler input: 2.0.0.pre.3
    at Module.installBundler (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:121:11)
    at /home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:68814:15
    at body (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:327:20)
    at Object.<anonymous> (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:4059:28)
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:3810:71
    at new Promise (<anonymous>)
    at __webpack_modules__.2186.__awaiter (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:3806:12)
    at Object.group (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:4055:12)
    at Module.measure (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:342:25)
2023-01-05T22:55:38.8697985Z Post job cleanup.

Any other notes?

Looks like any pre version fails to parse. It's a valid version of bundler, which is < 2 but bigger than > 1.x so it's why it was being used used here as some workaround. It's NBD for our project, but still seems like a valid bug for ruby-setup.

@dblock
Copy link
Author

dblock commented Jan 5, 2023

#394 is sort of related

@eregon
Copy link
Member

eregon commented Jan 6, 2023

It's different than #394 in that 2.0.0.pre.3 actually exists: https://rubygems.org/gems/bundler/versions

It feels messy to differentiate 2.4.0.dev (not a release) and 2.0.0.pre.3 / 1.10.0.pre / 1.12.0.rc.4 / etc (actual releases).
Probably we can do it by considering .dev as never a release and assume every other suffix is a release.

@eregon eregon closed this as completed in eb7f94f Jan 6, 2023
@dblock
Copy link
Author

dblock commented Jan 6, 2023

Thanks for a quick fix! When comparing versions 2.0.0.pre.3 is < 2.0. Not sure if it matters for this library anywhere, but potentially makes sense to use a semver parser, and allow all these .dev versions too without having to worry about whether they exist or not (just fail if they don't later?).

@eregon
Copy link
Member

eregon commented Jan 6, 2023

2.0.0.pre.3 is still more Bundler 2 than Bundler 1, so it is the behavior we want already.

The last thing we want is to parse the version, because that doesn't roundtrip properly (at least with the semver package I tried back then).

@dblock
Copy link
Author

dblock commented Jan 6, 2023

Just to be pedantic, in semver 2.0.0.pre.3 < 2.0, but you're right that for this library it doesn't matter. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants