]> git.99rst.org Git - git.git/commit
Makefile: add $(RUST_LIB) prerequisite to osxkeychain
authorShardul Natu <redacted>
Wed, 8 Jul 2026 03:21:17 +0000 (03:21 +0000)
committerJunio C Hamano <redacted>
Wed, 8 Jul 2026 04:58:54 +0000 (21:58 -0700)
commit87bd9bd40ee6e7f9fb80686e2d7526c524add195
tree6386ccebb0d591be5a00393508bd17ce5e015ac0
parente9019fcafe0040228b8631c30f97ae1adb61bcdc
Makefile: add $(RUST_LIB) prerequisite to osxkeychain

When Rust is enabled, the git-credential-osxkeychain helper depends on
Rust symbols compiled into $(RUST_LIB). While commit 522ea8ef7d
("osxkeychain: fix build with Rust") updated the linker command line to
use $(LIBS), it omitted $(RUST_LIB) from the target prerequisite list.
Without this prerequisite, running a parallel build ("make -j") from a
clean working tree can fail because Make does not know to invoke Cargo
to build libgitcore.a before linking git-credential-osxkeychain.

Note that we depend explicitly on $(LIB_FILE) and $(RUST_LIB) rather
than $(GITLIBS). Unlike standard Git builtins and programs like scalar
(which define cmd_main() and rely on common-main.o to supply main()),
git-credential-osxkeychain.c defines its own standalone int main().
If $(GITLIBS) were used, $(filter %.o,$^) in the link recipe would
match both git-credential-osxkeychain.o and common-main.o, causing a
duplicate symbol linking error for _main on macOS.

Additionally, wrap the definitions of $(RUST_LIB) and the "rust" build
target in "ifndef NO_RUST". This ensures that when NO_RUST=1 is
specified, $(RUST_LIB) evaluates to empty, making the Rust dependency a
clean no-op without needing intermediate variables.

Signed-off-by: Shardul Natu <redacted>
Signed-off-by: Junio C Hamano <redacted>
Makefile
git clone https://git.99rst.org/PROJECT