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

Compile Error #5

Closed
travankor opened this issue Mar 14, 2021 · 5 comments
Closed

Compile Error #5

travankor opened this issue Mar 14, 2021 · 5 comments

Comments

@travankor
Copy link

travankor commented Mar 14, 2021

I ran into these errors on go 1.15.9 linux/amd64 while testing cross-compiling.

# github.com/anatol/luks.go
_build-booster-xbps/src/github.com/anatol/luks.go/dm.go:32:3: cannot use int(volume.storageOffset) (type int) as type uint64 in field value
_build-booster-xbps/src/github.com/anatol/luks.go/dm.go:35:3: cannot use int(volume.storageIvTweak) (type int) as type uint64 in field value
_build-booster-xbps/src/github.com/anatol/luks.go/dm.go:38:32: cannot use c (type devmapper.CryptTable) as type uint32 in argument to devmapper.CreateAndLoad
@anatol
Copy link
Owner

anatol commented Mar 14, 2021

How do you cross compile? What GOOS and GOARCH?

@travankor
Copy link
Author

linux/arm64 is what I tested with using the standard compiler (not gcc-go).

@anatol
Copy link
Owner

anatol commented Mar 14, 2021

The error message says dm.go wants to use newer API than it recorded in go.mod. You do not use pinned version of devicemapper.go, do you?

Golang has a great modules system. It allows to pin versions of dependent packages by recording it into go.mod. And not using this feature is looking for troubles (like the one above).

I updated luks.go to the API changes in devicemapper.go for now. But i would suggest to use go modules functionality to track dependencies versions.

@anatol anatol closed this as completed Mar 14, 2021
@travankor
Copy link
Author

-mod defaults to vendor if there's a vendor directory, otherwise uses default for go.

@anatol
Copy link
Owner

anatol commented Mar 15, 2021

But this project does not have vendor so it comes from somewhere else. So the question - is this vendor directory synchronized with go.mod?

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