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

Download link is invalid for macos-latest (macos-13) with Ruby 2.5 #601

Closed
2 tasks done
Fryguy opened this issue May 21, 2024 · 12 comments
Closed
2 tasks done

Download link is invalid for macos-latest (macos-13) with Ruby 2.5 #601

Fryguy opened this issue May 21, 2024 · 12 comments

Comments

@Fryguy
Copy link
Contributor

Fryguy commented May 21, 2024

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

Link to the failed workflow job (must be a public workflow job, so the necessary information is available)

https://github.com/ManageIQ/rbvmomi2/actions/runs/9180932157/job/25246498930

Any other notes?

I'm not sure why macos-latest points to macos-13, but because of that it generates an invalid download link to https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.5.9-macos-13-arm64.tar.gz

Run ruby/setup-ruby@v1
  with:
    ruby-version: 2.5
    bundler-cache: true
Modifying PATH
  Entries removed from PATH to avoid conflicts with default Ruby:
    /opt/homebrew/lib/ruby/gems/3.0.0/bin
    /opt/homebrew/opt/ruby@3.0/bin
  Entries added to PATH to use selected Ruby:
    /Users/runner/hostedtoolcache/Ruby/2.5.9/arm64/bin
Downloading Ruby
  https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.5.9-macos-13-arm64.tar.gz
  Took   0.34 seconds
Error: Error: Unexpected HTTP response: 404
    at /Users/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:8702:25
    at Generator.next (<anonymous>)
    at fulfilled (/Users/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:8612:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
@Fryguy
Copy link
Contributor Author

Fryguy commented May 21, 2024

I thought this might be related to #568 (and possibly #588, but that was edited away), but I can't tell if that PR should have fixed it.

@hsbt
Copy link
Member

hsbt commented May 21, 2024

macos-latest is macos-14 today. setup-ruby didn't provide Ruby 2.5 for macos-14 that is Apple Silicon.

@Fryguy
Copy link
Contributor Author

Fryguy commented May 21, 2024

@hsbt I'm a little confused, because I just ran with macos-latest 2 hours ago and it's giving me macos-13?

@Fryguy
Copy link
Contributor Author

Fryguy commented May 21, 2024

@hsbt - oh you're right, the underlying runner is macos-14-arm64, however, the URl being generated is saying macos-13: https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.5.9-macos-13-arm64.tar.gz

I do see there is a https://github.com/ruby/ruby-builder/releases/download/toolcache/ruby-2.5.9-macos-latest.tar.gz build available, but that's not the URL being generated by setup-ruby

@dentarg
Copy link

dentarg commented May 21, 2024

This is the logic used by setup-ruby:

setup-ruby/ruby-builder.js

Lines 115 to 116 in 7dc18ff

} else if (os.arch() === 'arm64') {
builderPlatform = 'macos-13-arm64'

This is the motivation behind it: #567 (comment)

Your job is running on Image: macos-14-arm64 (log) but there are no Ruby 2.5 built for any macOS using arm64, it is too old: 5cfe23c

@Fryguy
Copy link
Contributor Author

Fryguy commented May 21, 2024

Thanks @dentarg - let me give that a try

@Fryguy
Copy link
Contributor Author

Fryguy commented May 21, 2024

Thank you! That worked - I thought it was a bug that 14 was downloading 13, but I see now that pinning to macos-13 works. Thanks again!

@Fryguy Fryguy closed this as completed May 21, 2024
@eregon
Copy link
Member

eregon commented May 23, 2024

Yeah the URLs can be confusing, if would be nice to clarify them but that's a lot of work and would need duplicate files for a long time, so not realistic I'm afraid.

The real confusion and problem IMO is GitHub changed macos-latest from an amd64 to a arm64 runner, that's really surprising, IMO the arch should be part of the image name (and probably it will need to be when there is linux-aarch64)

@Fryguy
Copy link
Contributor Author

Fryguy commented May 24, 2024

For future readers, here is the change i made in my repo to get it working: ManageIQ/rbvmomi2@e7ee943

@eregon
Copy link
Member

eregon commented May 24, 2024

Looking at the error message we should improve that so it says 2.5 is not available on macos-arm, I'll reopen to track that

@eregon eregon reopened this May 24, 2024
@eregon
Copy link
Member

eregon commented May 30, 2024

I added a clear error message in d046db6 and 68b7059 (fixup).

@eregon eregon closed this as completed May 30, 2024
This issue was closed.
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

4 participants