code-server: [Bug]: Unable to run project on macOS 13

Is there an existing issue for this?

  • I have searched the existing issues

Issue Details

I am following the contributing guide

It’s working on Linux without any issues. but on mac, there is an issue with applying the patches. when I run quilt push -a there are errors.

Am I missing something?

Steps to Reproduce

  1. Follow the contribution guide on Mac M1

Expected

The patches should be applied

Actual

There are errors and I get a forbidden message when I run code-server on the browser. According to the docs, this happens when the patches are not applied correctly

Logs

Applying patch patches/proposed-api.diff
patching file 'lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts'
Can't backup '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoQQ2sGvMSLk', output is in '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoQQ2sGvMSLk': No such file or directory
patching file 'lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts'
Can't backup '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoQQ2sGvMSLk', output is in '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoQQ2sGvMSLk': No such file or directory
Patch patches/proposed-api.diff appears to be empty; applied

Applying patch patches/marketplace.diff
patching file 'lib/vscode/src/vs/platform/product/common/product.ts'
Can't backup '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoIe3etLqZrR', output is in '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoIe3etLqZrR': No such file or directory
patching file 'lib/vscode/src/vs/server/node/webClientServer.ts'
Can't backup '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoIe3etLqZrR', output is in '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoIe3etLqZrR': No such file or directory
patching file 'lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts'
Can't backup '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoIe3etLqZrR', output is in '/var/folders/f1/bwc053990rg36bl7bc6bv6940000gn/T/patchoIe3etLqZrR': No such file or directory
1 out of 2 hunks failed--saving rejects to 'lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts.rej'
Patch patches/marketplace.diff does not apply (enforce with -f)

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

FYI, you can work around this problem by installing GNU patch on a Mac using homebrew:

brew install gpatch

Be sure to close your existing console window and open a new one after installing it to test this (otherwise it may still use the original Apple “patch”).

I stumbled across this bug while searching for the same error in one of my own projects that uses quilt. The bug appears to be in the macOS 13 patch program – it fails with this error if both --backup and --prefix are used and the target to be patched has multiple levels (which often happens with quilt). It happens on my Intel-based Mac, not just an M1 Mac.

Here’s a reproducible demonstration of the problem. This works, as you would expect:

mkdir patchtemp
echo 123456 > patchtemp/temp1
echo 1234x6 > patchtemp/temp2
cd patchtemp
diff -u temp1 temp2 > temp.patch
mkdir tempdir
patch --backup --prefix=tempdir/ -i temp.patch

However, if you introduce different levels into the patch file, like this:

mkdir patchtemp
echo 123456 > patchtemp/temp1
echo 1234x6 > patchtemp/temp2
diff -u patchtemp/temp1 patchtemp/temp2 > patchtemp/temp.patch
mkdir patchtemp/tempdir
patch --backup --prefix=patchtemp/tempdir/ -i patchtemp/temp.patch

… then you get the error:

Can't backup '/var/folders/nb/2gx6t6wx63b30222g0r47w6c0000gn/T/patchoSGifYqRkQK', output is in '/var/folders/nb/2gx6t6wx63b30222g0r47w6c0000gn/T/patchoSGifYqRkQK': No such file or directory

This presumably happens because in the first example, it tries to create the backup file at patchtemp/tempdir/temp1, and that works fine since patchtemp/tempdir already exists. But in the second case, it tries to create it at patchtemp/tempdir/patchtemp/temp1, which requires that patch make a temporary directory at patchtemp/tempdir/patchtemp first. But it’s instead creating it at /var/folders/nb/2gx6t6wx63b30222g0r47w6c0000gn/T/patchoSGifYqRkQK.

This problem is new with macOS 13, so I reported it earlier today to Apple using the Feedback Assistant. I also reported it to https://savannah.nongnu.org/bugs/?group=quilt.

Another workaround would be to run the command inside a docker container.

I had it checked in another macOs Ventura with M1. Same issue. image