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

Remove ill dependency #106

Merged
merged 3 commits into from
Aug 9, 2022
Merged

Remove ill dependency #106

merged 3 commits into from
Aug 9, 2022

Conversation

polldo
Copy link
Contributor

@polldo polldo commented Aug 4, 2022

Motivation

With go1.19 the cloud-cli doesn't work:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xbf97e6]

goroutine 1 [running]:
debug/elf.(*Section).ReadAt(0xc000336000?, {0xc0000f4240?, 0x270?, 0x24?}, 0x40?)
        <autogenerated>:1 +0x26
archive/zip.readDirectoryEnd({0xfb18c0, 0xc0000cb280}, 0x210)
        /usr/local/go/src/archive/zip/reader.go:526 +0xf5
archive/zip.(*Reader).init(0xc00028dd50, {0xfb18c0?, 0xc0000cb280}, 0x210)
        /usr/local/go/src/archive/zip/reader.go:97 +0x5c
archive/zip.NewReader({0xfb18c0, 0xc0000cb280}, 0x210)
        /usr/local/go/src/archive/zip/reader.go:90 +0x5e
github.com/daaku/go%2ezipexe.zipExeReaderElf({0xfb4c00?, 0xc000014b00}, 0x18fd49a)
        /home/poldo/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.1/zipexe.go:128 +0x8b
github.com/daaku/go%2ezipexe.NewReader({0xfb4c00, 0xc000014b00}, 0x0?)
        /home/poldo/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.1/zipexe.go:48 +0x98
github.com/daaku/go%2ezipexe.OpenCloser({0xc000042a80?, 0xc0000d35f0?})
        /home/poldo/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.1/zipexe.go:30 +0x57
github.com/cmaglie/go%2erice.init.0()
        /home/poldo/go/pkg/mod/github.com/cmaglie/go.rice@v1.0.3/appended.go:42 +0x65

You can find more info about this issue at: golang/go#54227

Apparently we have an indirect dependency (github.com/cmaglie/go.rice) that relies on some other broken dependency.

$ go mod why github.com/cmaglie/go.rice

# github.com/cmaglie/go.rice
github.com/arduino/arduino-cloud-cli/internal/binary
github.com/arduino/arduino-fwuploader/indexes/download
github.com/cmaglie/go.rice

How it can be seen, the only direct dependency is from github.com/arduino/arduino-fwuploader, and it's just one function.

Change description

For an easy fix, I've just extracted the needed function from arduino-fwuploader removing the dependency.

Additional Notes

Reviewer checklist

  • PR address a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.
  • History is clean, commit messages are meaningful (see CONTRIBUTING.md) and are well formatted.

internal/binary/download.go Outdated Show resolved Hide resolved
Copy link

@rsora rsora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a tiny cosmetic comment.

The rest is excellent and approved for merge 👍

@polldo polldo merged commit 0bf63cb into main Aug 9, 2022
@polldo polldo deleted the polldo/remove-ill-dependency branch August 9, 2022 13:33
polldo added a commit that referenced this pull request Sep 2, 2022
With go1.19 the cloud-cli didn't work.
Apparently we had an indirect dependency (github.com/cmaglie/go.rice) that relies on some other broken dependency.
polldo added a commit that referenced this pull request Sep 2, 2022
With go1.19 the cloud-cli didn't work.
Apparently we had an indirect dependency (github.com/cmaglie/go.rice) that relies on some other broken dependency.
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.

None yet

2 participants