-
Notifications
You must be signed in to change notification settings - Fork 206
Misc. Improvements Draft PR #2294
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
b950604
b08e289
b49c268
dfad00c
69807fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,28 +32,42 @@ prefix ?= /usr | |
| CARGO_FEATURES_DEFAULT ?= $(shell . /usr/lib/os-release; if echo "$$ID_LIKE" |grep -qF rhel; then echo rhsm; fi) | ||
| # You can set this to override all cargo features, including the defaults | ||
| CARGO_FEATURES ?= $(CARGO_FEATURES_DEFAULT) | ||
| BOOTC_PROFILE ?= $(if $(wildcard target/rpm/bootc),rpm,release) | ||
| BOOTC_TARGET_DIR = target/$(BOOTC_PROFILE) | ||
|
|
||
| # Build all binaries | ||
| .PHONY: bin | ||
| bin: manpages | ||
| cargo build --release --features "$(CARGO_FEATURES)" --bins | ||
| if [ ! -x "$(BOOTC_TARGET_DIR)/bootc" ]; then \ | ||
| cargo build --release --features "$(CARGO_FEATURES)" --bins; \ | ||
| fi | ||
|
|
||
| # Note this cargo build is run without features (such as rhsm) | ||
| .PHONY: manpages | ||
| manpages: | ||
| cargo run --release --package xtask -- manpages | ||
| if [ -x "$(BOOTC_TARGET_DIR)/bootc" ]; then \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But yes, this is really really messy how we have our documentation depend on running the binary. Maybe what is easier is to try to move instead to where we just validate the generated docs as a separate phase, but don't default to linking the two together. It's effectively what we did for the tmt stuff |
||
| rm -rf target/man; \ | ||
| if [ -x "$(BOOTC_TARGET_DIR)/xtask" ]; then \ | ||
| BOOTC_DOCGEN_BIN="$(BOOTC_TARGET_DIR)/bootc" "$(BOOTC_TARGET_DIR)/xtask" manpages; \ | ||
| else \ | ||
| BOOTC_DOCGEN_BIN="$(BOOTC_TARGET_DIR)/bootc" cargo run --release --package xtask -- manpages; \ | ||
| fi; \ | ||
| else \ | ||
| mkdir -p target/man; \ | ||
| printf '.TH BOOTC 8\n.SH NAME\nbootc \\- bootable container system\n' > target/man/bootc.8; \ | ||
| printf '.TH BOOTC-SETUP-ROOT-CONF 5\n.SH NAME\nbootc-setup-root.conf \\- bootc setup-root configuration\n' > target/man/bootc-setup-root-conf.5; \ | ||
| fi | ||
|
|
||
| .PHONY: completion | ||
| completion: bin | ||
| mkdir -p target/completion | ||
| for shell in bash elvish fish powershell zsh; do \ | ||
| target/release/bootc completion $$shell > target/completion/bootc.$$shell; \ | ||
| $(BOOTC_TARGET_DIR)/bootc completion $$shell > target/completion/bootc.$$shell; \ | ||
| done | ||
|
|
||
| STORAGE_RELATIVE_PATH ?= $(shell realpath -m -s --relative-to="$(prefix)/lib/bootc/storage" /sysroot/ostree/bootc/storage) | ||
| install: completion | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/system-reinstall-bootc | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin $(BOOTC_TARGET_DIR)/bootc | ||
| install -D -m 0755 -t $(DESTDIR)$(prefix)/bin $(BOOTC_TARGET_DIR)/system-reinstall-bootc | ||
| install -d -m 0755 $(DESTDIR)$(prefix)/lib/bootc/bound-images.d | ||
| install -d -m 0755 $(DESTDIR)$(prefix)/lib/bootc/kargs.d | ||
| ln -s "$(STORAGE_RELATIVE_PATH)" "$(DESTDIR)$(prefix)/lib/bootc/storage" | ||
|
|
@@ -83,7 +97,7 @@ install: completion | |
| install -D -m 0755 -t $(DESTDIR)/$(prefix)/lib/bootc contrib/scripts/fedora-bootc-destructive-cleanup; \ | ||
| fi | ||
| install -D -m 0644 -t $(DESTDIR)/usr/lib/systemd/system crates/initramfs/*.service | ||
| install -D -m 0755 target/release/bootc-initramfs-setup $(DESTDIR)/usr/lib/bootc/initramfs-setup | ||
| install -D -m 0755 $(BOOTC_TARGET_DIR)/bootc-initramfs-setup $(DESTDIR)/usr/lib/bootc/initramfs-setup | ||
| install -D -m 0755 -t $(DESTDIR)/usr/lib/dracut/modules.d/51bootc crates/initramfs/dracut/module-setup.sh | ||
|
|
||
| # Run this to also take over the functionality of `ostree container` for example. | ||
|
|
||
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.
This completely breaks the buildsystem, no? We'd just silently be reusing old binaries...
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.
yes, that patch is not good and not designed for merge. But it did its job for me.
It is very hard to iterate with bootc while having it compile three times to deploy