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

Cachi2 prefetching is making changes on a Go project's source #707

Open
arewm opened this issue Oct 23, 2024 · 1 comment
Open

Cachi2 prefetching is making changes on a Go project's source #707

arewm opened this issue Oct 23, 2024 · 1 comment
Labels
bug Something isn't working gomod Pull requests/issues related to the gomod handling module

Comments

@arewm
Copy link
Contributor

arewm commented Oct 23, 2024

When running Cach2 on a source repo with the gomod package manager, changes are made to the go.mod file. This is presumably from running go mod tidy. It is also changing the sources when fetching the origin information for the git repository.

Cachi2 should not modify the sources that it is run on. Instead, it should operate on a temporary copy of the repository.

@arewm arewm changed the title Cachi2 prefetching for gomod is making changes on the source. Cachi2 prefetching is making changes on the source Oct 23, 2024
@eskultety
Copy link
Member

Yes, this is known (or at least was common with projects requiring <=1.20 and having been processed with >=1.21). Recently we deprecated the --gomod-vendor-check and --gomod-vendor CLI flags that would have prevented us from fixing this (or at least not in a clean way). With those practically gone, we should be able to fix this in a simple and clean manner.

@eskultety eskultety added bug Something isn't working gomod Pull requests/issues related to the gomod handling module labels Oct 25, 2024
@eskultety eskultety changed the title Cachi2 prefetching is making changes on the source Cachi2 prefetching is making changes on a Go project's source Oct 25, 2024
eskultety added a commit to eskultety/cachi2 that referenced this issue Oct 25, 2024
gomod has been the only backend that prevented us from using a
temporary working copy of the input repository with all package manager
backends. The reason for that was the existence of the:
    * '--gomod-vendor'
    * '--gomod-vendor-check', and
    * '--force-gomod-tidy'
CLI flags that allowed the source repository to be dirtied by us. With
all of those flags now deprecated (treating them as NOOP) we can use a
temporary repository copy with gomod as well.

Resolves: containerbuildsystem#707

Signed-off-by: Erik Skultety <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gomod Pull requests/issues related to the gomod handling module
Projects
None yet
Development

No branches or pull requests

2 participants