Repository navigation
Conversation
Visual Studio keeps files under .vs open without sharing, so copying the source on Windows fails with Permission denied while it is open. Add .vs to EXCLUDED_FILES in every workflow that copies the full source with CopySourceAction. Fixes aws/aws-sam-cli#7886
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: Fixes aws/aws-sam-cli#7886
Description of changes
CopySourceActioncopies the whole source directory, including Visual Studio's.vsfolder. Visual Studio keeps files under.vs(for exampleFileContentIndex\*.vsidx) open without sharing, so on Windows the copy fails with[Errno 13] Permission deniedwhile VS is open.This adds
.vstoEXCLUDED_FILESin every workflow that copies the full source withCopySourceAction: custom_make, java_maven, nodejs_npm, nodejs_npm_esbuild, python_pip, python_uv and ruby_bundler. The pip and uv workflows already exclude.vscodeand.idea. Configurable ignore lists are left for a separate change.One case this does not cover: when
package.jsonis in the source directory, the npm workflow runsnpm packon the source first, and npm reads.vsitself unless.npmignoreor.gitignoreexcludes it. Visual Studio's default.gitignorelists.vs/.Description of how you validated changes
tests/functional/test_actions.py: runsCopySourceActionwith each of those workflows'EXCLUDED_FILESon a real directory containing.vs. It fails ondevelop(7 of 7) and passes with the change..vs\FileContentIndex\x.vsidxopen withCreateFileWshare mode 0. Before the change,CopySourceActionwithCustomMakeWorkflow.EXCLUDED_FILESraisedPermissionError: [WinError 32] The process cannot access the file because it is being used by another process. After it, the copy succeeds and.vsis skipped.make testequivalent (unit + functional): 1218 passed, 4 skipped, coverage 95.11%.ruff check aws_lambda_buildersandblack --checkpass.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.