Skip to content

git: fix broken build#69

Open
tc-agent wants to merge 2 commits into
masterfrom
fix-broken-build
Open

git: fix broken build#69
tc-agent wants to merge 2 commits into
masterfrom
fix-broken-build

Conversation

@tc-agent

Copy link
Copy Markdown
Owner

Summary

The OSS-Fuzz git build has been failing since the day after the last
successful build on 2026-05-10
,
which lines up with bd5c2827b2
(merge of bc/rust-by-default)
landing in upstream master on 2026-05-11. From that commit onward, the
Makefile builds Rust by default, providing
encode_varint/decode_varint (formerly in varint.c) via the
appended Rust static library:

LIB_OBJS += utf8.o
ifdef NO_RUST
LIB_OBJS += varint.o
endififndef NO_RUST
BASIC_CFLAGS += -DWITH_RUST
GITLIBS += $(RUST_LIB)

This project's build.sh overrides GITLIBS=libgit.a (to drop
common-main.o, whose main() would shadow the fuzzing engine's),
which silently drops the Rust library and leaves
encode_varint/decode_varint undefined at link time:

libgit.a(dir.o): in function `write_untracked_extension':
dir.c:(...): undefined reference to `encode_varint'
libgit.a(read-cache.o): in function `load_cache_entry_block':
read-cache.c:(...): undefined reference to `decode_varint'

Passing NO_RUST=YesPlease to make selects the still-supported C
implementation path (varint.o rejoins LIB_OBJS under that flag),
so the existing GITLIBS=libgit.a override stays self-contained.
This is the lightest fix that keeps the existing structure of
build.sh intact; the alternative — teaching build.sh how to invoke
cargo and append $(RUST_LIB) to the link — is significantly more
invasive.

Coverage

The 8 in-tree harnesses link again and run for the full 5 minutes of
fuzz_for_pr, producing combined line coverage comparable to the
pre-regression Fuzz Introspector
baseline

(1.98% lines, 2,514/126,869, from the
2026-05-10 OSS-Fuzz coverage report).
No coverage regression is introduced.

Test plan

  • Local build with this change links cleanly; the 8 in-tree
    harnesses produce a working $OUT/fuzz-* binary.
  • CI passes on this PR.

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

Fuzzing Coverage Report

Tested: project git · base 766921e → head 4e0502c · 300s total fuzz budget · updated 2026-05-27 18:46 UTC · workflow run

Metric Before After Delta
Static reachability >45m >45m
Line coverage 0% 1.5% (1935/127674) new
Branch coverage 0% 1.5% (970/65743) new
Function coverage 0% 2.1% (145/7034) new

Per-harness

Harness Lines before Lines after Δ
fuzz-commit-graph 0% 0.0% (0/126758)
fuzz-config 0% 0.4% (502/126757) new
fuzz-credential-from-url-gently 0% 0.2% (242/127563) new
fuzz-date 0% 0.7% (910/126773) new
fuzz-pack-headers 0% 0.1% (100/126752) new
fuzz-pack-idx 0% 0.0% (0/126750)
fuzz-parse-attr-line 0% 0.4% (539/126769) new
fuzz-url-decode-mem 0% 0.1% (154/126767) new

Δ = (after − before) / before, to accommodate that denominators may change. "new" when before is 0; "deleted" when after is 0.

@tc-agent
tc-agent force-pushed the fix-broken-build branch from 287f509 to 4e0502c Compare May 27, 2026 16:43
@tc-agent
tc-agent force-pushed the master branch 6 times, most recently from af7f9a7 to 806b281 Compare May 28, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant