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

Building issues #781

Closed
ucwong opened this issue Oct 21, 2022 · 10 comments
Closed

Building issues #781

ucwong opened this issue Oct 21, 2022 · 10 comments

Comments

@ucwong
Copy link
Contributor

ucwong commented Oct 21, 2022

Occurs after updating github.com/anacrolix/missinggo/v2 from v2.7.0 to v2.7.1

github.com/anacrolix/dht/v2 from v2.19.0 to v2.19.1

/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:72:3: cannot use generic type immutable.Map[K constraints.Ordered, V any] without instantiation
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:76:9: cannot use Map{…} (value of type Map) as type Mappish in return statement:
	Map does not implement Mappish (missing Get method)
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:76:30: type interhash of interhash{} does not match immutable.Hasher[K] (cannot infer K and V)
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:79:17: cannot use Map{} (value of type Map) as type Mappish in variable declaration:
	Map does not implement Mappish (missing Get method)
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:83:9: cannot use m (variable of type Map) as type Mappish in return statement:
	Map does not implement Mappish (missing Get method)
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:88:9: cannot use m (variable of type Map) as type Mappish in return statement:
	Map does not implement Mappish (missing Get method)
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:107:3: cannot use generic type immutable.SortedMap[K constraints.Ordered, V any] without instantiation
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:112:9: cannot use sm (variable of type SortedMap) as type Mappish in return statement:
	SortedMap does not implement Mappish (missing Get method)
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:117:9: cannot use sm (variable of type SortedMap) as type Mappish in return statement:
	SortedMap does not implement Mappish (missing Get method)
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:182:14: cannot use generic type immutable.List[T comparable] without instantiation
/root/go/pkg/mod/github.com/anacrolix/stm@v0.4.0/stmutil/containers.go:117:9: too many errors
@anacrolix
Copy link
Owner

@ucwong what version of Go are you using? See anacrolix/stm#5.

@ucwong
Copy link
Contributor Author

ucwong commented Oct 24, 2022

@ucwong what version of Go are you using? See anacrolix/stm#5.

go version go1.19.2 linux/amd64

@ucwong
Copy link
Contributor Author

ucwong commented Oct 24, 2022

image

It is OK when I run
go test ./... 

in stm directly

@anacrolix

This comment was marked as outdated.

@ucwong
Copy link
Contributor Author

ucwong commented Oct 24, 2022

Replace the type parameters in its definition with actual types may be the solution of this issue

https://github.com/anacrolix/stm/blob/4f6e80b7bb8c9a8b3036e54b6d02dcc66a690162/stmutil/containers.go#L72

@anacrolix
Copy link
Owner

Without jumping into the code and digging around, is it possible that old versions of the DHT code are pulling in versions of the STM code that don't build anymore? I don't know how far you got in the linked issue @ucwong but it all ends up at golang/go#55955.

@ucwong
Copy link
Contributor Author

ucwong commented Oct 25, 2022

Without jumping into the code and digging around, is it possible that old versions of the DHT code are pulling in versions of the STM code that don't build anymore? I don't know how far you got in the linked issue @ucwong but it all ends up at golang/go#55955.

Just run go get -u ./... in my project and then the issue occurs when building

@ucwong
Copy link
Contributor Author

ucwong commented Oct 25, 2022

anacrolix/stm#6

@ucwong
Copy link
Contributor Author

ucwong commented Oct 26, 2022

anacrolix/stm#7

@anacrolix
Copy link
Owner

Let's close this in favour of anacrolix/stm#5, which is the real problem.

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