Skip to content

Conversation

@fweikert
Copy link
Member

@fweikert fweikert commented Sep 2, 2022

No description provided.

@fweikert fweikert merged commit 5387890 into master Sep 5, 2022
@fweikert fweikert mentioned this pull request Sep 5, 2022
@sluongng
Copy link
Contributor

sluongng commented Jun 1, 2023

@fweikert Unfortunately this fix is insufficient for another Bazel repository to use bazelisk via go_repository.

The main problem is the netrc deps will be provided by Gazelle like this:

    go_repository(
        name = "com_github_bgentry_go_netrc",
        importpath = "github.com/bgentry/go-netrc",
        sum = "h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=",
        version = "v0.0.0-20140422174119-9fd32a8b3d3d",
    )

and thus, there is no prefix trim happening.
And because BUILD files already exist in Bazelisk, we could not override how import works using a gazelle:resolve directive.

Worth to note that compare to Gazelle's go_repository, the current approach does not provide any checksum validation on the external dependencies, and it depends on Github's unstable SHA to download the archive. https://blog.bazel.build/2023/02/15/github-archive-checksum.html

Since the netrc library is relatively small, would you consider just... vendoring the parser logic within Bazelisk?

Alternatively, I raised git-lfs/go-netrc#2 to add a go.mod into a more mature fork of the netrc library. Given git-lfs reputation, I think switching to it would be a more reliable choice moving forward.

Let me know what you think.

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

Successfully merging this pull request may close these issues.

4 participants