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

Running patch on windows-2022 started failing with "Can't rename file" #8632

Closed
2 of 10 tasks
gh-andre opened this issue Oct 22, 2023 · 4 comments
Closed
2 of 10 tasks
Labels
Area: Common Tools awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report OS: Windows

Comments

@gh-andre
Copy link

gh-andre commented Oct 22, 2023

Description

This started happening withing a week or a couple of weeks, maybe. Even repositories that used to patch source without problems are now failing with the same error.

It appears that the new version of patch on windows-2022 has a bug in how it handles temporary files when applying patches.

I verified that the source is in place and that directories where patches are applied have write permissions.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

See this run:

https://github.com/{removed}/{removed}/actions/runs/{removed}/job/{removed}

Expand Patch source to see errors.

Is it regression?

yes

Expected behavior

A patch used to apply properly in the source tree just a couple of weeks ago.

Actual behavior

Patches now are failing with messages like this:

patching file include/{removed}/{removed}.hpp
patch: **** Can't rename file include/{removed}/{removed}.hpp.oO03KIQ to include/{removed}/{removed}.hpp : No such file or directory

Repro steps

Have a patch and run it in cmd shell like this on a windows-2022 image:

patch -p1 --unified --input ..\patches\{removed}
@ilia-shipitsin
Copy link
Contributor

thank you for the report, we'll have a look

@ilia-shipitsin
Copy link
Contributor

our investigation shown that regression is the same (most likely) as #8598
new image is to be deployed this week

@ilia-shipitsin ilia-shipitsin added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Oct 23, 2023
@mikhailkoliada
Copy link
Contributor

Marking as a duplicate of #8598 as it has workaround inside

@gh-andre
Copy link
Author

Disappointing. Instead of fixing the broken image GitHub forces people to change a ton of actions with a hack of modifying their paths, without even providing any idea when this broken image will be fixed.

Anyway, if anybody using cmd shell stumbles upon this issue, here's the fix that worked for me.

      run: |
        PATH %PATH:C:\Strawberry\c\bin;=%
        patch ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Common Tools awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report OS: Windows
Projects
None yet
Development

No branches or pull requests

4 participants
@gh-andre @mikhailkoliada @ilia-shipitsin and others