GramEditor/gram
37
982
Fork
You've already forked gram
88

What is the plan with the libgit2 fork? #331

Closed
opened 2026年06月09日 11:19:08 +02:00 by alerque · 10 comments
Contributor
Copy link

Attempting to bump the Arch Linux package to the latest 2.2.0 release ran into build errors. The culprit seems to be a new requirement on a non-standard libgit2. By default and whenever possible Arch Linux packages are built against system libs, so hitherto the Gram package has been linked to the system shared libgit2.so module.

warning: libgit2-sys@0.18.4+1.9.3: failed to probe system libgit2-experimental:
error: failed to run custom build command for `libgit2-sys v0.18.4+1.9.3`
Caused by:
 process didn't exit successfully: `/build/gram/src/gram/target/release/build/libgit2-sys-750a3abf7867df23/build-script-build` (exit status: 101)
 --- stdout
 cargo:rustc-check-cfg=cfg(libgit2_vendored,libgit2_experimental_sha256,)
 cargo:rerun-if-env-changed=LIBGIT2_NO_VENDOR
 cargo:rerun-if-env-changed=LIBGIT2_EXPERIMENTAL_NO_PKG_CONFIG
 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
 cargo:rerun-if-env-changed=HOST_PKG_CONFIG
 cargo:rerun-if-env-changed=PKG_CONFIG
 cargo:rerun-if-env-changed=LIBGIT2_EXPERIMENTAL_STATIC
 cargo:rerun-if-env-changed=LIBGIT2_EXPERIMENTAL_DYNAMIC
 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
 cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
 cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
 cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
 cargo:rerun-if-env-changed=PKG_CONFIG_PATH
 cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
 cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
 cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
 cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
 cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
 cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
 cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
 cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
 cargo:warning=failed to probe system libgit2-experimental:
 pkg-config exited with status code 1
 > PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libgit2-experimental 'libgit2-experimental >= 1.9.3' 'libgit2-experimental < 1.10.0'
 pkg-config output:
 Package libgit2-experimental was not found in the pkg-config search path.
 Perhaps you should add the directory containing `libgit2-experimental.pc'
 to the PKG_CONFIG_PATH environment variable
 Package 'libgit2-experimental' not found
 Package 'libgit2-experimental' not found
 Package 'libgit2-experimental' not found
 The system library `libgit2-experimental` required by crate `libgit2-sys` was not found.
 The file `libgit2-experimental.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
 The PKG_CONFIG_PATH environment variable is not set.
 HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libgit2-experimental.pc`.
 --- stderr
 thread 'main' (12842) panicked at /build/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libgit2-sys-0.18.4+1.9.3/build.rs:100:13:
 The environment variable `LIBGIT2_NO_VENDOR` has been set but no compatible system libgit2 could be found.
 The build is now aborting. To disable, unset the variable or use `LIBGIT2_NO_VENDOR=0`.

I haven't looked into what libgit2-experimental –is this an unreleased upstream development line, a 3rd party fork, or a fork run by this project?– but regardless of the answer to that question my question is what is the plan for this project? Is this going to be a long term thing? Is this a short term fix until something lands in the upstream releases? Is vendoring this going to be the only packaging option we have?

Attempting to bump the Arch Linux package to the latest 2.2.0 release ran into build errors. The culprit seems to be a new requirement on a non-standard libgit2. By default and whenever possible Arch Linux packages are built against system libs, so hitherto the Gram package has been linked to the system shared `libgit2.so` module. ``` warning: libgit2-sys@0.18.4+1.9.3: failed to probe system libgit2-experimental: error: failed to run custom build command for `libgit2-sys v0.18.4+1.9.3` Caused by: process didn't exit successfully: `/build/gram/src/gram/target/release/build/libgit2-sys-750a3abf7867df23/build-script-build` (exit status: 101) --- stdout cargo:rustc-check-cfg=cfg(libgit2_vendored,libgit2_experimental_sha256,) cargo:rerun-if-env-changed=LIBGIT2_NO_VENDOR cargo:rerun-if-env-changed=LIBGIT2_EXPERIMENTAL_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=LIBGIT2_EXPERIMENTAL_STATIC cargo:rerun-if-env-changed=LIBGIT2_EXPERIMENTAL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:warning=failed to probe system libgit2-experimental: pkg-config exited with status code 1 > PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libgit2-experimental 'libgit2-experimental >= 1.9.3' 'libgit2-experimental < 1.10.0' pkg-config output: Package libgit2-experimental was not found in the pkg-config search path. Perhaps you should add the directory containing `libgit2-experimental.pc' to the PKG_CONFIG_PATH environment variable Package 'libgit2-experimental' not found Package 'libgit2-experimental' not found Package 'libgit2-experimental' not found The system library `libgit2-experimental` required by crate `libgit2-sys` was not found. The file `libgit2-experimental.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory. The PKG_CONFIG_PATH environment variable is not set. HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libgit2-experimental.pc`. --- stderr thread 'main' (12842) panicked at /build/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libgit2-sys-0.18.4+1.9.3/build.rs:100:13: The environment variable `LIBGIT2_NO_VENDOR` has been set but no compatible system libgit2 could be found. The build is now aborting. To disable, unset the variable or use `LIBGIT2_NO_VENDOR=0`. ``` I haven't looked into what `libgit2-experimental` –is this an unreleased upstream development line, a 3rd party fork, or a fork run by this project?– but regardless of the answer to that question my question is what is the plan for this project? Is this going to be a long term thing? Is this a short term fix until something lands in the upstream releases? Is vendoring this going to be the only packaging option we have?
Owner
Copy link

This was pulled in to add SHA-256 support for git repositories. The easiest short-term fix for Arch Linux may be to revert the SHA-256 support patch although it would be a shame to lose that support.

Long term I expect the upstream project to release a version with the necessary support, so that this no longer needs to use experimental APIs.

This was pulled in to add SHA-256 support for git repositories. The easiest short-term fix for Arch Linux may be to revert the SHA-256 support patch although it would be a shame to lose that support. Long term I expect the upstream project to release a version with the necessary support, so that this no longer needs to use experimental APIs.
Owner
Copy link

The relevant commit is this one:

735554dde7

The relevant commit is this one: https://codeberg.org/GramEditor/gram/commit/735554dde7f2605079688c06a86f9eaf024665e6
Owner
Copy link
Relevant PR in `git2-rs`: https://github.com/rust-lang/git2-rs/pull/1206
Author
Contributor
Copy link

@krig wrote in #331 (comment):

Long term I expect the upstream project to release a version with the necessary support, so that this no longer needs to use experimental APIs.

Thanks for the background and links and how it applies to Gram. I'll look into what we can do.

@krig wrote in https://codeberg.org/GramEditor/gram/issues/331#issuecomment-17112101: > Long term I expect the upstream project to release a version with the necessary support, so that this no longer needs to use experimental APIs. Thanks for the background and links and how it applies to Gram. I'll look into what we can do.
Owner
Copy link

@alerque I have gotten rid of the libgit2 dependency in main now, but I'm not ready to tag a release yet. Will update this issue when I do.

@alerque I have gotten rid of the libgit2 dependency in main now, but I'm not ready to tag a release yet. Will update this issue when I do.

https://github.com/rust-lang/git2-rs/pull/1283

this + libgit2-experimental files and build is successful

https://github.com/rust-lang/git2-rs/pull/1283 this + libgit2-experimental files and build is successful

based on zed#53453, this is no longer required...

based on zed#53453, this is no longer required...
Owner
Copy link

The main branch of gram has also removed the git2 dependency yeah

The main branch of gram has also removed the git2 dependency yeah
Author
Contributor
Copy link

Well that's a plan then. I'm not sure I support the move to more CLI tooling dependency honestly, but that's on Zed not Gram. I understand (better than most) that libgit2 in particular has some shortcomings.

Well that's a plan then. I'm not sure I support the move to *more* CLI tooling dependency honestly, but that's on Zed not Gram. I understand (better than most) that libgit2 in particular has some shortcomings.
Owner
Copy link

@alerque I suspect that there's always going to be some things that can only be supported via the CLI, but yeah.. it's debatable. Nothing is set in stone, of course.

@alerque I suspect that there's always going to be some things that can only be supported via the CLI, but yeah.. it's debatable. Nothing is set in stone, of course.
Sign in to join this conversation.
main
main
test/wgpu-on-mac
test-ci/failing-test-mac
test/failing-test-mac
test/build-on-22-04
test/wgpu-present-mode-mailbox
v2.1
test/altgr-fix-again
test/2.0.0-rc1
test/linux-build
test/objc2
v1.2.1
3.0.1
3.0.0
2.2.0
2.1.2
2.1.1
2.1.0
2.0.0
1.2.1
1.2.0
1.1.0
1.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
GramEditor/gram#331
Reference in a new issue
GramEditor/gram
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?