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

fix(make): use the default rust dir for build/build-op #8259

Merged
merged 2 commits into from
May 18, 2024

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented May 14, 2024

Currently, we use cargo build --target $(shell rustc -Vv | grep host | cut -d ' ' -f2) to run the make build process, this will put the result into the directory as below:

target/aarch64-apple-darwin/release/reth # for macOS
target/x86_64-unknown-linux-gnu/release/reth # for Linux

This is inconvenience to run reth command(eg: ./target/aarch64-apple-darwin/release/reth node --dev), so propose to use the default rust target directory(target/{release,debug}) for the build process.

@jsvisa jsvisa requested a review from gakonst as a code owner May 14, 2024 16:47
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

yeah no idea why we do this

am I missing anything @onbjerg @shekhirin ?

@mattsse mattsse added the A-meta Changes in the contributor workflow and planning label May 14, 2024
@onbjerg
Copy link
Member

onbjerg commented May 14, 2024

we use this for the cross-platform docker builds which requires a very specific structure (target/$platform/$profile), so we cannot accommodate this

@onbjerg onbjerg closed this May 14, 2024
@mattsse
Copy link
Collaborator

mattsse commented May 14, 2024

maybe we could rename this to docker-build instead and add these changes as build?

I can see how make build would be inconvenient here

@jsvisa
Copy link
Contributor Author

jsvisa commented May 15, 2024

we use this for the cross-platform docker builds which requires a very specific structure (target/$platform/$profile), so we cannot accommodate this

@onbjerg Seems docker build not using the build target:

reth/Makefile

Lines 218 to 233 in 8dbffee

define docker_build_push
$(MAKE) build-x86_64-unknown-linux-gnu
mkdir -p $(BIN_DIR)/amd64
cp $(BUILD_PATH)/x86_64-unknown-linux-gnu/$(PROFILE)/reth $(BIN_DIR)/amd64/reth
$(MAKE) build-aarch64-unknown-linux-gnu
mkdir -p $(BIN_DIR)/arm64
cp $(BUILD_PATH)/aarch64-unknown-linux-gnu/$(PROFILE)/reth $(BIN_DIR)/arm64/reth
docker buildx build --file ./Dockerfile.cross . \
--platform linux/amd64,linux/arm64 \
--tag $(DOCKER_IMAGE_NAME):$(1) \
--tag $(DOCKER_IMAGE_NAME):$(2) \
--provenance=false \
--push
endef

which uses build-% instead(not this pr related build)

reth/Makefile

Lines 102 to 105 in 8dbffee

build-%:
RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \
cross build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)"

@onbjerg
Copy link
Member

onbjerg commented May 15, 2024

I don't think renaming this to docker-build makes sense either as that would imply building the docker image, build-%i is to build for a specific platform without overriding the binary each time. I see that this pr is just for build, so maybe this is ok.

@onbjerg onbjerg reopened this May 15, 2024
Makefile Show resolved Hide resolved
@emhane emhane added this pull request to the merge queue May 18, 2024
@emhane emhane removed this pull request from the merge queue due to a manual request May 18, 2024
@emhane emhane added this pull request to the merge queue May 18, 2024
Merged via the queue into paradigmxyz:main with commit 6922330 May 18, 2024
57 checks passed
@jsvisa jsvisa deleted the make-build-native branch May 19, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Changes in the contributor workflow and planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants