netsec-ethz / scion-apps

Public repository for SCION applications
Apache License 2.0
20 stars 43 forks source link

Fix indirect antlr import #251

Closed leonrinkel closed 7 months ago

leonrinkel commented 8 months ago

When importing scion-apps in another project, I'm getting ambiguous import errors like in the following.

parallels@ubuntu-linux-22-04-02-desktop:~/libp2p/go-libp2p$ go mod tidy
go: github.com/libp2p/go-libp2p/core/canonicallog imports
        github.com/multiformats/go-multiaddr/net imports
        github.com/netsec-ethz/scion-apps/pkg/pan imports
        github.com/scionproto/scion/private/path/pathpol imports
        github.com/antlr/antlr4/runtime/Go/antlr: ambiguous import: found package github.com/antlr/antlr4/runtime/Go/antlr in multiple modules:
        github.com/antlr/antlr4 v0.0.0-20181218183524-be58ebffde8e (/home/parallels/go/pkg/mod/github.com/antlr/antlr4@v0.0.0-20181218183524-be58ebffde8e/runtime/Go/antlr)
        github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220209173558-ad29539cd2e9 (/home/parallels/go/pkg/mod/github.com/antlr/antlr4/runtime/!go/antlr@v0.0.0-20220209173558-ad29539cd2e9)

This is due to go.mod pinning a wrong version of antlr (github.com/antlr/antlr4 v0.0.0-20181218183524-be58ebffde8e), whereas it should be github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220209173558-ad29539cd2e9, as required by scionproto/scion@v0.9.1.

This PR cleans up indirect imports (using go mod tidy) to fix the issue.


This change is Reviewable

marcfrei commented 7 months ago

@leonrinkel, to fix the remaining build issues, could you please rebase this PR on the latest version of 'master'?