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

Re: [PATCH v2 2/5] libgit-sys: add symlink to git repo root and build out of tree

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 31, 2025, 14:52 UTC
Message-ID
<71a48992-b2f2-fb4e-b5c0-1f7f5dd31353@gmx.de>
In-Reply-To
<xnjgoym6makh7q64sp5efvkmcubslklkjeidja45rtl2wjm4jd@xfww2a52hj34>
Hi Josh,
On Thu, 27 Mar 2025, Josh Steadmon wrote:
Show 46 quoted lines
> On 2025.03.25 16:08, Junio C Hamano wrote:
> > Josh Steadmon <steadmon@google.com> writes:
> >
> > > 2) keeping the top-level clean of any Rust code or configuration.
> > >
> > > If we're willing to have a Cargo.toml file in the repo root, ...
> >
> > If it is more like adding a new build configuration file whereever
> > we have Makefile (or meson.build), and is not like we are adding one
> > new file per one existing source file, then I see no reason why we
> > want to avoid adding a few files to the root-level.
> >
> > > ... we could
> > > create a "Cargo workspace", but I'm not sure yet if that avoids the same
> > > problem with accessing sources outside of the crates themselves. I'll be
> > > able to test it out later this week.
> >
> > Yeah, that would probably be a reasonable thing to try.  Thanks.
> >
> >
> > > If the workspace approach doesn't work, the alternatives are:
> > >
> > > 1) avoid the issue for now; anyone who wants to experiment with
> > > libgit-rs can do so by building from source (but it will prevent them
> > > from creating their own packaged crates IIUC).
> > >
> > > 2) move libgit-sys and libgit-rs to separate repos and depend on the Git
> > > source via submodules. This is what I've seen done in other -sys crates
> > > such as zlib-sys (https://github.com/rust-lang/libz-sys).
> > >
> > > Of those alternatives, I prefer #1 for now. If we build enough momentum
> > > on libification and expanding the coverage of these crates, then we
> > > could think about switching to #2.
> >
> > Yeah, or putting it another way, #1 would help us gather enough Rust
> > minded folks who are familiar enough to come up with ideas and offer
> > better ways to manage this part of the system.
> >
> > Thanks.
>
> Unfortunately creating a workspace doesn't provide access to the
> top-level source. Symlinks seem to be the only recommended approach [1]
> for embedded crates, but since that breaks Windows CI let's just drop
> the series for now.
>
> [1] https://users.rust-lang.org/t/including-files-from-parent-directory-in-package/88969

If you need symbolic linkson Windows in CI, please set `MSYS=winsymlinks:nativestrict` like it is done here: https://github.com/git-for-windows/git/blob/4ca71ba5311a8f1bafbf002e97e076f15dcfc15b/t/t2040-checkout-symlink-attr.sh#L8-L10.

It might fail, though, if it requires _Git_ to be able to create symbolic links because I have not yet managed to upstream the patches to implement that.

We could fast-track support for `readlink()` without the other parts (https://github.com/git-for-windows/git/commit/86420a1b84d1), but last time I checked, Git's test suite did not pass under `MSYS=winsymlinks:nativestrict` for some reasons I was unable to analyze for lack of time.

Ciao, Johannes

Previous: Junio C HamanoNext: Josh Steadmon
Message 18 of 21 in “Fix `cargo package` for libgit-sys”
  1. 0/4 Fix `cargo package` for libgit-sysJosh Steadmon, Mar 18, 2025
  2. 1/4 libgitpub: move to separate contrib/ directoryJosh Steadmon, Mar 18, 2025
  3. 2/4 libgit-sys: add symlink to git repo root and clean after buildJosh Steadmon, Mar 18, 2025
  4. Josh SteadmonMar 19, 2025
  5. Phillip WoodMar 20, 2025
  6. Josh SteadmonMar 21, 2025
  7. 3/4 libgit-sys: parallelize build with Cargo's jobserverJosh Steadmon, Mar 18, 2025
  8. 4/4 libgit-sys: exclude unnecessary directories in git-srcJosh Steadmon, Mar 18, 2025
  9. 0/5 Fix `cargo package` for libgit-sysJosh Steadmon, Mar 21, 2025
  10. 1/5 libgitpub: move to separate contrib/ directoryJosh Steadmon, Mar 21, 2025
  11. 2/5 libgit-sys: add symlink to git repo root and build out of treeJosh Steadmon, Mar 21, 2025
  12. Eric SunshineMar 23, 2025
  13. Junio C HamanoMar 24, 2025
  14. Josh SteadmonMar 25, 2025
  15. Junio C HamanoMar 25, 2025
  16. Josh SteadmonMar 27, 2025
  17. Junio C HamanoMar 29, 2025
  18. Johannes SchindelinMar 31, 2025
  19. 3/5 libgit-sys: parallelize build with Cargo's jobserverJosh Steadmon, Mar 21, 2025
  20. 4/5 libgit-sys: exclude unnecessary directories in git-srcJosh Steadmon, Mar 21, 2025
  21. 5/5 libgit-{sys,rs}: add license and description fieldsJosh Steadmon, Mar 21, 2025

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.