{"push_id":2392655044,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"89b524c2929c2e743c60038fa9623869cffa2505","before":"6436b11fdadf305d6c3b62fd4744dae839929310","commits":[{"sha":"89b524c2929c2e743c60038fa9623869cffa2505","author":{"name":"Jonathan Pryor","email":"69e3f626213518b6a6c0b4db98d6430d9edc0042@vt.edu"},"message":"[build] Don't use `cp -n` in `make package-oss`\n\nContext: https://github.com/xamarin/xamarin-android/pull/1389\n\nCommit a3c55b41 was attempting to fix a [build break on Linux][0]:\n\n[0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/835/\n\n\tif [ ! -f xamarin.android-oss_v8.3.99.38_Linux-x86_64_HEAD_328286b/ThirdPartyNotices.txt ] ; then cp -af bin/*/lib/xamarin.android/ThirdPartyNotices.txt xamarin.android-oss_v8.3.99.38_Linux-x86_64_HEAD_328286b ; fi\n\tcp: will not overwrite just-created 'xamarin.android-oss_v8.3.99.38_Linux-x86_64_HEAD_328286b/ThirdPartyNotices.txt' with 'bin/Release/lib/xamarin.android/ThirdPartyNotices.txt'\n\tbuild-tools/scripts/BuildEverything.mk:172: recipe for target 'xamarin.android-oss_v8.3.99.38_Linux-x86_64_HEAD_328286b.tar.bz2' failed\n\nThe fix was to use `cp -n` instead of `cp -af`.\n\nThe problem is that `cp -n` [breaks macOS][1]:\n\n[1]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/906/\n\n\tif [ ! -f xamarin.android-oss_v8.3.99.40_Darwin-x86_64_HEAD_6436b11/ThirdPartyNotices.txt ] ; then cp -n bin/*/lib/xamarin.android/ThirdPartyNotices.txt xamarin.android-oss_v8.3.99.40_Darwin-x86_64_HEAD_6436b11 ; fi\n\tmake: *** [xamarin.android-oss_v8.3.99.40_Darwin-x86_64_HEAD_6436b11.zip] Error 1\n\nThe oddity is that there is no error message produced, which is\nprobably why it appeared to be correct; from the PR #1389 manual test:\n\n\tmkdir a1\n\tmkdir a2\n\ttouch a1/foo.txt a2/foo.txt\n\tmkdir out\n\tcp -n a*/*.txt out/\n\nNotably lacking from the above test?\n\n\t$ echo $?\n\t1\n\nOops. `cp -n a*/*.txt out` doesn't show any error message *at all*,\nbut the command itself still *fails*, with an exit status of 1.\n\nWhich means 🎼Everything is broken🎵.\n\nFix this by *instead* using `$(firstword $(wildcard files))`, thus\nensuring that only one file will be present on the `cp` command line,\nwhich *should* appease *both* Linux and macOS:\n\n\tcp -n $(firstword $(wildcard bin/*/lib/xamarin.android/ThirdPartyNotices.txt)) $(ZIP_OUTPUT_BASENAME)","distinct":true,"url":"https://api.github.com/repos/xamarin/xamarin-android/commits/89b524c2929c2e743c60038fa9623869cffa2505"}]}
{"actor":{"display_login":"jonpryor"}}