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

Handle non-default cargo target dir #10775

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

estensen
Copy link
Contributor

@estensen estensen commented Sep 8, 2024

Currently working from a Mac Mini with not so much internal storage, so using an external m.2 NVMe to store generated artifacts.

On main:

❯ make update-book-cli
cargo build --bin reth --features "jemalloc asm-keccak"
   Compiling reth-node-core v1.0.6 (/Users/estensen/Developer/reth/crates/node/core)
   Compiling reth-exex v1.0.6 (/Users/estensen/Developer/reth/crates/exex/exex)
   Compiling reth-rpc-builder v1.0.6 (/Users/estensen/Developer/reth/crates/rpc/rpc-builder)
   Compiling reth-stages v1.0.6 (/Users/estensen/Developer/reth/crates/stages/stages)
   Compiling reth-consensus-debug-client v1.0.6 (/Users/estensen/Developer/reth/crates/consensus/debug-client)
   Compiling reth-node-events v1.0.6 (/Users/estensen/Developer/reth/crates/node/events)
   Compiling reth-node-builder v1.0.6 (/Users/estensen/Developer/reth/crates/node/builder)
   Compiling reth-cli-commands v1.0.6 (/Users/estensen/Developer/reth/crates/cli/commands)
   Compiling reth-node-ethereum v1.0.6 (/Users/estensen/Developer/reth/crates/ethereum/node)
   Compiling reth v1.0.6 (/Users/estensen/Developer/reth/bin/reth)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 58.58s
Updating book cli doc...
Running: $ ./book/cli/help.rs --root-dir ./book/ --root-indentation 2 --root-summary --out-dir ./book/cli/ target/debug/reth
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s
     Running `/Volumes/WD_BLACK_SN750_2TB/target/debug/help --root-dir ./book/ --root-indentation 2 --root-summary --out-dir ./book/cli/ target/debug/reth`
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
make: *** [update-book-cli] Error 1

this pr:

❯ make update-book-cli
cargo build --bin reth --features "jemalloc asm-keccak"
   Compiling reth-node-core v1.0.6 (/Users/estensen/Developer/reth/crates/node/core)
   Compiling reth-exex v1.0.6 (/Users/estensen/Developer/reth/crates/exex/exex)
   Compiling reth-rpc-builder v1.0.6 (/Users/estensen/Developer/reth/crates/rpc/rpc-builder)
   Compiling reth-stages v1.0.6 (/Users/estensen/Developer/reth/crates/stages/stages)
   Compiling reth-consensus-debug-client v1.0.6 (/Users/estensen/Developer/reth/crates/consensus/debug-client)
   Compiling reth-node-events v1.0.6 (/Users/estensen/Developer/reth/crates/node/events)
   Compiling reth-node-builder v1.0.6 (/Users/estensen/Developer/reth/crates/node/builder)
   Compiling reth-cli-commands v1.0.6 (/Users/estensen/Developer/reth/crates/cli/commands)
   Compiling reth-node-ethereum v1.0.6 (/Users/estensen/Developer/reth/crates/ethereum/node)
   Compiling reth v1.0.6 (/Users/estensen/Developer/reth/bin/reth)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.56s
Updating book cli doc...
Running: $ ./book/cli/help.rs --root-dir ./book/ --root-indentation 2 --root-summary --out-dir ./book/cli/ /Volumes/WD_BLACK_SN750_2TB/target/debug/reth
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s
     Running `/Volumes/WD_BLACK_SN750_2TB/target/debug/help --root-dir ./book/ --root-indentation 2 --root-summary --out-dir ./book/cli/ /Volumes/WD_BLACK_SN750_2TB/target/debug/reth`

@estensen estensen requested a review from gakonst as a code owner September 8, 2024 12:05
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

does this work w/o CARGO_TARGET_DIR set?

@estensen
Copy link
Contributor Author

does this work w/o CARGO_TARGET_DIR set?

Now it should for for both cases

@estensen estensen requested a review from onbjerg September 11, 2024 10:11
Makefile Outdated
@@ -8,7 +8,7 @@ MDBX_PATH = "crates/storage/libmdbx-rs/mdbx-sys/libmdbx"
DB_TOOLS_DIR = "db-tools"
FULL_DB_TOOLS_DIR := $(shell pwd)/$(DB_TOOLS_DIR)/

BUILD_PATH = "target"
BUILD_PATH := $(if $(CARGO_TARGET_DIR),$(CARGO_TARGET_DIR),target)
Copy link
Collaborator

Choose a reason for hiding this comment

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

a simple

Suggested change
BUILD_PATH := $(if $(CARGO_TARGET_DIR),$(CARGO_TARGET_DIR),target)
CARGO_TARGET_DIR ?= target

should do, and then replace the BUILD_PATH with CARGO_TARGET_DIR everywhere below

@shekhirin shekhirin added the A-meta Changes in the contributor workflow and planning label Sep 11, 2024
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

tysm for this!

@onbjerg onbjerg added this pull request to the merge queue Sep 18, 2024
Merged via the queue into paradigmxyz:main with commit 1f64235 Sep 18, 2024
35 checks passed
@estensen estensen deleted the book-target branch September 19, 2024 06:23
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.

3 participants