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

Gazelle does not pick up files added by patch #4086

Open
SpencerC opened this issue Sep 3, 2024 · 3 comments
Open

Gazelle does not pick up files added by patch #4086

SpencerC opened this issue Sep 3, 2024 · 3 comments

Comments

@SpencerC
Copy link

SpencerC commented Sep 3, 2024

What version of rules_go are you using?

0.50.0

What version of gazelle are you using?

0.38.0

What version of Bazel are you using?

7.3.1

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

macOS

Any other potentially useful information about your toolchain?

What did you do?

Attepmted to apply this patch with the following directive after our use_repo(go_deps,... statement in MODULE.bazel:

go_deps.module_override(
    patch_strip = 1,
    patches = [
        "//:testcontainers-auth-errors.patch",
    ],
    path = "github.com/testcontainers/testcontainers-go",
)

What did you expect to see?

A successful build.

What did you see instead?

external/gazelle~~go_deps~com_github_testcontainers_testcontainers_go/docker_auth.go:128:25: undefined: getRegistryCredentials

Gazelle does not seem to pick up the docker_config.go file added by the patch; manually adding it to the generated BUILD.bazel file solves the problem.

@fmeum
Copy link
Collaborator

fmeum commented Sep 3, 2024

Patches are applied after Gazelle is run, so this is expected. We could have "after Gazelle patches", but I'm not sure whether that's worth the complexity. How much larger is your patch due to this?

@SpencerC
Copy link
Author

SpencerC commented Sep 3, 2024

How much larger is your patch due to this?

If I'm understanding you correctly, are you asking how much we have to add to our patch to make it work? Like could we just add a section to the patch to add the missing line to the generated BUILD.bazel? If that's possible (I'm not that that familiar with patch mechanics), I suppose we could. Its just a bit weird to support some patch operations and require special hacking for others.

My team, and hopefully other teams, are not overly reliant on patching, so totally understand if this isn't a boundry case you plan to support.

@SpencerC
Copy link
Author

SpencerC commented Sep 3, 2024

We could also just modify the patch to append the code to an existing file. In this case, we got the patch from the package maintainer.

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