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

Fix project files absolute paths when a work copy is used #790

Merged

Conversation

brunoapimentel
Copy link
Contributor

@brunoapimentel brunoapimentel commented Jan 20, 2025

To avoid unintended source code modifications, Cachi2 makes a copy of the source directory when some package managers are used (currently, it's being done just for yarn).

This creates a problem with project files, since the absolute path of files now is pointing to the temporary working copy. The solution introced by this patch reverts these paths back to the original source dir path.

This is intended to be a quick fix, and should only be kept until we solve #712.

Resolves #785.

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Docs updated (if applicable)
  • Docs links in the code are still valid (if docs were updated)

Copy link
Contributor

@taylormadore taylormadore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable as a short-term fix to unblock users until the larger issue is resolved

Copy link
Collaborator

@a-ovchinnikov a-ovchinnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as a temporary solution (with a minor request).

cachi2/core/resolver.py Show resolved Hide resolved
To avoid unintended source code modifications, Cachi2 makes a copy of
the source directory when some package managers are used (currently,
it's being done just for yarn).

This creates a problem with project files, since the absolute path of
files now is pointing to the temporary working copy. The solution
introced by this patch reverts these paths back to the original source
dir path.

This is intended to be a quick fix, and should only be kept until we
solve containerbuildsystem#712.

Signed-off-by: Bruno Pimentel <[email protected]>
@brunoapimentel brunoapimentel added this pull request to the merge queue Jan 21, 2025
Merged via the queue into containerbuildsystem:main with commit 06180db Jan 21, 2025
15 checks passed
@brunoapimentel brunoapimentel deleted the fix-work-copy-bug branch January 21, 2025 18:46
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.

Using yarn will cause other package managers that rely on project files to fail to build
5 participants