madewokherd / wine-mono

Other
294 stars 39 forks source link

Coreutils 9.2 changes cp -n behavior and causes mono compile to fail #164

Closed mooninite closed 1 year ago

mooninite commented 1 year ago

Coreutils 9.2 release notes:

https://github.com/coreutils/coreutils/blob/v9.2/NEWS#L88

Starting in 9.2, the 'cp' command and its '-n' option have different behavior.

Wine Mono uses "cp -n" in mono.make:

https://github.com/madewokherd/wine-mono/blob/develop/mono.make#L176

Fedora Rawhide compile (F39 / coreutils 9.3) output:

make[1]: Entering directory '/builddir/build/BUILD/wine-mono-8.0.0'
mkdir -p .//image/lib
/builddir/build/BUILD/wine-mono-8.0.0/tools/copy_recursive.py .//build/mono-win32-install/etc .//image
/builddir/build/BUILD/wine-mono-8.0.0/tools/copy_recursive.py .//build/mono-win32-install/lib/mono .//image/lib
cp -n .//image/lib/mono/4.8-api/*.dll .//image/lib/mono/4.5/
make[1]: Leaving directory '/builddir/build/BUILD/wine-mono-8.0.0'
cp: not replacing './/image/lib/mono/4.5/mscorlib.dll'
make[1]: *** [mono.make:176: mono-image] Error 1
make[1]: *** Waiting for unfinished jobs....

[mockbuild@9c02ad643ebd4e7fba322dba8bcf1d26 wine-mono-8.0.0]$ ll image//lib/mono/4.8-api/mscorlib.dll
-rwxr-xr-x. 1 mockbuild mock 899072 Jun 19 22:02 image//lib/mono/4.8-api/mscorlib.dll
[mockbuild@9c02ad643ebd4e7fba322dba8bcf1d26 wine-mono-8.0.0]$ ll image//lib/mono/4.5/mscorlib.dll
-rwxr-xr-x. 1 mockbuild mock 4678656 Jun 19 22:02 image//lib/mono/4.5/mscorlib.dll

Fedora 38 compile (coreutils 9.1) output:

make[1]: Entering directory '/builddir/build/BUILD/wine-mono-8.0.0'
mkdir -p .//image/lib
/builddir/build/BUILD/wine-mono-8.0.0/tools/copy_recursive.py .//build/mono-win32-install/etc .//image
/builddir/build/BUILD/wine-mono-8.0.0/tools/copy_recursive.py .//build/mono-win32-install/lib/mono .//image/lib
cp -n .//image/lib/mono/4.8-api/*.dll .//image/lib/mono/4.5/
make[1]: Leaving directory '/builddir/build/BUILD/wine-mono-8.0.0'

[mockbuild@df924c9e12924ff285061d7540f083e3 wine-mono-8.0.0]$ ll image//lib/mono/4.8-api/mscorlib.dll
-rwxr-xr-x. 1 mockbuild mock 899072 Jun 19 22:30 image//lib/mono/4.8-api/mscorlib.dll
[mockbuild@df924c9e12924ff285061d7540f083e3 wine-mono-8.0.0]$ ll image//lib/mono/4.5/mscorlib.dll
-rwxr-xr-x. 1 mockbuild mock 4678656 Jun 19 22:30 image//lib/mono/4.5/mscorlib.dll

Coreutils 9.1: Does not output any error message. Exit code: 0

Coreutils 9.2 and higher: Outputs error message (that 9.1 and earlier should have displayed). Exit code: 1

Systems with Coreutils 9.2 and higher will fail to compile Wine Mono. This failure has existed forever so I am not sure what kind of behavior this copy command should accomplish. I'd appreciate any feedback. Thanks.

madewokherd commented 1 year ago

The intended behavior is to copy only files that do not exist in the destination directory.

madewokherd commented 1 year ago

Well, the -n switch is no longer usable for this case, so I guess we just have to copy those files first and expect them to be overwritten.

mooninite commented 1 year ago

It still performs that copy as before, but instead of exiting with 0 it exits with 1. You may add "|| true" at the end of your command to retain the original behavior. Thanks for addressing it though.

madewokherd commented 1 year ago

I don't want actual errors to get lost though.