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

Can not use scion-apps from a Bazel project #136

Closed
ekuiter opened this issue Mar 25, 2020 · 3 comments
Closed

Can not use scion-apps from a Bazel project #136

ekuiter opened this issue Mar 25, 2020 · 3 comments

Comments

@ekuiter
Copy link

ekuiter commented Mar 25, 2020

It is not possible to require this repository with Bazel as a go_repository, e.g., go_repository(name="com_github_netsec_ethz_scion_apps", importpath="github.com/netsec-ethz/scion-apps").
Gazelle will try and generate Bazel BUILD files, which fails with the following error message:

vagrant@ubuntu-xenial:/vagrant/scion-apps$ gazelle -go_prefix github.com/netsec-ethz/scion-apps -repo_roo t .
gazelle: finding module path for import github.com/lucas-clemente/quic-go/h2quic: exit status 1: can't load package: package github.com/lucas-clemente/quic-go/h2quic: module github.com/lucas-clemente/quic-go@latest found (v0.15.2), but does not contain package github.com/lucas-clemente/quic-go/h2quic

This is because quic-go renamed the h2quic directory to http3. It would be nice if this could be fixed, so that Go projects that use Bazel can reference this repository as a library.

@matzf
Copy link
Member

matzf commented Mar 26, 2020

What exactly could we do to fix this on our side? Do you want us to update to the latest version? We can't do this "unilaterally", as our quic-go version is essentially dictated by scionproto/scion. There is an existing PR there, to update this, but, as far as I know, nobody is working on this right now.

Anyway, couldn't you make gazelle somehow consider the go.mod modules to get a working set of versions? My expectation would be that if it just pulls the latest version of everything, you will never get something that works.

@ekuiter
Copy link
Author

ekuiter commented Mar 26, 2020

I guess I "fixed" it by copying the relevant code into my project (https://github.com/ekuiter/scion-android-binary/tree/master/scion-android), as I ran into some other problems when trying to fix this.

Regarding gazelle: Yes and no. On first initialization, gazelle seems to ignore versions in go.mod, which leads to the error. Afterwards, one can run gazelle update-repos -from_file=go.mod, which seems to work. However, I can't seems to wrap my head around Bazel in general, and copying the files seems easiest for now in my use case. (Thanks anyway!)

@matzf
Copy link
Member

matzf commented May 5, 2020

FYI, we've updated quic-go to the latest version, following the same change on scionproto/scion.

Closing, because there is nothing "actionable" here.

@matzf matzf closed this as completed May 5, 2020
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