{"thread":{"id":"66080","subject":"Bug: Makefile ignores CARGO_TARGET_DIR","startedAt":"2026-07-28T11:46:53Z","lastAt":"2026-07-28T18:01:41Z","messageCount":2,"participants":["William Pursell","Todd Zullinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"549122","messageId":"CAJPQ5NbTLnbe_VU1awCVggw5m9kGdBZssrZBp8G0YxcMjb_rwA@mail.gmail.com","threadId":"66080","inReplyTo":null,"subject":"Bug: Makefile ignores CARGO_TARGET_DIR","fromName":"William Pursell","fromEmail":"william.r.pursell@gmail.com","sentAt":"2026-07-28T11:46:40Z","receivedAt":"2026-07-28T11:46:53Z","isPatch":false,"body":"The Makefile hardcodes the path to the Rust static library at line\n962, but the cargo invocation at line 3036 does not override\nCARGO_TARGET_DIR. (line numbers are relative to 9a0c4701)\n\nWhen CARGO_TARGET_DIR is set in the environment, the link step fails:\n\nclang: error: no such file or directory: 'target/release/libgitcore.a'\n"},{"id":"549158","messageId":"20260728180138.6TN1pzgr@teonanacatl.net","threadId":"66080","inReplyTo":"CAJPQ5NbTLnbe_VU1awCVggw5m9kGdBZssrZBp8G0YxcMjb_rwA@mail.gmail.com","subject":"Re: Bug: Makefile ignores CARGO_TARGET_DIR","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2026-07-28T18:01:38Z","receivedAt":"2026-07-28T18:01:41Z","isPatch":false,"body":"William Pursell wrote:\n> The Makefile hardcodes the path to the Rust static library at line\n> 962, but the cargo invocation at line 3036 does not override\n> CARGO_TARGET_DIR. (line numbers are relative to 9a0c4701)\n> \n> When CARGO_TARGET_DIR is set in the environment, the link step fails:\n> \n> clang: error: no such file or directory: 'target/release/libgitcore.a'\n\nIf the fix simply to add `--target $*` as is used a few\nlines below in RUST_MEMBER_LIBS, e.g.:\n\ndiff --git i/Makefile w/Makefile\nindex 98e995e4be..fa6e4b2702 100644\n--- i/Makefile\n+++ w/Makefile\n@@ -3034,7 +3034,7 @@ $(LIB_FILE): $(LIB_OBJS)\n ifndef NO_RUST\n ifeq ($(RUST_TARGETS),)\n $(RUST_LIB): Cargo.toml $(RUST_SOURCES) $(LIB_FILE)\n-\t$(QUIET_CARGO)cargo build $(CARGO_ARGS)\n+\t$(QUIET_CARGO)cargo build $(CARGO_ARGS) --target $*\n else\n ifneq ($(words $(RUST_TARGETS)),1)\n ifneq ($(uname_S),Darwin)\n\nDoes this also affect the `cargo build` calls in the\nlibgit-sys and libgit-rs make targets (~lines 4090 and\n4092)?\n\n-- \nTodd\n"}]}