Skip to content

Commit 9f00115

Browse files
committed
Merge branch 'bc/rust-by-default-in-2.54' into seen
Rust support is enabled by default (but still allows opting out) in Git 2.54. * bc/rust-by-default-in-2.54: Enable Rust by default Linux: link against libdl ci: install cargo on Alpine docs: update version with default Rust support
2 parents ff5ddca + 4340799 commit 9f00115

File tree

8 files changed

+14
-10
lines changed

8 files changed

+14
-10
lines changed

Documentation/BreakingChanges.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ milestones for the introduction of Rust:
190190
1. Initially, with Git 2.52, support for Rust will be auto-detected by Meson and
191191
disabled in our Makefile so that the project can sort out the initial
192192
infrastructure.
193-
2. In Git 2.53, both build systems will default-enable support for Rust.
193+
2. In Git 2.54, both build systems will default-enable support for Rust.
194194
Consequently, builds will break by default if Rust is not available on the
195195
build host. The use of Rust can still be explicitly disabled via build
196196
flags.

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,9 @@ include shared.mak
498498
#
499499
# == Optional Rust support ==
500500
#
501-
# Define WITH_RUST if you want to include features and subsystems written in
502-
# Rust into Git. For now, Rust is still an optional feature of the build
503-
# process. With Git 3.0 though, Rust will always be enabled.
501+
# Define NO_RUST if you want to disable features and subsystems written in Rust
502+
# from being compiled into Git. For now, Rust is still an optional feature of
503+
# the build process. With Git 3.0 though, Rust will always be enabled.
504504
#
505505
# Building Rust code requires Cargo.
506506
#
@@ -1353,7 +1353,7 @@ LIB_OBJS += urlmatch.o
13531353
LIB_OBJS += usage.o
13541354
LIB_OBJS += userdiff.o
13551355
LIB_OBJS += utf8.o
1356-
ifndef WITH_RUST
1356+
ifdef NO_RUST
13571357
LIB_OBJS += varint.o
13581358
endif
13591359
LIB_OBJS += version.o
@@ -1592,7 +1592,7 @@ endif
15921592
ALL_CFLAGS = $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_APPEND)
15931593
ALL_LDFLAGS = $(LDFLAGS) $(LDFLAGS_APPEND)
15941594

1595-
ifdef WITH_RUST
1595+
ifndef NO_RUST
15961596
BASIC_CFLAGS += -DWITH_RUST
15971597
GITLIBS += $(RUST_LIB)
15981598
ifeq ($(uname_S),Windows)

ci/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ alpine-*)
2929
apk add --update shadow sudo meson ninja-build gcc libc-dev curl-dev openssl-dev expat-dev gettext \
3030
zlib-ng-dev pcre2-dev python3 musl-libintl perl-utils ncurses \
3131
apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
32-
bash cvs gnupg perl-cgi perl-dbd-sqlite perl-io-tty >/dev/null
32+
bash cvs gnupg perl-cgi perl-dbd-sqlite perl-io-tty cargo >/dev/null
3333
;;
3434
fedora-*|almalinux-*)
3535
case "$jobname" in

ci/lib.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ linux-asan-ubsan)
372372
osx-meson)
373373
MESONFLAGS="$MESONFLAGS -Dcredential_helpers=osxkeychain"
374374
;;
375+
windows-*)
376+
export NO_RUST=UnfortunatelyYes
377+
;;
375378
esac
376379

377380
MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"

ci/run-build-and-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export TEST_CONTRIB_TOO=yes
1010
case "$jobname" in
1111
fedora-breaking-changes-musl|linux-breaking-changes)
1212
export WITH_BREAKING_CHANGES=YesPlease
13-
export WITH_RUST=YesPlease
1413
MESONFLAGS="$MESONFLAGS -Dbreaking_changes=true"
1514
MESONFLAGS="$MESONFLAGS -Drust=enabled"
1615
;;
@@ -30,6 +29,7 @@ linux-TEST-vars)
3029
export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1
3130
;;
3231
linux-clang)
32+
export NO_RUST=UnfortunatelyYes
3333
export GIT_TEST_DEFAULT_HASH=sha1
3434
;;
3535
linux-sha256)

config.mak.uname

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ ifeq ($(uname_S),Linux)
6363
PROCFS_EXECUTABLE_PATH = /proc/self/exe
6464
HAVE_PLATFORM_PROCINFO = YesPlease
6565
COMPAT_OBJS += compat/linux/procinfo.o
66+
EXTLIBS += -ldl
6667
# centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7.
6768
ifneq ($(findstring .el7.,$(uname_R)),)
6869
BASIC_CFLAGS += -std=c99

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ version_def_h = custom_target(
17551755
libgit_sources += version_def_h
17561756

17571757
cargo = find_program('cargo', dirs: program_path, native: true, required: get_option('rust'))
1758-
rust_option = get_option('rust').disable_auto_if(not cargo.found())
1758+
rust_option = get_option('rust')
17591759
if rust_option.allowed()
17601760
subdir('src')
17611761
libgit_c_args += '-DWITH_RUST'

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ option('zlib_backend', type: 'combo', choices: ['auto', 'zlib', 'zlib-ng'], valu
7777
# Build tweaks.
7878
option('breaking_changes', type: 'boolean', value: false,
7979
description: 'Enable upcoming breaking changes.')
80-
option('rust', type: 'feature', value: 'auto',
80+
option('rust', type: 'feature', value: 'enabled',
8181
description: 'Enable building with Rust.')
8282
option('macos_use_homebrew_gettext', type: 'boolean', value: true,
8383
description: 'Use gettext from Homebrew instead of the slightly-broken system-provided one.')

0 commit comments

Comments
 (0)