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

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

Closed
mooninite opened this issue Jun 20, 2023 · 4 comments
Closed

Comments

@mooninite
Copy link

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
Copy link
Owner

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

@madewokherd
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

madewokherd pushed a commit that referenced this issue Aug 9, 2023
Fixes #164.

(cherry picked from commit 7a783fb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants