Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion .github/workflows/rescue-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,46 @@ jobs:
include:
- repo: "freenet:3GEERif5ihbf/freenet-core"
only_current_tips: true # snapshot mode
github_repo: "" # --from not supported in snapshot mode
- repo: "freenet:96rknpy1GYhZ/freenet-stdlib"
only_current_tips: false # history mode
github_repo: "freenet/freenet-stdlib"
- repo: "freenet:99TmCayXn6Tm/freenet-git"
only_current_tips: false # history mode (self-mirror)
github_repo: "freenet/freenet-git"
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install freenet-git from crates.io
run: cargo install freenet-git --locked

# Clone the upstream GitHub repo so rescue can reconstruct missing
# packs from local objects via `--from`. Only history-mode cells
# get a clone; snapshot-mode cells (freenet-core) skip this step
# because `--from` doesn't help with force-pushed orphan commits.
#
# The clone has to be deep enough to contain every commit the
# contract's bundle-tip extensions reference -- which can be
# arbitrarily far back in history depending on how many mirror
# pushes have accumulated. Use a full clone (no --depth) so any
# historical bundle's tip is reachable. For freenet-stdlib and
# freenet-git this is small (a few MiB); for larger history-mode
# repos in the future this should be revisited.
- name: Clone upstream for --from
if: matrix.github_repo != ''
uses: actions/checkout@v4
with:
repository: ${{ matrix.github_repo }}
path: upstream
fetch-depth: 0

- name: Rescue
env:
REPO: ${{ matrix.repo }}
WS_URL: ${{ secrets.FREENET_GIT_WS_URL }}
ONLY_CURRENT_TIPS: ${{ matrix.only_current_tips }}
GITHUB_REPO: ${{ matrix.github_repo }}
run: |
set -euo pipefail
# Probe the installed binary for --only-current-tips support
Expand Down Expand Up @@ -112,8 +136,21 @@ jobs:
# Pre-0.1.19 binary: outer loop is serial, nothing to set.
parallel_args=""
fi
# --from <git-dir> (0.1.23+) reconstructs missing pack bytes
# from a local clone when the gateway has evicted them, fixing
# the "1 bundle(s) failed to rescue: GET pack ..." class of
# failures (freenet-git#54 + associated rescue-demos rotation).
# Only history-mode cells get a clone (see matrix matrix
# `github_repo` field) -- snapshot-mode cells fall through to
# the GET-only path because `--from` can't help with force-
# pushed orphan commits whose ranges aren't recorded in
# contract metadata.
from_args=""
if [ -n "$GITHUB_REPO" ] && freenet-git rescue --help 2>&1 | grep -q -- '--from'; then
from_args="--from upstream/.git"
fi
# shellcheck disable=SC2086
freenet-git rescue "$REPO" --ws-url "$WS_URL" $extra $parallel_args
freenet-git rescue "$REPO" --ws-url "$WS_URL" $extra $parallel_args $from_args

# Per the GH-Actions failure-notification model: matrix cell
# failures show up in the run summary but do not (by default) email
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
]

[workspace.package]
version = "0.1.22"
version = "0.1.23"
edition = "2021"
rust-version = "1.86"
license = "LGPL-3.0-only"
Expand Down
9 changes: 8 additions & 1 deletion crates/freenet-git/src/bin/git-remote-freenet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,10 +1290,17 @@ fn build_pack(
bail!("git rev-list failed: {}", rev_list_out.status);
}

// `-c pack.threads=1`: the pack that lands on the contract here
// is what `freenet-git rescue --from <git-dir>` will later try to
// reconstruct byte-for-byte. Default `pack.threads=auto` races
// delta search across cores → non-deterministic pack bytes →
// future rescues' reconstructions silently miss the lookup map.
// Pinning single-threaded is a small per-push wall-clock cost
// for permanent rescue reproducibility. See PR #55 Codex P2 #2.
let mut child = Command::new("git")
.arg("--git-dir")
.arg(git_dir)
.args(["pack-objects", "--stdout"])
.args(["-c", "pack.threads=1", "pack-objects", "--stdout"])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::inherit())
Expand Down
1 change: 1 addition & 0 deletions crates/freenet-git/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

pub mod chunked;
pub mod ids;
pub mod local_pack;
pub mod pack_cache;
pub mod state_init;
pub mod url;
Expand Down
Loading
Loading