Skip to content

Use tar instead of git archive in Copr Makefile to fix missing git in…#265

Merged
hecko merged 1 commit intomasterfrom
fix/copr-missing-git
Feb 10, 2026
Merged

Use tar instead of git archive in Copr Makefile to fix missing git in…#265
hecko merged 1 commit intomasterfrom
fix/copr-missing-git

Conversation

@hecko
Copy link
Contributor

@hecko hecko commented Feb 10, 2026

… mock chroot

The mock minimal buildroot does not include git, causing the SRPM build to fail. Replace git archive with tar which is available in the chroot.

… mock chroot

The mock minimal buildroot does not include git, causing the SRPM build
to fail. Replace git archive with tar which is available in the chroot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 10, 2026 14:18
@hecko hecko merged commit 00823b9 into master Feb 10, 2026
10 of 12 checks passed
@hecko hecko deleted the fix/copr-missing-git branch February 10, 2026 14:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the COPR SRPM build Makefile to avoid relying on git inside the mock minimal buildroot by generating the source tarball with tar instead of git archive.

Changes:

  • Replace git archive with a tar command to produce sems-$(VERSION).tar.gz during make srpm.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$(eval VERSION := $(shell cat VERSION))
mkdir -p ~/rpmbuild/SOURCES
git archive --format=tar.gz --prefix=sems-$(VERSION)/ HEAD > ~/rpmbuild/SOURCES/sems-$(VERSION).tar.gz
tar --transform 's,^\.,sems-$(VERSION),' --exclude=.git -czf ~/rpmbuild/SOURCES/sems-$(VERSION).tar.gz -C $$(pwd) .
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching from git archive to tar changes the contents of the generated source tarball: tar -C $(pwd) . will include all files in the working tree (including untracked/ignored build artifacts like build/, *.o, *.tar.gz, etc. per .gitignore), whereas git archive only included version-controlled sources. This can make SRPMs non-reproducible and can accidentally package local artifacts (or sensitive files) if make srpm is run from a non-clean checkout. Consider using GNU tar options to better match VCS semantics (e.g., exclude VCS + VCS-ignored files) or otherwise explicitly exclude ignored/artifact paths so only intended sources end up in the tarball.

Suggested change
tar --transform 's,^\.,sems-$(VERSION),' --exclude=.git -czf ~/rpmbuild/SOURCES/sems-$(VERSION).tar.gz -C $$(pwd) .
git archive --format=tar.gz --prefix=sems-$(VERSION)/ -o ~/rpmbuild/SOURCES/sems-$(VERSION).tar.gz HEAD

Copilot uses AI. Check for mistakes.
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

Successfully merging this pull request may close these issues.

1 participant