{"thread":{"id":"65822","subject":"[PATCH] osxkeychain: fix build with Rust","startedAt":"2026-06-17T10:11:17Z","lastAt":"2026-06-18T06:30:44Z","messageCount":3,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"545745","messageId":"pull.2154.git.1781691074710.gitgitgadget@gmail.com","threadId":"65822","inReplyTo":null,"subject":"[PATCH] osxkeychain: fix build with Rust","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-06-17T10:11:13Z","receivedAt":"2026-06-17T10:11:17Z","isPatch":true,"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWithout NO_RUST defined, the varint encoder/decoder lives in the\nRUST_LIB, which needs to be linked. Symptom:\n\ncc [... -o contrib/credential/osxkeychain/git-credential-osxkeychain [...]\nUndefined symbols for architecture x86_64:\n  \"_decode_varint\", referenced from:\n      _read_untracked_extension in libgit.a[x86_64][63](dir.o)\n      _read_untracked_extension in libgit.a[x86_64][63](dir.o)\n      _read_one_dir in libgit.a[x86_64][63](dir.o)\n      _read_one_dir in libgit.a[x86_64][63](dir.o)\n      _load_cache_entry_block in libgit.a[x86_64][174](read-cache.o)\n  \"_encode_varint\", referenced from:\n      _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n      _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n      _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n      _write_one_dir in libgit.a[x86_64][63](dir.o)\n      _write_one_dir in libgit.a[x86_64][63](dir.o)\n      _do_write_index in libgit.a[x86_64][174](read-cache.o)\nld: symbol(s) not found for architecture x86_64\n\nWhile it is curious why these functions are needed at all (osxkeychain\ndoes not read or write the index), the compile error is a real problem.\n\nInstead of trying to play games to add `GITLIBS` while filtering out\n`common-main.o`, replace the `$(LIB_FILE) $(EXTLIBS)` construct with the\nmuch shorter `$(LIBS)` construct that _already_ filters out\n`common-main.o` and adds the Rust library when needed.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    osxkeychain: fix build with Rust\n    \n    I ran into this when trying to build Microsoft Git v2.55.0-rc0. This\n    seems to be similar in spirit to\n    https://lore.kernel.org/git/pull.2288.git.git.1778001976709.gitgitgadget@gmail.com/\n    but the latter seems not to have gained traction. This build failure is\n    a hard regression in v2.55.0, though.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2154%2Fdscho%2Fosxkeychain-vs-rust-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2154/dscho/osxkeychain-vs-rust-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2154\n\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 0976a69b4c..1cec251f43 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -4074,7 +4074,7 @@ contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)\n \n contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \\\n-\t\t$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation\n+\t\t$(filter %.o,$^) $(LIBS) -framework Security -framework CoreFoundation\n \n contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS\n \t$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<\n\nbase-commit: 0fae78c9d55efe705877ea537fe42c59164ccd94\n-- \ngitgitgadget\n"},{"id":"545758","messageId":"xmqq8q8d1ixq.fsf@gitster.g","threadId":"65822","inReplyTo":"pull.2154.git.1781691074710.gitgitgadget@gmail.com","subject":"Re: [PATCH] osxkeychain: fix build with Rust","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-06-17T11:54:09Z","receivedAt":"2026-06-17T11:54:12Z","isPatch":true,"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> Without NO_RUST defined, the varint encoder/decoder lives in the\n> RUST_LIB, which needs to be linked. Symptom:\n>\n> cc [... -o contrib/credential/osxkeychain/git-credential-osxkeychain [...]\n> Undefined symbols for architecture x86_64:\n>   \"_decode_varint\", referenced from:\n>       _read_untracked_extension in libgit.a[x86_64][63](dir.o)\n>       _read_untracked_extension in libgit.a[x86_64][63](dir.o)\n>       _read_one_dir in libgit.a[x86_64][63](dir.o)\n>       _read_one_dir in libgit.a[x86_64][63](dir.o)\n>       _load_cache_entry_block in libgit.a[x86_64][174](read-cache.o)\n>   \"_encode_varint\", referenced from:\n>       _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n>       _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n>       _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n>       _write_one_dir in libgit.a[x86_64][63](dir.o)\n>       _write_one_dir in libgit.a[x86_64][63](dir.o)\n>       _do_write_index in libgit.a[x86_64][174](read-cache.o)\n> ld: symbol(s) not found for architecture x86_64\n>\n> While it is curious why these functions are needed at all (osxkeychain\n> does not read or write the index), the compile error is a real problem.\n>\n> Instead of trying to play games to add `GITLIBS` while filtering out\n> `common-main.o`, replace the `$(LIB_FILE) $(EXTLIBS)` construct with the\n> much shorter `$(LIBS)` construct that _already_ filters out\n> `common-main.o` and adds the Rust library when needed.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n\nHmph, we do not build this at GitHub Actions based CI?  Just being\ncurious.\n\nLet me take this directly to 'master' before tagging -rc1.  Thanks.\n\n>     osxkeychain: fix build with Rust\n"},{"id":"545815","messageId":"ajOQjfLXQwdEB6Hl@pks.im","threadId":"65822","inReplyTo":"xmqq8q8d1ixq.fsf@gitster.g","subject":"Re: [PATCH] osxkeychain: fix build with Rust","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-06-18T06:30:37Z","receivedAt":"2026-06-18T06:30:44Z","isPatch":true,"body":"On Wed, Jun 17, 2026 at 04:54:09AM -0700, Junio C Hamano wrote:\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n> \n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > Without NO_RUST defined, the varint encoder/decoder lives in the\n> > RUST_LIB, which needs to be linked. Symptom:\n> >\n> > cc [... -o contrib/credential/osxkeychain/git-credential-osxkeychain [...]\n> > Undefined symbols for architecture x86_64:\n> >   \"_decode_varint\", referenced from:\n> >       _read_untracked_extension in libgit.a[x86_64][63](dir.o)\n> >       _read_untracked_extension in libgit.a[x86_64][63](dir.o)\n> >       _read_one_dir in libgit.a[x86_64][63](dir.o)\n> >       _read_one_dir in libgit.a[x86_64][63](dir.o)\n> >       _load_cache_entry_block in libgit.a[x86_64][174](read-cache.o)\n> >   \"_encode_varint\", referenced from:\n> >       _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n> >       _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n> >       _write_untracked_extension in libgit.a[x86_64][63](dir.o)\n> >       _write_one_dir in libgit.a[x86_64][63](dir.o)\n> >       _write_one_dir in libgit.a[x86_64][63](dir.o)\n> >       _do_write_index in libgit.a[x86_64][174](read-cache.o)\n> > ld: symbol(s) not found for architecture x86_64\n> >\n> > While it is curious why these functions are needed at all (osxkeychain\n> > does not read or write the index), the compile error is a real problem.\n> >\n> > Instead of trying to play games to add `GITLIBS` while filtering out\n> > `common-main.o`, replace the `$(LIB_FILE) $(EXTLIBS)` construct with the\n> > much shorter `$(LIBS)` construct that _already_ filters out\n> > `common-main.o` and adds the Rust library when needed.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> \n> Hmph, we do not build this at GitHub Actions based CI?  Just being\n> curious.\n\nWe build it with Meson, but not with our Makefile. And in Meson things\nare working alright.\n\n> Let me take this directly to 'master' before tagging -rc1.  Thanks.\n\nMakes sense.\n\nPatrick\n"}]}