git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug: Makefile ignores CARGO_TARGET_DIR

From
Todd Zullinger <tmz@pobox.com>
Date
Jul 28, 2026, 18:01 UTC
Message-ID
<20260728180138.6TN1pzgr@teonanacatl.net>
In-Reply-To
<CAJPQ5NbTLnbe_VU1awCVggw5m9kGdBZssrZBp8G0YxcMjb_rwA@mail.gmail.com>
William Pursell wrote:
Show 7 quoted lines
> The Makefile hardcodes the path to the Rust static library at line
> 962, but the cargo invocation at line 3036 does not override
> CARGO_TARGET_DIR. (line numbers are relative to 9a0c4701)
> 
> When CARGO_TARGET_DIR is set in the environment, the link step fails:
> 
> clang: error: no such file or directory: 'target/release/libgitcore.a'

If the fix simply to add `--target $*` as is used a few lines below in RUST_MEMBER_LIBS, e.g.:

diff --git i/Makefile w/Makefile
index 98e995e4be..fa6e4b2702 100644
--- i/Makefile
+++ w/Makefile
@@ -3034,7 +3034,7 @@ $(LIB_FILE): $(LIB_OBJS)
 ifndef NO_RUST
 ifeq ($(RUST_TARGETS),)
 $(RUST_LIB): Cargo.toml $(RUST_SOURCES) $(LIB_FILE)
-	$(QUIET_CARGO)cargo build $(CARGO_ARGS)
+	$(QUIET_CARGO)cargo build $(CARGO_ARGS) --target $*
 else
 ifneq ($(words $(RUST_TARGETS)),1)
 ifneq ($(uname_S),Darwin)

Does this also affect the `cargo build` calls in the
libgit-sys and libgit-rs make targets (~lines 4090 and
4092)?
-- 
Todd
Previous: William Pursell
Message 2 of 2 in “Bug: Makefile ignores CARGO_TARGET_DIR”
  1. William PursellJul 28, 2026
  2. Todd ZullingerJul 28, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.