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

Go can't get ecc1/medtronic due to undefined: unsafe.Slice #1435

Closed
scottleibrand opened this issue Sep 10, 2022 · 3 comments
Closed

Go can't get ecc1/medtronic due to undefined: unsafe.Slice #1435

scottleibrand opened this issue Sep 10, 2022 · 3 comments

Comments

@scottleibrand
Copy link
Contributor

On a newly flashed Edison rig with Debian stretch using oref0 dev, the go get -u -v -tags "$radiotags" github.com/ecc1/medtronic/... command run by oref0-setup fails with:

root@edison-eb5 ~/myopenaps # go get -u -v -tags "$radiotags" github.com/ecc1/medtronic/...
github.com/ecc1/medtronic (download)
github.com/ecc1/cc111x (download)
github.com/ecc1/gpio (download)
Fetching https://golang.org/x/sys/unix?go-get=1
Parsing meta tags from https://golang.org/x/sys/unix?go-get=1 (status code 200)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at https://golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
Fetching https://golang.org/x/sys?go-get=1
Parsing meta tags from https://golang.org/x/sys?go-get=1 (status code 200)
golang.org/x/sys (download)
github.com/ecc1/spi (download)
github.com/ecc1/nightscout (download)
github.com/ecc1/radio (download)
github.com/ecc1/papertrail (download)
golang.org/x/sys/unix
# golang.org/x/sys/unix
../go/src/golang.org/x/sys/unix/syscall.go:83:7: undefined: unsafe.Slice
../go/src/golang.org/x/sys/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
../go/src/golang.org/x/sys/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
root@edison-eb5 ~/myopenaps #

cc @ecc1

@scottleibrand
Copy link
Contributor Author

The file sysvshm_unix.go doesn't exist, neither on this system nor a working one:

root@edison-eb5 /usr/local/go/src/cmd/vendor/golang.org # ll x/sys/unix/syscall.go
-rwxr-xr-x 1 root root 2036 May  6  2019 x/sys/unix/syscall.go
root@edison-eb5 /usr/local/go/src/cmd/vendor/golang.org # ll x/sys/unix/syscall_unix.go
-rwxr-xr-x 1 root root 9420 May  6  2019 x/sys/unix/syscall_unix.go
root@edison-eb5 /usr/local/go/src/cmd/vendor/golang.org # ll x/sys/unix/sysvshm_unix.go
ls: cannot access 'x/sys/unix/sysvshm_unix.go': No such file or directory
root@edison-eb5 /usr/local/go/src/cmd/vendor/golang.org #

@ecc1
Copy link

ecc1 commented Sep 11, 2022

It looks like the golang.org/x/sys/unix package no longer works with versions of Go earlier than 1.18.

I'd suggest installing https://go.dev/dl/go1.19.1.src.tar.gz in oref-setup, and then using commands like these to build the required medtronic commands:

go install -v -tags cc111x github.com/ecc1/medtronic/cmd/mdt@latest
go install -v -tags cc111x github.com/ecc1/medtronic/cmd/pumphistory@latest

etc. The first one will download all the dependencies, and subsequent ones will be fast.

@scottleibrand
Copy link
Contributor Author

Thanks. Fix pushed to dev.

@scottleibrand scottleibrand mentioned this issue Jan 17, 2023
1 task
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

No branches or pull requests

2 participants