Skip to content
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

CI fix #125

Closed
wants to merge 4 commits into from
Closed

CI fix #125

wants to merge 4 commits into from

Conversation

k0gen
Copy link
Member

@k0gen k0gen commented May 13, 2024

This is WIP

@remcoros
Copy link
Contributor

remcoros commented May 14, 2024

I see you are trying to fix CI builds as well :)

I think I found the root cause: moby/buildkit#4831

But even using the latest buildkit, it fails (so I guess it's not completely fixed upstream). It probably has to do with Docker version 26 vs Docker 25.

For some reason, it has problems adding files to the container when multiple hardlinks exist from that file.

I fixed it with the following workaround in Makefile (this breaks the hardlink by copying the file and then moving it back, essentially making it a "real" file instead of having it point to another inode:

configurator/target/aarch64-unknown-linux-musl/release/configurator: $(CONFIGURATOR_SRC)
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:aarch64-musl cargo build --release
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:aarch64-musl musl-strip target/aarch64-unknown-linux-musl/release/configurator
	# Docker 26 + buildkit 0.13.2 seem to have issues with building a context that contains multiple hardlinked files, work-around that by breaking the hardlink
	cp --remove-destination configurator/target/aarch64-unknown-linux-musl/release/configurator configurator/target/aarch64-unknown-linux-musl/release/configurator.tmp
	mv --force configurator/target/aarch64-unknown-linux-musl/release/configurator.tmp configurator/target/aarch64-unknown-linux-musl/release/configurator

health-check/target/aarch64-unknown-linux-musl/release/health-check: $(HEALTH_CHECK_SRC)
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:aarch64-musl cargo build --release
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:aarch64-musl musl-strip target/aarch64-unknown-linux-musl/release/health-check
	cp --remove-destination health-check/target/aarch64-unknown-linux-musl/release/health-check health-check/target/aarch64-unknown-linux-musl/release/health-check.tmp
	mv --force health-check/target/aarch64-unknown-linux-musl/release/health-check.tmp health-check/target/aarch64-unknown-linux-musl/release/health-check

configurator/target/x86_64-unknown-linux-musl/release/configurator: $(CONFIGURATOR_SRC)
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:x86_64-musl cargo build --release
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:x86_64-musl musl-strip target/x86_64-unknown-linux-musl/release/configurator
	cp --remove-destination configurator/target/x86_64-unknown-linux-musl/release/configurator configurator/target/x86_64-unknown-linux-musl/release/configurator.tmp
	mv --force configurator/target/x86_64-unknown-linux-musl/release/configurator.tmp configurator/target/x86_64-unknown-linux-musl/release/configurator

health-check/target/x86_64-unknown-linux-musl/release/health-check: $(HEALTH_CHECK_SRC)
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:x86_64-musl cargo build --release
	docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:x86_64-musl musl-strip target/x86_64-unknown-linux-musl/release/health-check
	cp --remove-destination health-check/target/x86_64-unknown-linux-musl/release/health-check health-check/target/x86_64-unknown-linux-musl/release/health-check.tmp
	mv --force health-check/target/x86_64-unknown-linux-musl/release/health-check.tmp health-check/target/x86_64-unknown-linux-musl/release/health-check

I've created a PR with this workaround here: #126

@Dominion5254
Copy link
Collaborator

Closing in favor of #126

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.

3 participants