Skip to content

Fix open-uri call for downloading release files #319

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

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

hlovdal
Copy link
Contributor

@hlovdal hlovdal commented Jan 27, 2022

This fixes the issue where attempting to download releases from https://github.com/arduino/arduino-cli/releases/download/ fails.

Without this fix downloading will fail like:

Host OS...                                                                 linux
Attempting to download Arduino 0.13.0 package with open-uribundler: failed to load command: arduino_ci.rb (/.../vendor/bundle/ruby/3.0.0/bin/arduino_ci.rb)
/.../arduino_ci/lib/arduino_ci/arduino_downloader.rb:111:in `initialize': No such file or directory @ rb_sysopen - https://github.com/arduino/arduino-cli/releases/download/0.13.0/arduino-cli_0.13.0_Linux_64bit.tar.gz (Errno::ENOENT)

and when running through trace the log gives:

access("/usr/bin/tar", X_OK)            = 0
newfstatat(AT_FDCWD, "/usr/bin/tar", {st_mode=S_IFREG|0755, st_size=527464, ...}, 0) = 0
newfstatat(AT_FDCWD, "arduino-cli_0.13.0_Linux_64bit.tar.gz", 0x7fff95f8caa0, 0) = -1 ENOENT (No such file or directory)
write(1, "Attempting to download Arduino 0.13.0 package with open-uri", 59) = 59
openat(AT_FDCWD, "https://github.com/arduino/arduino-cli/releases/download/0.13.0/arduino-cli_0.13.0_Linux_64bit.tar.gz", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0

so obviously the bare open call is mapped to a filesystem open call.
The gem 'open-uri' is referenced earlier in the file and is obviously
the intended target. https://github.com/ruby/open-uri documents the API
to be URI.open, and substituting with that made downloading work.
@jgfoster jgfoster merged commit 21b63e6 into Arduino-CI:master Jan 27, 2022
@jgfoster
Copy link
Member

Very nice, thanks!

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

Successfully merging this pull request may close these issues.

2 participants