-
Notifications
You must be signed in to change notification settings - Fork 34
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
Include the patched version of aws-nitro-enclaves-cose in the repo and packit enhancements #704
Closed
+2,709
−197
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
05104a3
chore: add aws-nitro-enclaves-cose 0.4.0 crate to the repo
mmartinv 2e7579d
chore: fix aws-nitro-enclaves-cose errors
mmartinv 0d936ec
chore: spec changes
mmartinv 8e9c5d5
chore: use the new local copy of aws-nitro-enclaves-cose
mmartinv c6bf7d5
chore: add new Makefile targets
mmartinv a8ef044
chore: use the new Makefile target in packit
mmartinv f98bf3f
chore: remove unused patches and scripts
mmartinv a9c8087
chore: skip external crates from analisys
mmartinv 23d26e7
chore: ignore source code and vendor tarballs
mmartinv b1a55bd
chore: avoid clippy errors
mmartinv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
include /etc/os-release | ||
|
||
SRCDIR ?= . | ||
COMMIT = $(shell (cd "$(SRCDIR)" && git rev-parse HEAD)) | ||
VENDOR ?= false | ||
VERSION = $(shell (cd "$(SRCDIR)" && git describe --tags | sed -e 's/^v//' -e 's/-/./')) | ||
PLATFORMS = $(shell (echo {x86_64,aarch64,powerpc64le,s390x}-unknown-linux-gnu)) | ||
|
||
# | ||
# Generic Targets | ||
|
@@ -23,9 +25,44 @@ help: | |
@echo "The following targets are available:" | ||
@echo | ||
@echo " help: Print this usage information." | ||
@echo " source: Generate source tar file in the current directory." | ||
@echo " vendor: Generate vendor tar file in the current directory." | ||
@echo " rpm: Generate RPM." | ||
@echo " srpm: Generate SRPM." | ||
@echo " man: Generate man pages." | ||
|
||
# | ||
# Generating sources and vendor tar files | ||
# | ||
|
||
SOURCE_TARBALL=fido-device-onboard-rs-$(VERSION).tar.gz | ||
|
||
$(SOURCE_TARBALL): | ||
git archive --prefix=fido-device-onboard-rs-$(VERSION)/ --format=tar.gz HEAD > $(SOURCE_TARBALL) | ||
|
||
.PHONY: source | ||
source: $(SOURCE_TARBALL) | ||
|
||
VENDOR_TARBALL=fido-device-onboard-rs-$(VERSION)-vendor.tar.xz | ||
|
||
$(VENDOR_TARBALL): | ||
vendor_filterer_cmd=$$(command -v cargo-vendor-filterer||:) | ||
[ -z "$$vendor_filterer_cmd" ] || rm -f $${vendor_filterer_cmd} | ||
# We need v0.5.7 because of RHEL rust version | ||
cargo install --quiet [email protected]; | ||
for platform in $(PLATFORMS); do \ | ||
args+="--platform $${platform} "; \ | ||
done | ||
# https://issues.redhat.com/browse/RHEL-65521 | ||
args+="--exclude-crate-path idna#tests " | ||
rm -rf vendor | ||
cargo vendor-filterer $${args} | ||
tar cJf $(VENDOR_TARBALL) vendor | ||
rm -rf vendor | ||
|
||
.PHONY: vendor | ||
vendor: $(VENDOR_TARBALL) | ||
|
||
# | ||
# Building packages | ||
# | ||
|
@@ -38,41 +75,45 @@ help: | |
# ./rpmbuild, using rpmbuild's usual directory structure. | ||
# | ||
|
||
RPM_SPECFILE=rpmbuild/SPECS/fido-device-onboard-rs-$(COMMIT).spec | ||
RPM_TARBALL=rpmbuild/SOURCES/fido-device-onboard-rs-$(COMMIT).tar.gz | ||
VENDOR_TARBALL=rpmbuild/SOURCES/fido-device-onboard-rs-$(COMMIT)-vendor-patched.tar.xz | ||
SPEC_FILE=./fido-device-onboard.spec | ||
RPM_TOP_DIR=$(CURDIR)/rpmbuild | ||
RPMS_SPECS_DIR=$(RPM_TOP_DIR)/SPECS | ||
RPMS_SOURCES_DIR=$(RPM_TOP_DIR)/SOURCES | ||
RPM_SPECFILE=$(RPMS_SPECS_DIR)/fido-device-onboard-rs-$(VERSION).spec | ||
RPM_TARBALL=$(RPMS_SOURCES_DIR)/fido-device-onboard-rs-$(VERSION).tar.gz | ||
RPM_VENDOR_TARBALL=${RPMS_SOURCES_DIR}/$(VENDOR_TARBALL) | ||
|
||
$(RPM_SPECFILE): | ||
mkdir -p $(CURDIR)/rpmbuild/SPECS | ||
sed -e "s/^Version:.*/Version: $(COMMIT)/;" fido-device-onboard.spec > $(RPM_SPECFILE) | ||
if [ "$(ID)" = "fedora" ] && [ $(VARIANT_ID) != "eln" ]; then \ | ||
sed -i "/Source1/d ; /^# See make-vendored-tarfile.sh in upstream repo/d ;" $(RPM_SPECFILE); \ | ||
fi | ||
mkdir -p $(RPMS_SPECS_DIR) | ||
sed -e "s/^Version:.*/Version: $(VERSION)/;" \ | ||
-e "s|%{url}/archive/v%{version}/||;" \ | ||
$(SPEC_FILE) > $(RPM_SPECFILE) | ||
|
||
$(RPM_TARBALL): | ||
mkdir -p $(CURDIR)/rpmbuild/SOURCES | ||
cp ./patches/0001-Revert-chore-use-git-fork-for-aws-nitro-enclaves-cos.patch rpmbuild/SOURCES/; | ||
git archive --prefix=fido-device-onboard-rs-$(COMMIT)/ --format=tar.gz HEAD > $(RPM_TARBALL) | ||
|
||
$(VENDOR_TARBALL): | ||
[ "$(ID)" = "fedora" ] && [ $(VARIANT_ID) != "eln" ] || ( \ | ||
mkdir -p $(CURDIR)/rpmbuild/SOURCES ; \ | ||
./make-vendored-tarfile.sh $(COMMIT) ; \ | ||
mv fido-device-onboard-rs-$(COMMIT)-vendor-patched.tar.xz rpmbuild/SOURCES ;) | ||
$(RPM_TARBALL): $(SOURCE_TARBALL) $(VENDOR_TARBALL) | ||
mkdir -p $(RPMS_SOURCES_DIR) | ||
mv $(SOURCE_TARBALL) $(RPM_TARBALL) | ||
mv $(VENDOR_TARBALL) $(RPM_VENDOR_TARBALL); | ||
|
||
.PHONY: srpm | ||
srpm: $(RPM_SPECFILE) $(RPM_TARBALL) $(VENDOR_TARBALL) | ||
srpm: $(RPM_SPECFILE) $(RPM_TARBALL) | ||
rpmbuild -bs \ | ||
--define "_topdir $(CURDIR)/rpmbuild" \ | ||
--define "_topdir $(RPM_TOP_DIR)" \ | ||
$(RPM_SPECFILE) | ||
|
||
.PHONY: rpm | ||
rpm: $(RPM_SPECFILE) $(RPM_TARBALL) $(VENDOR_TARBALL) | ||
sudo dnf builddep -y fido-device-onboard | ||
rpm: $(RPM_SPECFILE) $(RPM_TARBALL) | ||
sudo dnf builddep -y $(RPM_SPECFILE) | ||
rpmbuild -bb \ | ||
--define "_topdir $(CURDIR)/rpmbuild" \ | ||
--define "_topdir $(RPM_TOP_DIR)" \ | ||
$(RPM_SPECFILE) | ||
|
||
# | ||
# Packit target | ||
# | ||
|
||
.PHONY: packit-create-archive | ||
packit-create-archive: $(SOURCE_TARBALL) $(VENDOR_TARBALL) | ||
|
||
# | ||
# Generating man pages | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can update the SOP document to use these commands too - like
git checkout v0.5.2
and thenmake source && make vendor
and thengit checkout c10s && centpkg updload file.tar.gz
etc etc (maybe for another PR of course)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the
propose-downstream
also work for centos? (except for the corresponding Jira ticket creation)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, but you still have to upload the sources (this is how I read the page on the packit guide as it's not yet implemented to upload sources to the lookaside cache) - also, building isn't taken care of as far as I can tell
maybe I'm wrong :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think you are right, It looks like the automation will not do it for us but there's the option of using the cli according to the warning note.
Mabye something like (after filing the corresponding Jira ticket: RHEL-XXXXX):