Skip to content

Commit

Permalink
resolver: Use a temporary working copy of the repository with gomod
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
eskultety committed Oct 25, 2024
1 parent 5799340 commit a06ef40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cachi2/core/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def resolve_packages(request: Request) -> RequestOutput:
This function performs the operations in a working copy of the source directory in case
a package manager that can make unwanted modifications will be used.
"""
if request.yarn_packages or request.yarn_classic_packages:
if request.yarn_packages or request.yarn_classic_packages or request.gomod_packages:
original_source_dir = request.source_dir

with TemporaryDirectory(".cachi2-source-copy", dir=".") as temp_dir:
Expand Down

0 comments on commit a06ef40

Please sign in to comment.