]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/rust-balloon' into next
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Oct 2025 19:30:36 +0000 (12:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Oct 2025 19:30:36 +0000 (12:30 -0700)
Dip our toes a bit to (optionally) use Rust implemented helper
called from our C code.

* ps/rust-balloon:
  ci: enable Rust for breaking-changes jobs
  ci: convert "pedantic" job into full build with breaking changes
  BreakingChanges: announce Rust becoming mandatory
  varint: reimplement as test balloon for Rust
  varint: use explicit width for integers
  help: report on whether or not Rust is enabled
  Makefile: introduce infrastructure to build internal Rust library
  Makefile: reorder sources after includes
  meson: add infrastructure to build internal Rust library

1  2 
.gitignore
.gitlab-ci.yml
Documentation/BreakingChanges.adoc
Makefile
ci/run-build-and-tests.sh
dir.c
meson.build
read-cache.c

diff --cc .gitignore
Simple merge
diff --cc .gitlab-ci.yml
Simple merge
index a67ad4eea1adf5a34125cf1038c8f5ba61d89444,c21f9021343feab075ebcc6acde6ea3b411e23aa..90b53abcea28f9d4ecfea46f7cf9e1120188fc38
@@@ -165,12 -165,51 +165,57 @@@ A prerequisite for this change is that 
  "reftable" format. Most importantly, alternative implementations of Git like
  JGit, libgit2 and Gitoxide need to support it.
  
 +* In new repositories, the default branch name will be `main`. We have been
 +  warning that the default name will change since 675704c74dd (init:
 +  provide useful advice about init.defaultBranch, 2020-12-11).  The new name
 +  matches the default branch name used in new repositories by many of the
 +  big Git forges.
 +
+ * Git will require Rust as a mandatory part of the build process. While Git
+   already started to adopt Rust in Git 2.49, all parts written in Rust are
+   optional for the time being. This includes:
+ +
+   ** The Rust wrapper around libgit.a that is part of "contrib/" and which has
+      been introduced in Git 2.49.
+   ** Subsystems that have an alternative implementation in Rust to test
+      interoperability between our C and Rust codebase.
+   ** Newly written features that are not mission critical for a fully functional
+      Git client.
+ +
+ These changes are meant as test balloons to allow distributors of Git to prepare
+ for Rust becoming a mandatory part of the build process. There will be multiple
+ milestones for the introduction of Rust:
+ +
+ --
+ 1. Initially, with Git 2.52, support for Rust will be auto-detected by Meson and
+    disabled in our Makefile so that the project can sort out the initial
+    infrastructure.
+ 2. In Git 2.53, both build systems will default-enable support for Rust.
+    Consequently, builds will break by default if Rust is not available on the
+    build host. The use of Rust can still be explicitly disabled via build
+    flags.
+ 3. In Git 3.0, the build options will be removed and support for Rust is
+    mandatory.
+ --
+ +
+ You can explicitly ask both Meson and our Makefile-based system to enable Rust
+ by saying `meson configure -Drust=enabled` and `make WITH_RUST=YesPlease`,
+ respectively.
+ +
+ The Git project will declare the last version before Git 3.0 to be a long-term
+ support release. This long-term release will receive important bug fixes for at
+ least four release cycles and security fixes for six release cycles. The Git
+ project will hand over maintainership of the long-term release to distributors
+ in case they need to extend the life of that long-term release even further.
+ Details of how this long-term release will be handed over to the community will
+ be discussed once the Git project decides to stop officially supporting it.
+ +
+ We will evaluate the impact on downstream distributions before making Rust
+ mandatory in Git 3.0. If we see that the impact on downstream distributions
+ would be significant, we may decide to defer this change to a subsequent minor
+ release. This evaluation will also take into account our own experience with
+ how painful it is to keep Rust an optional component.
  === Removals
  
  * Support for grafting commits has long been superseded by git-replace(1).
diff --cc Makefile
Simple merge
index a21834043f3b858b6220a510a3db7941a722a7d1,c718bd101aa8bbd760c41b485d9c4d9d5291dc65..8bda62b921920f37dc570681696dac089c871f3e
@@@ -5,11 -5,13 +5,12 @@@
  
  . ${0%/*}/lib.sh
  
- run_tests=t
  case "$jobname" in
- linux-breaking-changes)
fedora-breaking-changes-musl|linux-breaking-changes)
 -      export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
        export WITH_BREAKING_CHANGES=YesPlease
+       export WITH_RUST=YesPlease
+       MESONFLAGS="$MESONFLAGS -Dbreaking_changes=true"
+       MESONFLAGS="$MESONFLAGS -Drust=enabled"
        ;;
  linux-TEST-vars)
        export OPENSSL_SHA1_UNSAFE=YesPlease
diff --cc dir.c
Simple merge
diff --cc meson.build
Simple merge
diff --cc read-cache.c
Simple merge