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

regression: remote-build fails when project is not in a git directory #4517

Closed
mr-cal opened this issue Jan 10, 2024 · 2 comments
Closed

regression: remote-build fails when project is not in a git directory #4517

mr-cal opened this issue Jan 10, 2024 · 2 comments
Labels
bug Actual bad behavior that don't fall into maintenance or documentation

Comments

@mr-cal
Copy link
Collaborator

mr-cal commented Jan 10, 2024

Bug Description

In snapcraft 8.0.1, remote-build is now failing if the project is not in a git repository.

This failure is occurring in the weekly spread tests: https://github.com/snapcore/snapcraft/actions/runs/7469897740/job/20327823910#step:5:36

This check is causing snapcraft to fail and preempts all the code that automatically initializes a git repository in the temporary work directory.

To Reproduce

mkdir tmp
pushd tmp
snapcraft init
snapcraft remote-build
popd

Environment

n/a

snapcraft.yaml

n/a

Relevant log output

2024-01-10 03:26:29.754 remote-build error: The Git repository is invalid for remote build.
Could not find a git repository in '.'

Additional context

No response

@mr-cal mr-cal added the bug Actual bad behavior that don't fall into maintenance or documentation label Jan 10, 2024
@mr-cal
Copy link
Collaborator Author

mr-cal commented Jan 17, 2024

Per Sergio, this is an intentional decision for the following reason:
If a user builds destructively locally and is not in a git repo, snapcraft will add the parts, stage, and prime directory to the git repo it initializes. This could cause the remote-builder to re-use these directories instead of doing a clean build.

The path forward is to adjust the failing spread test and improve the error message.

@cmatsuoka
Copy link
Contributor

Per Sergio, this is an intentional decision for the following reason: If a user builds destructively locally and is not in a git repo, snapcraft will add the parts, stage, and prime directory to the git repo it initializes. This could cause the remote-builder to re-use these directories instead of doing a clean build.

This could also be handled by ignoring the work directories when creating the git repo (we use a similar approach when copying to the part src directory).

@mr-cal mr-cal closed this as completed Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation
Projects
None yet
Development

No branches or pull requests

2 participants