fedora-copr / copr

RPM build system - upstream for https://copr.fedorainfracloud.org/
113 stars 62 forks source link

The make_srpm method fails with git safe.directory error #3421

Closed FrostyX closed 4 weeks ago

FrostyX commented 1 month ago

Full log: builder-live.log.gz.txt

./contrib/fedora/make_srpm.sh --prerelease --output /mnt/safe-resultdir-c3dy38x1
remote: fatal: detected dubious ownership in repository at '/mnt/workdir-a7gx95j6/sssd/.git'        
remote: To add an exception for this directory, call:        
remote: 
remote:     git config --global --add safe.directory /mnt/workdir-a7gx95j6/sssd/.git        
remote: git upload-archive: archiver died with error
fatal: sent error to the client: git upload-archive: archiver died with error

But strangely enough, after the fatal error, we still produce the SRPM?

Creating SRPM without extra patches.
setting SOURCE_DATE_EPOCH=1611187200
Wrote: /mnt/workdir-a7gx95j6/sssd/rpmbuild/SRPMS/sssd-2.10.0~beta2-0.240924.083430.git5f5077ac1.src.rpm
pbrezina commented 1 month ago

This is the script we use: https://github.com/SSSD/sssd/blob/master/contrib/fedora/make_srpm.sh

FrostyX commented 1 month ago

But strangely enough, after the fatal error, we still produce the SRPM?

@pbrezina says "It produces some 20-bytes malformed tarball"

pbrezina commented 1 month ago

We run git archive ... | gzip > "$RPMBUILD/SOURCES/$NAME.tar.gz" so if git archive fail we still feed gzip with the error message and rpmbuild does not care that the tarball is malformed.

praiskup commented 1 month ago

Has this stopped working? 77dbe365b61e8de84202dc7e2f05c62c8c15470a

FrostyX commented 1 month ago

Or it possibly never worked with make_srpm? I am not sure.

pbrezina commented 1 month ago

Btw the last successful build was 16. 5. 2024. It is all red after this day.

nikromen commented 1 month ago

this is really still hapenning: https://download.copr.fedorainfracloud.org/results/nikromen/playground/srpm-builds/08113937/builder-live.log.gz

but once I take builder and try to debug it manually there, it'll pass every time 🤷 shouldn't this also produce the safe.directory fail? What's the difference between taking a builder and running /usr/bin/copr-rpmbuild --verbose --drop-resultdir --srpm --task-url https://copr.fedorainfracloud.org/backend/get-srpm-build-task/8113937 there and letting copr to do the same in a build automatically...

nikromen commented 1 month ago

the command to create safe directory in .gitconfig is correct in both cases, but when srpm build is handled by copr, it somehow either has no effect or something mystically "cancels" the already set safe directory

praiskup commented 4 weeks ago

@pbrezina can you take a look at https://github.com/SSSD/sssd/pull/7639 ? Git archive seems to behave fine if we don't use --remote=file://, which I'm not really sure why is needed (shouldn't be).