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

Get MODULE.bazel from patches of archive_override/git_override #24311

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jesses-canva
Copy link

@jesses-canva jesses-canva commented Nov 13, 2024

PoC

It's common for archive_override and git_override modules to contain the entire MODULE.bazel file in their patches. In this case it's possible to provide the MODULE.bazel file for version resolution without executing the underlying repository rule.

Luckily most of the code for this already exists to apply the patches to the MODULE.bazel for a single_version_override, we just have to allow doing the same for archive_override/git_override and run the patch application without an existing file.

@jesses-canva jesses-canva changed the title Get MODULE.bazel from patches for archive_override/git_override Get MODULE.bazel from patches of archive_override/git_override Nov 13, 2024
@Wyverald
Copy link
Member

this shouldn't be necessary. Non-registry overrides like archive/git override already fetch the entire repo (which includes patching) before reading the MODULE.bazel file. Have you observed evidence to the contrary?

@fmeum
Copy link
Collaborator

fmeum commented Nov 15, 2024

Based on the description, I think that this is meant to speed up module resolution by avoiding the download of the module archive.

@Wyverald
Copy link
Member

Ah, I missed that part. But that doesn't really make sense to me, either -- what's the baseline for the patch? You'd still need to download the whole archive first.

@fmeum
Copy link
Collaborator

fmeum commented Nov 16, 2024

The PR tries to detect when the patch creates the file rather than modifies one, meaning that no baseline is needed.

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.

3 participants