You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/09/07 01:28:27 UTC
(opendal) branch main updated: feat(release): reproduce source archives and prepare ATR candidates (#8232)
This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 0e9cf8c9f2 feat(release): reproduce source archives and prepare ATR candidates (#8232)
0e9cf8c9f2 is described below
commit 0e9cf8c9f24526e69e70ac1bdc96c7a193e867e4
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Mon Sep 7 09:28:20 2026 +0800
feat(release): reproduce source archives and prepare ATR candidates (#8232)
* fix(dev): make source release archives reproducible
* refactor(dev): place archive tests after release helpers
* fix(ci): use canonical ASF header in reproduction script
* docs(release): record reproduction evidence and CI signing proposal
* feat(release): prepare source candidates with ATR trusted publishing
* chore: recognize GnuPG fingerprint records in spellcheck
* chore(release): reuse the existing Services RM signing key
---
.asf.yaml | 21 +++
.github/workflows/ci_odev.yml | 62 ++++++++
.github/workflows/release-compose.yml | 141 +++++++++++++++++
.typos.toml | 2 +
dev/src/main.rs | 11 +-
dev/src/release/mod.rs | 191 ++++++++++++++++++++--
scripts/sign_source_release.py | 193 +++++++++++++++++++++++
scripts/test_sign_source_release.py | 167 ++++++++++++++++++++
scripts/verify_source_reproducibility.py | 156 ++++++++++++++++++
website/community/release/ci-signing-proposal.md | 111 +++++++++++++
website/community/release/release.md | 3 +
website/community/release/reproducible-source.md | 74 +++++++++
12 files changed, 1113 insertions(+), 19 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index b5718d9f2a..c2f35d0273 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -62,6 +62,27 @@ github:
policies:
- name: main
type: branch
+ source-release:
+ required_reviewers:
+ - id: Xuanwo
+ type: User
+ - id: dentiny
+ type: User
+ - id: erickguan
+ type: User
+ - id: tisonkun
+ type: User
+ - id: koushiro
+ type: User
+ - id: PsiACE
+ type: User
+ wait_timer: 0
+ prevent_self_review: true
+ deployment_branch_policy:
+ protected_branches: false
+ policies:
+ - name: main
+ type: branch
custom_subjects:
new_discussion: "{title}"
edit_discussion: "Re: {title}"
diff --git a/.github/workflows/ci_odev.yml b/.github/workflows/ci_odev.yml
index b956ea01e0..c251e72aff 100644
--- a/.github/workflows/ci_odev.yml
+++ b/.github/workflows/ci_odev.yml
@@ -27,6 +27,12 @@ on:
paths:
- "**/*.rs"
- ".github/workflows/ci_odev.yml"
+ - "dev/Cargo.toml"
+ - "dev/Cargo.lock"
+ - "scripts/verify_source_reproducibility.py"
+ - "scripts/sign_source_release.py"
+ - "scripts/test_sign_source_release.py"
+ - ".github/workflows/release-compose.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
@@ -52,6 +58,15 @@ jobs:
working-directory: dev
run: cargo clippy --all-targets --all-features -- -D warnings
+ test_signing:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-python@v6
+ with:
+ python-version: '3.12'
+ - run: python3 -m unittest discover -s scripts -p 'test_sign_source_release.py'
+
test_dev:
runs-on: ubuntu-latest
steps:
@@ -92,3 +107,50 @@ jobs:
- name: Check diff
run: git diff --exit-code
+
+ reproduce:
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - uses: actions/setup-python@v6
+ with:
+ python-version: '3.12'
+ - uses: ./.github/actions/setup
+ - name: Rebuild source packages in independent checkouts
+ run: python3 scripts/verify_source_reproducibility.py --output "$RUNNER_TEMP/reproduction"
+ - uses: actions/upload-artifact@v7
+ if: always()
+ with:
+ name: source-reproducibility-${{ matrix.os }}
+ path: |
+ ${{ runner.temp }}/reproduction/report.json
+ ${{ runner.temp }}/reproduction/build-*.log
+ if-no-files-found: error
+
+ compare:
+ needs: reproduce
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/download-artifact@v8
+ with:
+ pattern: source-reproducibility-*
+ path: reproduction
+ - name: Compare Linux and macOS archive digests
+ run: |
+ python3 - <<'PYTHON'
+ import json
+ from pathlib import Path
+ reports = [json.loads(p.read_text()) for p in Path("reproduction").glob("*/report.json")]
+ assert len(reports) == 2, "missing platform report"
+ assert all(r["matched"] for r in reports), "checkout reproduction failed"
+ assert reports[0]["commit"] == reports[1]["commit"], "different source commits"
+ assert reports[0]["runs"][0] == reports[1]["runs"][0], "Linux and macOS artifacts differ"
+ print("All source archives match across Linux and macOS")
+ PYTHON
diff --git a/.github/workflows/release-compose.yml b/.github/workflows/release-compose.yml
new file mode 100644
index 0000000000..4cbe0be5a4
--- /dev/null
+++ b/.github/workflows/release-compose.yml
@@ -0,0 +1,141 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Compose source candidate on ATR
+
+on:
+ workflow_dispatch:
+ inputs:
+ candidate:
+ description: Full SHA of the reviewed source commit on main
+ type: string
+ required: true
+ rc:
+ description: Candidate version, for example 0.59.2-rc.1
+ type: string
+ required: true
+
+permissions:
+ contents: read
+
+concurrency:
+ group: source-release-compose
+ cancel-in-progress: false
+
+jobs:
+ source_bundle:
+ if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && github.repository == 'apache/opendal' && vars.SOURCE_RELEASE_ENABLED == 'true'
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ artifact-id: ${{ steps.bundle.outputs.artifact-id }}
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ github.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ - uses: actions/setup-python@v6
+ with:
+ python-version: '3.12'
+ - name: Validate reviewed candidate identity
+ env:
+ CANDIDATE: ${{ inputs.candidate }}
+ RC: ${{ inputs.rc }}
+ run: |
+ python3 - <<'PYTHON'
+ import os, re, subprocess
+ assert re.fullmatch(r"[0-9a-f]{40}", os.environ["CANDIDATE"]), "full candidate SHA required"
+ assert re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+-rc\.[1-9][0-9]*", os.environ["RC"]), "RC version required"
+ subprocess.run(["git", "merge-base", "--is-ancestor", os.environ["CANDIDATE"], "origin/main"], check=True)
+ PYTHON
+ - uses: ./.github/actions/setup
+ - name: Prepare unsigned candidate without signing credentials
+ env:
+ CANDIDATE: ${{ inputs.candidate }}
+ run: python3 scripts/verify_source_reproducibility.py --revision "$CANDIDATE" --output "$RUNNER_TEMP/source-bundle"
+ - uses: actions/upload-artifact@v7
+ id: bundle
+ with:
+ name: source-candidate-${{ github.run_id }}-${{ github.run_attempt }}
+ path: |
+ ${{ runner.temp }}/source-bundle/*.tar.gz
+ ${{ runner.temp }}/source-bundle/*.sha512
+ ${{ runner.temp }}/source-bundle/report.json
+ if-no-files-found: error
+
+ source_sign:
+ needs: source_bundle
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ artifact-id: ${{ steps.signed.outputs.artifact-id }}
+ environment:
+ name: source-release
+ url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ github.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ - uses: actions/setup-python@v6
+ with:
+ python-version: '3.12'
+ - uses: actions/download-artifact@v8
+ with:
+ artifact-ids: ${{ needs.source_bundle.outputs.artifact-id }}
+ path: ${{ runner.temp }}/source-bundle
+ merge-multiple: true
+ - name: Sign the exact source bundle
+ env:
+ CANDIDATE: ${{ inputs.candidate }}
+ RC: ${{ inputs.rc }}
+ SOURCE_SIGNING_FINGERPRINT: ${{ vars.SOURCE_SIGNING_FINGERPRINT }}
+ SOURCE_SIGNING_KEY: ${{ secrets.GPG_SECRET_KEY }}
+ SOURCE_SIGNING_PASSPHRASE: ""
+ run: python3 scripts/sign_source_release.py "$RUNNER_TEMP/source-bundle" "$CANDIDATE" "$RC" "$RUNNER_TEMP/signed-source"
+ - uses: actions/upload-artifact@v7
+ id: signed
+ with:
+ name: signed-source-${{ github.run_id }}-${{ github.run_attempt }}
+ path: ${{ runner.temp }}/signed-source/
+ if-no-files-found: error
+
+ source_compose:
+ needs: source_sign
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ id-token: write
+ steps:
+ - uses: actions/download-artifact@v8
+ with:
+ artifact-ids: ${{ needs.source_sign.outputs.artifact-id }}
+ path: ${{ runner.temp }}/signed-source
+ merge-multiple: true
+ - name: Upload candidate to ATR compose
+ uses: apache/tooling-actions/upload-to-atr@fa721a0b176d713807b574da721b96545b587eea
+ with:
+ project: opendal
+ version: ${{ inputs.rc }}
+ src: ${{ runner.temp }}/signed-source
+ - name: Record staging handoff
+ run: |
+ echo 'Candidate uploaded to ATR compose. Inspect ATR checks and independently rebuild the downloaded files before starting a vote. This workflow does not vote or finish a release.' >> "$GITHUB_STEP_SUMMARY"
diff --git a/.typos.toml b/.typos.toml
index e71a6c8a03..8902e29716 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -25,6 +25,8 @@
"thw" = "thw"
# Showed up in test.
"hsa" = "hsa"
+# GnuPG machine-readable fingerprint record.
+"fpr" = "fpr"
# Tech words
"WRONLY" = "WRONLY"
"typ" = "typ"
diff --git a/dev/src/main.rs b/dev/src/main.rs
index 7b65e4bb75..8459f19cf0 100644
--- a/dev/src/main.rs
+++ b/dev/src/main.rs
@@ -62,7 +62,13 @@ enum Commands {
/// Update the version of all packages.
UpdateVersion,
/// Create all the release artifacts.
- Release,
+ Release {
+ /// Build source archives without invoking GPG.
+ #[arg(long)]
+ unsigned: bool,
+ },
+ /// Print the source package inventory as JSON.
+ ReleasePackages,
}
fn main() -> anyhow::Result<()> {
@@ -71,6 +77,7 @@ fn main() -> anyhow::Result<()> {
match Cmd::parse().command {
Commands::Generate { language } => generate::run(&language),
Commands::UpdateVersion => release::update_version(),
- Commands::Release => release::archive_package(),
+ Commands::Release { unsigned } => release::archive_package(!unsigned),
+ Commands::ReleasePackages => release::print_packages(),
}
}
diff --git a/dev/src/release/mod.rs b/dev/src/release/mod.rs
index 04463ad240..33f417f559 100644
--- a/dev/src/release/mod.rs
+++ b/dev/src/release/mod.rs
@@ -21,6 +21,7 @@ use flate2::write::GzEncoder;
use sha2::{Digest, Sha512};
use std::io::BufReader;
use std::io::Read;
+use std::path::Path;
mod bump;
mod package;
@@ -39,7 +40,23 @@ pub fn update_version() -> anyhow::Result<()> {
Ok(())
}
-pub fn archive_package() -> anyhow::Result<()> {
+pub fn print_packages() -> anyhow::Result<()> {
+ let packages = package::all_packages();
+ let inventory = packages
+ .iter()
+ .map(|p| {
+ serde_json::json!({
+ "path": p.name(), "version": p.version().to_string(),
+ "dependencies": p.dependencies().iter().map(|d| d.name()).collect::<Vec<_>>(),
+ "public_dependencies": p.public_compat_dependencies(),
+ })
+ })
+ .collect::<Vec<_>>();
+ println!("{}", serde_json::to_string_pretty(&inventory)?);
+ Ok(())
+}
+
+pub fn archive_package(sign: bool) -> anyhow::Result<()> {
std::fs::create_dir_all(workspace_dir().join("dist"))?;
let workspace_dir = workspace_dir();
@@ -48,16 +65,20 @@ pub fn archive_package() -> anyhow::Result<()> {
let packages = package::all_packages();
for package in packages {
let mut cmd = find_command("git", &workspace_dir);
- cmd.args(["ls-files", "LICENSE", "NOTICE"]);
+ cmd.args(["ls-files", "--stage", "-z", "--", "LICENSE", "NOTICE"]);
cmd.arg(package.name());
for dep in package.dependencies() {
cmd.arg(dep.name());
}
- let output = cmd.output().expect("failed to execute git ls-files");
- let output = String::from_utf8_lossy(&output.stdout);
- let files = output.lines().collect::<Vec<_>>();
+ let output = cmd.output()?;
+ anyhow::ensure!(output.status.success(), "git ls-files failed");
+ let files = archive_entries(&output.stdout)?;
archive_and_checksum(&package, &files)?;
+ if !sign {
+ continue;
+ }
+
let filename = format!("{}.tar.gz", package.make_prefix());
println!("Generate signature for package: {}", package.name());
@@ -70,7 +91,7 @@ pub fn archive_package() -> anyhow::Result<()> {
"--detach-sign",
filename.as_str(),
]);
- cmd.output().expect("failed to sign the package");
+ anyhow::ensure!(cmd.status()?.success(), "failed to sign {filename}");
println!("Check signature for package: {}", package.name());
let mut cmd = find_command("gpg", &dist_dir);
@@ -79,28 +100,20 @@ pub fn archive_package() -> anyhow::Result<()> {
format!("{filename}.asc").as_str(),
filename.as_str(),
]);
- cmd.output()
- .expect("failed to verify the package signature");
+ anyhow::ensure!(cmd.status()?.success(), "failed to verify {filename}");
}
Ok(())
}
-fn archive_and_checksum(package: &package::Package, files: &[&str]) -> anyhow::Result<()> {
+fn archive_and_checksum(package: &package::Package, files: &[ArchiveEntry]) -> anyhow::Result<()> {
println!("Archiving package: {}", package.name());
let prefix = package.make_prefix();
let filename = format!("{prefix}.tar.gz");
let tarball = workspace_dir().join("dist").join(&filename);
- {
- let tarball = std::fs::File::create(&tarball)?;
- let encoder = GzEncoder::new(tarball, Compression::default());
- let mut tar = tar::Builder::new(encoder);
- for file in files {
- tar.append_path_with_name(workspace_dir().join(file), format!("{prefix}/{file}"))?;
- }
- }
+ write_archive(&workspace_dir(), &tarball, &prefix, files)?;
{
let tarball = std::fs::File::open(&tarball)?;
@@ -126,6 +139,74 @@ fn archive_and_checksum(package: &package::Package, files: &[&str]) -> anyhow::R
Ok(())
}
+struct ArchiveEntry {
+ path: String,
+ mode: u32,
+}
+
+fn archive_entries(index: &[u8]) -> anyhow::Result<Vec<ArchiveEntry>> {
+ let mut entries = Vec::new();
+ for entry in index
+ .split(|byte| *byte == 0)
+ .filter(|entry| !entry.is_empty())
+ {
+ let entry = std::str::from_utf8(entry)?;
+ let (metadata, path) = entry
+ .split_once('\t')
+ .ok_or_else(|| anyhow::anyhow!("invalid Git index entry"))?;
+ let fields = metadata.split_whitespace().collect::<Vec<_>>();
+ anyhow::ensure!(
+ fields.len() == 3 && fields[2] == "0",
+ "unmerged Git index entry: {path}"
+ );
+ let mode = u32::from_str_radix(fields[0], 8)?;
+ anyhow::ensure!(
+ matches!(mode, 0o100644 | 0o100755 | 0o120000),
+ "unsupported Git mode for {path}"
+ );
+ entries.push(ArchiveEntry {
+ path: path.to_owned(),
+ mode,
+ });
+ }
+ entries.sort_by(|a, b| a.path.cmp(&b.path));
+ Ok(entries)
+}
+
+fn write_archive(
+ root: &Path,
+ output: &Path,
+ prefix: &str,
+ files: &[ArchiveEntry],
+) -> anyhow::Result<()> {
+ let encoder = GzEncoder::new(std::fs::File::create(output)?, Compression::default());
+ let mut tar = tar::Builder::new(encoder);
+ for entry in files {
+ // Git owns executable bits; checkout timestamps, owners and umask must not
+ // affect the release bytes. Gzip's default header has no timestamp/name.
+ let mut header = tar::Header::new_gnu();
+ header.set_uid(0);
+ header.set_gid(0);
+ header.set_mtime(0);
+ let path = root.join(&entry.path);
+ let archive_path = format!("{prefix}/{}", entry.path);
+ if entry.mode == 0o120000 {
+ header.set_mode(0o777);
+ header.set_entry_type(tar::EntryType::Symlink);
+ header.set_size(0);
+ tar.append_link(&mut header, archive_path, std::fs::read_link(path)?)?;
+ } else {
+ header.set_mode(entry.mode & 0o777);
+ header.set_entry_type(tar::EntryType::Regular);
+ let file = std::fs::File::open(path)?;
+ header.set_size(file.metadata()?.len());
+ tar.append_data(&mut header, archive_path, file)?;
+ }
+ }
+ tar.into_inner()?.finish()?;
+ Ok(())
+}
+
fn format_digest_hex(digest: impl AsRef<[u8]>) -> String {
use std::fmt::Write;
@@ -136,3 +217,79 @@ fn format_digest_hex(digest: impl AsRef<[u8]>) -> String {
}
output
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use std::fs::FileTimes;
+ use std::time::{Duration, UNIX_EPOCH};
+
+ #[test]
+ fn archive_ignores_checkout_metadata() -> anyhow::Result<()> {
+ let root = std::env::temp_dir().join(format!("opendal-archive-{}", std::process::id()));
+ std::fs::create_dir_all(&root)?;
+ let file = root.join("script");
+ std::fs::write(&file, b"#!/bin/sh\necho reproducible\n")?;
+ let entries = archive_entries(b"100755 abc 0\tscript\0")?;
+ for (name, seconds) in [("a.tar.gz", 1_700_000_000), ("b.tar.gz", 1_800_000_000)] {
+ std::fs::File::open(&file)?.set_times(
+ FileTimes::new().set_modified(UNIX_EPOCH + Duration::from_secs(seconds)),
+ )?;
+ #[cfg(unix)]
+ {
+ use std::os::unix::fs::PermissionsExt;
+ std::fs::set_permissions(
+ &file,
+ std::fs::Permissions::from_mode(if name.starts_with('a') {
+ 0o600
+ } else {
+ 0o755
+ }),
+ )?;
+ }
+ write_archive(&root, &root.join(name), "source", &entries)?;
+ }
+ assert_eq!(
+ std::fs::read(root.join("a.tar.gz"))?,
+ std::fs::read(root.join("b.tar.gz"))?
+ );
+ let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(std::fs::File::open(
+ root.join("a.tar.gz"),
+ )?));
+ let entry = archive.entries()?.next().unwrap()?;
+ assert_eq!(entry.header().mode()?, 0o755);
+ assert_eq!(entry.header().mtime()?, 0);
+ assert_eq!(entry.header().uid()?, 0);
+ assert_eq!(entry.header().gid()?, 0);
+ std::fs::remove_dir_all(root)?;
+ Ok(())
+ }
+
+ #[cfg(unix)]
+ #[test]
+ fn archive_preserves_symlinks_without_following_them() -> anyhow::Result<()> {
+ let root = std::env::temp_dir().join(format!("opendal-symlink-{}", std::process::id()));
+ std::fs::create_dir_all(&root)?;
+ std::os::unix::fs::symlink("missing-target", root.join("link"))?;
+ let entries = archive_entries(b"120000 abc 0\tlink\0")?;
+ write_archive(&root, &root.join("source.tar.gz"), "source", &entries)?;
+ let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(std::fs::File::open(
+ root.join("source.tar.gz"),
+ )?));
+ let entry = archive.entries()?.next().unwrap()?;
+ assert!(entry.header().entry_type().is_symlink());
+ assert_eq!(entry.link_name()?.unwrap(), Path::new("missing-target"));
+ assert_eq!(entry.size(), 0);
+ std::fs::remove_dir_all(root)?;
+ Ok(())
+ }
+
+ #[test]
+ fn index_paths_are_sorted_and_conflicts_rejected() -> anyhow::Result<()> {
+ let entries = archive_entries(b"100644 a 0\tz\x00100644 b 0\ta\tname\0")?;
+ assert_eq!(entries[0].path, "a\tname");
+ assert!(archive_entries(b"100644 a 1\tconflict\0").is_err());
+ assert!(archive_entries(b"160000 a 0\tsubmodule\0").is_err());
+ Ok(())
+ }
+}
diff --git a/scripts/sign_source_release.py b/scripts/sign_source_release.py
new file mode 100644
index 0000000000..e58645223f
--- /dev/null
+++ b/scripts/sign_source_release.py
@@ -0,0 +1,193 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Sign a verified source bundle for ATR compose."""
+
+import argparse
+import hashlib
+import json
+import os
+import re
+import subprocess
+import tempfile
+import urllib.request
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[1]
+KEYS = "https://downloads.apache.org/opendal/KEYS"
+RC = re.compile(r"(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)-rc\.([1-9][0-9]*)")
+
+
+def run(*args, data=None, env=None):
+ result = subprocess.run(
+ [str(arg) for arg in args],
+ input=data,
+ capture_output=True,
+ env=env,
+ check=False,
+ )
+ if result.returncode:
+ # Command arguments and diagnostics can contain credentials. Keep them local.
+ raise RuntimeError(f"{args[0]} failed with exit status {result.returncode}")
+ return result.stdout
+
+
+def download(url):
+ with urllib.request.urlopen(url, timeout=120) as response:
+ return response.read()
+
+
+def sha512(data):
+ return hashlib.sha512(data).hexdigest()
+
+
+def validate(bundle, candidate, rc):
+ if not re.fullmatch(r"[0-9a-f]{40}", candidate) or not RC.fullmatch(rc):
+ raise ValueError("use a full commit SHA and X.Y.Z-rc.N candidate version")
+ report = json.loads((bundle / "report.json").read_text())
+ if (
+ report["commit"] != candidate
+ or report["patch_sha512"] != sha512(b"")
+ or not report["matched"]
+ ):
+ raise ValueError("bundle is not a clean reproduction of the requested commit")
+ if len(report["runs"]) != 2 or report["runs"][0] != report["runs"][1]:
+ raise ValueError("source reproduction failed")
+ files = report["runs"][0]
+ # The trusted main checkout owns the package allowlist, not the build artifact.
+ packages = set(
+ re.findall(
+ r'make_package\(\s*"([^"\n]+)"',
+ (ROOT / "dev/src/release/package.rs").read_text(),
+ )
+ )
+ remaining = {path.replace("/", "-") for path in packages}
+ for name, expected in files.items():
+ match = re.fullmatch(
+ r"apache-opendal-(.+)-([0-9]+\.[0-9]+\.[0-9]+)-src\.tar\.gz", name
+ )
+ if not match or match[1] not in remaining:
+ raise ValueError("unexpected or duplicate source package")
+ remaining.remove(match[1])
+ if match[1] == "core" and match[2] != rc.split("-rc.")[0]:
+ raise ValueError("RC version differs from the core source package")
+ path = bundle / name
+ if (
+ path.is_symlink()
+ or not path.is_file()
+ or sha512(path.read_bytes()) != expected
+ ):
+ raise ValueError(f"source checksum mismatch: {name}")
+ sidecar = bundle / (name + ".sha512")
+ if sidecar.is_symlink() or sidecar.read_text().strip() != f"{expected} {name}":
+ raise ValueError(f"invalid checksum file: {name}")
+ if not files or remaining:
+ raise ValueError("incomplete source package inventory")
+ return files
+
+
+def verify_signature(home, archive, signature, fingerprint):
+ status = run(
+ "gpg",
+ "--homedir",
+ home,
+ "--batch",
+ "--status-fd",
+ "1",
+ "--verify",
+ signature,
+ archive,
+ )
+ valid = [
+ line.split()
+ for line in status.decode().splitlines()
+ if line.startswith("[GNUPG:] VALIDSIG ")
+ ]
+ if len(valid) != 1 or valid[0][-1] != fingerprint:
+ raise ValueError("signature is not from the configured primary key")
+
+
+def sign(bundle, candidate, rc, output):
+ files = validate(bundle, candidate, rc)
+ fingerprint = os.environ["SOURCE_SIGNING_FINGERPRINT"]
+ if not re.fullmatch(r"[0-9A-F]{40}", fingerprint):
+ raise ValueError("configure the full primary signing fingerprint")
+ output.mkdir(parents=True, exist_ok=False)
+ # GPG agent socket paths must fit the Unix socket limit, including on macOS.
+ with tempfile.TemporaryDirectory(prefix="od-sign-", dir="/tmp") as tmp:
+ root = Path(tmp)
+ home = root / "gnupg"
+ home.mkdir(mode=0o700)
+ run("gpg", "--homedir", home, "--batch", "--import", data=download(KEYS))
+ run("gpg", "--homedir", home, "--batch", "--list-keys", fingerprint)
+ directory = output
+ for name in files:
+ for suffix in ("", ".sha512"):
+ (directory / (name + suffix)).write_bytes(
+ (bundle / (name + suffix)).read_bytes()
+ )
+ run(
+ "gpg",
+ "--homedir",
+ home,
+ "--batch",
+ "--import",
+ data=os.environ["SOURCE_SIGNING_KEY"].encode(),
+ )
+ for name in files:
+ archive = directory / name
+ run(
+ "gpg",
+ "--homedir",
+ home,
+ "--batch",
+ "--pinentry-mode",
+ "loopback",
+ "--passphrase-fd",
+ "0",
+ "--local-user",
+ fingerprint,
+ "--armor",
+ "--detach-sign",
+ archive,
+ data=(os.environ.get("SOURCE_SIGNING_PASSPHRASE", "") + "\n").encode(),
+ )
+ verify_signature(home, archive, directory / (name + ".asc"), fingerprint)
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("bundle", type=Path)
+ parser.add_argument("candidate")
+ parser.add_argument("rc")
+ parser.add_argument("output", type=Path)
+ args = parser.parse_args()
+ if (
+ os.environ.get("GITHUB_REF") != "refs/heads/main"
+ or os.environ.get("GITHUB_EVENT_NAME") != "workflow_dispatch"
+ ):
+ raise ValueError("source signing must be dispatched from trusted main")
+ if not re.fullmatch(r"[0-9a-f]{40}", args.candidate):
+ raise ValueError("full candidate SHA required")
+ # Recheck reachability in the trusted checkout before obtaining the private key.
+ run("git", "merge-base", "--is-ancestor", args.candidate, "origin/main")
+ sign(args.bundle, args.candidate, args.rc, args.output)
+ print("Verified signatures for the complete source inventory")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/test_sign_source_release.py b/scripts/test_sign_source_release.py
new file mode 100644
index 0000000000..5cfac92fe4
--- /dev/null
+++ b/scripts/test_sign_source_release.py
@@ -0,0 +1,167 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Exercise source inventory validation and real OpenPGP signing."""
+
+import json
+import os
+import re
+import tempfile
+import unittest
+from pathlib import Path
+from unittest.mock import patch
+
+import sign_source_release as signing
+
+
+class SourceSigningTests(unittest.TestCase):
+ def setUp(self):
+ self.temp = tempfile.TemporaryDirectory()
+ self.addCleanup(self.temp.cleanup)
+ self.root = Path(self.temp.name)
+ self.bundle = self.root / "bundle"
+ self.bundle.mkdir()
+ self.candidate = "a" * 40
+ self.rc = "0.59.2-rc.1"
+ self.files = {}
+ packages = re.findall(
+ r'make_package\(\s*"([^"\n]+)"',
+ (signing.ROOT / "dev/src/release/package.rs").read_text(),
+ )
+ for package in packages:
+ name = f"apache-opendal-{package.replace('/', '-')}-0.59.2-src.tar.gz"
+ data = package.encode()
+ digest = signing.sha512(data)
+ (self.bundle / name).write_bytes(data)
+ (self.bundle / (name + ".sha512")).write_text(f"{digest} {name}\n")
+ self.files[name] = digest
+ self.report = {
+ "commit": self.candidate,
+ "patch_sha512": signing.sha512(b""),
+ "matched": True,
+ "runs": [self.files.copy(), self.files.copy()],
+ }
+ self.write_report()
+
+ def write_report(self):
+ (self.bundle / "report.json").write_text(json.dumps(self.report))
+
+ def test_complete_inventory(self):
+ self.assertEqual(
+ signing.validate(self.bundle, self.candidate, self.rc), self.files
+ )
+
+ def test_tampered_archive(self):
+ (self.bundle / next(iter(self.files))).write_bytes(b"changed")
+ with self.assertRaisesRegex(ValueError, "checksum mismatch"):
+ signing.validate(self.bundle, self.candidate, self.rc)
+
+ def test_incomplete_inventory(self):
+ name = next(iter(self.files))
+ for run in self.report["runs"]:
+ del run[name]
+ self.write_report()
+ with self.assertRaisesRegex(ValueError, "incomplete"):
+ signing.validate(self.bundle, self.candidate, self.rc)
+
+ def test_identity_and_reproduction(self):
+ for key, value in [
+ ("commit", "b" * 40),
+ ("matched", False),
+ ("patch_sha512", "patch"),
+ ]:
+ with self.subTest(key=key):
+ original = self.report[key]
+ self.report[key] = value
+ self.write_report()
+ with self.assertRaises(ValueError):
+ signing.validate(self.bundle, self.candidate, self.rc)
+ self.report[key] = original
+ self.write_report()
+ with self.assertRaisesRegex(ValueError, "RC version"):
+ signing.validate(self.bundle, self.candidate, "0.60.0-rc.1")
+ with self.assertRaises(ValueError):
+ signing.validate(self.bundle, self.candidate, "../../other")
+
+ def test_symlink_rejected(self):
+ archive = self.bundle / next(iter(self.files))
+ target = self.root / "target"
+ archive.rename(target)
+ archive.symlink_to(target)
+ with self.assertRaises(ValueError):
+ signing.validate(self.bundle, self.candidate, self.rc)
+
+ def test_sign_and_verify_complete_bundle(self):
+ home = self.root / "keys"
+ home.mkdir(mode=0o700)
+ gpg = [
+ "gpg",
+ "--homedir",
+ home,
+ "--batch",
+ "--pinentry-mode",
+ "loopback",
+ "--passphrase",
+ "",
+ ]
+ signing.run(
+ *gpg,
+ "--quick-generate-key",
+ "Test <te...@example.invalid>",
+ "ed25519",
+ "sign",
+ "0",
+ )
+ listing = signing.run(*gpg, "--with-colons", "--list-keys").decode()
+ fingerprint = next(
+ line.split(":")[9]
+ for line in listing.splitlines()
+ if line.startswith("fpr:")
+ )
+ public = signing.run(*gpg, "--armor", "--export", fingerprint)
+ private = signing.run(*gpg, "--armor", "--export-secret-keys", fingerprint)
+ output = self.root / "signed"
+ with (
+ patch.dict(
+ os.environ,
+ {
+ "SOURCE_SIGNING_FINGERPRINT": fingerprint,
+ "SOURCE_SIGNING_KEY": private.decode(),
+ "SOURCE_SIGNING_PASSPHRASE": "",
+ },
+ ),
+ patch.object(signing, "download", return_value=public),
+ ):
+ signing.sign(self.bundle, self.candidate, self.rc, output)
+ expected = {
+ name + suffix for name in self.files for suffix in ("", ".sha512", ".asc")
+ }
+ self.assertEqual({p.name for p in output.iterdir()}, expected)
+ name = next(iter(self.files))
+ with self.assertRaisesRegex(ValueError, "configured primary key"):
+ signing.verify_signature(
+ home, output / name, output / (name + ".asc"), "F" * 40
+ )
+ (output / name).write_bytes(b"tampered")
+ with self.assertRaises(RuntimeError):
+ signing.verify_signature(
+ home, output / name, output / (name + ".asc"), fingerprint
+ )
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/scripts/verify_source_reproducibility.py b/scripts/verify_source_reproducibility.py
new file mode 100644
index 0000000000..c16dec9207
--- /dev/null
+++ b/scripts/verify_source_reproducibility.py
@@ -0,0 +1,156 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Rebuild every source archive in two checkouts with different filesystem metadata."""
+
+import argparse
+import hashlib
+import json
+import os
+import platform
+import shutil
+import subprocess
+import tempfile
+from pathlib import Path
+
+
+def run(*args, **kwargs):
+ return subprocess.run([str(a) for a in args], check=True, **kwargs)
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--revision", default="HEAD")
+ parser.add_argument(
+ "--working-tree",
+ action="store_true",
+ help="Include tracked local changes in both checkouts",
+ )
+ parser.add_argument("--output", type=Path, required=True)
+ parser.add_argument(
+ "--compare", type=Path, help="Also compare with downloaded CI tar.gz artifacts"
+ )
+ args = parser.parse_args()
+ repo = Path(__file__).resolve().parents[1]
+ sha = subprocess.check_output(
+ ["git", "rev-parse", args.revision], cwd=repo, text=True
+ ).strip()
+ patch = (
+ subprocess.check_output(["git", "diff", "--binary", sha], cwd=repo)
+ if args.working_tree
+ else b""
+ )
+ args.output.mkdir(parents=True, exist_ok=False)
+ (args.output / "input.patch").write_bytes(patch)
+ report = {
+ "platform": platform.platform(),
+ "rustc": subprocess.check_output(["rustc", "-Vv"], text=True),
+ "commit": sha,
+ "patch_sha512": hashlib.sha512(patch).hexdigest(),
+ "runs": [],
+ "matched": False,
+ }
+ try:
+ with tempfile.TemporaryDirectory(prefix="opendal-reproduce-") as tmp:
+ target = Path(tmp) / "target"
+ for index in range(2):
+ checkout = Path(tmp) / f"checkout-{index}"
+ run(
+ "git",
+ "clone",
+ "--shared",
+ "--no-checkout",
+ "-c",
+ "core.autocrlf=false",
+ repo,
+ checkout,
+ )
+ run("git", "checkout", "--detach", sha, cwd=checkout)
+ if patch:
+ run("git", "apply", "--binary", "-", cwd=checkout, input=patch)
+ tracked = subprocess.check_output(
+ ["git", "ls-files", "-z"], cwd=checkout
+ ).split(b"\0")
+ for raw in filter(None, tracked):
+ file = checkout / os.fsdecode(raw)
+ if file.is_symlink() or not file.is_file():
+ continue
+ os.utime(file, (1_700_000_000 + index * 100_000_000,) * 2)
+ if os.name == "posix":
+ os.chmod(file, 0o644 if index == 0 else 0o755)
+ env = {
+ **os.environ,
+ "CARGO_TARGET_DIR": str(target),
+ "TZ": "UTC" if index == 0 else "Asia/Shanghai",
+ }
+ log_path = args.output / f"build-{index}.log"
+ with log_path.open("wb") as log:
+ run(
+ "cargo",
+ "run",
+ "--locked",
+ "--manifest-path",
+ checkout / "dev/Cargo.toml",
+ "--",
+ "release",
+ "--unsigned",
+ cwd=checkout,
+ env=env,
+ stdout=log,
+ stderr=subprocess.STDOUT,
+ )
+ inventory = json.loads(
+ subprocess.check_output(
+ [str(target / "debug/odev"), "release-packages"], cwd=checkout
+ )
+ )
+ archives = sorted((checkout / "dist").glob("*.tar.gz"))
+ if len(archives) != len(inventory) or not archives:
+ raise ValueError("source archive inventory is incomplete")
+ hashes = {
+ file.name: hashlib.sha512(file.read_bytes()).hexdigest()
+ for file in archives
+ }
+ report["runs"].append(hashes)
+ if index == 0:
+ for file in archives:
+ shutil.copy2(file, args.output / file.name)
+ shutil.copy2(
+ Path(str(file) + ".sha512"),
+ args.output / (file.name + ".sha512"),
+ )
+ if index and hashes != report["runs"][0]:
+ raise ValueError("independent checkout artifacts differ")
+ if args.compare:
+ expected = {
+ file.name: hashlib.sha512(file.read_bytes()).hexdigest()
+ for file in args.compare.glob("*.tar.gz")
+ }
+ if expected != report["runs"][0]:
+ raise ValueError(
+ "downloaded CI artifacts differ or inventory does not match"
+ )
+ report["matched"] = True
+ finally:
+ (args.output / "report.json").write_text(json.dumps(report, indent=2) + "\n")
+ print(
+ f"Verified {len(report['runs'][0])} identical source archives. Evidence: {args.output}"
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/website/community/release/ci-signing-proposal.md b/website/community/release/ci-signing-proposal.md
new file mode 100644
index 0000000000..3a54b70bf5
--- /dev/null
+++ b/website/community/release/ci-signing-proposal.md
@@ -0,0 +1,111 @@
+---
+title: Source archive trusted publishing
+sidebar_position: 6
+---
+
+# Source archive trusted publishing
+
+The manually dispatched `release-compose.yml` workflow prepares signed source
+candidates on Apache Trusted Releases (ATR). It remains disabled until ASF Security
+approves the workflow and the live GitHub/ATR configuration is verified. Normal CI
+continues to build unsigned archives. This workflow does not schedule releases,
+start votes, finish releases, or publish language packages.
+
+## Workflow boundary
+
+Dispatch the workflow from `main` with a full reviewed candidate commit SHA and an
+`X.Y.Z-rc.N` candidate version. Initially, the candidate must be reachable from
+`main`, and its core package version must equal `X.Y.Z`. Candidate branches and
+automatic version selection require a separate extension.
+
+Three jobs separate credentials and responsibilities:
+
+1. The build job runs the reproduction tool on the candidate in two independent
+ checkouts. It retains the complete unsigned source bundle and report as an
+ immutable Actions artifact. It has neither signing secrets nor OIDC permission.
+2. The protected `source-release` job downloads that artifact by ID, validates its
+ commit, reproduction report, package inventory and SHA-512 checksums, and signs
+ only the expected `.tar.gz` files. Trusted tooling comes from the workflow's
+ `main` checkout; candidate scripts are not executed with the key. The public
+ key must already be in OpenDAL KEYS. Each generated signature is verified
+ against the configured primary fingerprint before the signed bundle is saved.
+3. The upload job downloads the signed bundle by ID and uses the commit-pinned
+ `apache/tooling-actions/upload-to-atr` action. GitHub OIDC authorizes a temporary
+ SSH key, and rsync transfers the bundle to ATR compose. This job receives
+ `id-token: write`, but no GPG private key. No SVN credentials or persistent ATR
+ token are needed.
+
+The signed bundle contains only source `.tar.gz`, `.sha512` and `.asc` files.
+Build logs and reproduction reports stay in Actions. An upload success does not
+mean ATR checks passed: inspect the candidate revision and check results in ATR.
+The upstream upload action is experimental; its pinned implementation must be
+reviewed again before upgrading.
+
+## Enablement
+
+1. Send ASF Security the workflow and the reproduction evidence in
+ [PR #8232](https://github.com/apache/opendal/pull/8232). Explain that reviewers
+ will independently rebuild the actual staged archives on trusted hardware
+ outside Actions before publication. Obtain workflow approval before use.
+2. Reuse the Infra-managed `GPG_SECRET_KEY` repository secret originally
+ provisioned in [INFRA-24880](https://issues.apache.org/jira/browse/INFRA-24880).
+ The existing Java release workflow uses this key with an empty passphrase;
+ source signing uses the same configuration. Do not export or replace the
+ private key. No new key or secret is requested.
+3. Verify that the existing public key is available in OpenDAL KEYS and associated
+ with the committee in ATR:
+ - UID: `ASF OpenDAL Services RM <pr...@opendal.apache.org>`.
+ - Primary fingerprint: `F70370C26871BFCC47D121A626143ED2AE57525E`.
+ Set `SOURCE_SIGNING_FINGERPRINT` to this fingerprint. ATR recognizes the legacy
+ `Services RM` naming convention. Preserve the existing KEYS management mode.
+ The historical JAR signing approval does not by itself document approval of
+ this source archive workflow.
+4. In the OpenDAL project's ATR settings, under Trusted Publishing, configure:
+
+ | Setting | Value |
+ | --- | --- |
+ | Repository name | `opendal` |
+ | Repository branch | `main` |
+ | Compose workflows | `.github/workflows/release-compose.yml` |
+ | Vote workflows | Leave empty |
+ | Finish workflows | Leave empty |
+
+5. Confirm that the `source-release` environment protection from `.asf.yaml` is
+ active, including main-only deployment and required reviewers. A YAML change
+ alone is not evidence that GitHub applied the protection. The signing key is a
+ repository secret under the documented Infra procedure, so also restrict and
+ review changes to workflows that could access repository secrets.
+6. Set the repository variable `SOURCE_RELEASE_ENABLED=true` only after these
+ prerequisites are verified. Leave it unset to keep compose disabled.
+
+The repository secret's existence and the public key in KEYS have been verified.
+An authenticated end-to-end source upload and the live ATR configuration have not
+yet been verified by this PR. No Security or Infra request is sent by
+the workflow.
+
+## Rehearsal and release handoff
+
+For a rehearsal, use a candidate version and run the real compose workflow. Inspect
+ATR checks, download the complete staged revision, and use the
+[reproduction procedure](./reproducible-source.md) to compare every source archive.
+Verify the signatures against KEYS. Stop in compose: do not start a vote or finish
+the release. This exercises staging without publishing an official release; it
+still creates real candidate data in ATR. If signing or upload fails, treat the
+candidate as incomplete and inspect ATR before retrying. Reuploads can create a
+new ATR revision; the workflow does not automatically delete or approve revisions.
+
+For a real release, reviewers perform the same independent rebuild on trusted
+hardware and record the exact candidate revision and results for the PMC vote.
+Link the vote to ATR's pinned candidate revision. CI-to-CI agreement alone does
+not replace that verification. After a passing vote, a release manager can use
+ATR's finish page to publish the approved files. ATR handles the distribution SVN
+write; this compose workflow has no finish permission. Check the destination
+layout before publication so it matches OpenDAL's release directory conventions.
+
+## References
+
+- [ATR Trusted Publishing](https://releases.apache.org/docs/trusted-publishing)
+- [ATR staging and voting](https://releases.apache.org/docs/staging-and-voting)
+- [ATR publication and KEYS management](https://releases.apache.org/docs/promoting-to-release)
+- [ASF automated signing procedure](https://infra.apache.org/release-signing.html#automated-release-signing)
+- [Official upload action](https://github.com/apache/tooling-actions/tree/fa721a0b176d713807b574da721b96545b587eea/upload-to-atr)
diff --git a/website/community/release/release.md b/website/community/release/release.md
index ca9720667f..0633a16fa0 100644
--- a/website/community/release/release.md
+++ b/website/community/release/release.md
@@ -6,6 +6,9 @@ sidebar_position: 3
This document mainly introduces how the release manager
releases a new version of Apache OpenDALâ„¢ in accordance with the Apache requirements.
+See [Reproducible source archives](./reproducible-source.md) for rebuilding and
+comparing the source packages before signing.
+
## Introduction
`Source Release` is the key point which Apache values, and is also necessary for an ASF release.
diff --git a/website/community/release/reproducible-source.md b/website/community/release/reproducible-source.md
new file mode 100644
index 0000000000..82d19f161b
--- /dev/null
+++ b/website/community/release/reproducible-source.md
@@ -0,0 +1,74 @@
+---
+title: Reproducible source archives
+sidebar_position: 5
+---
+
+# Reproducible source archives
+
+OpenDAL source release archives must reproduce byte for byte from the same Git
+revision and locked packaging dependencies. This contract covers the `.tar.gz`
+files generated by `odev release`, including every binding and integration source
+package. It does not claim reproducibility for Maven artifacts, wheels, native
+binaries, or OpenPGP signature files.
+
+## Archive inputs
+
+Build from a clean checkout of the exact candidate commit, with Git line-ending
+conversion disabled (`core.autocrlf=false`) and native symlink support. Run the
+packager with `cargo run --locked --manifest-path dev/Cargo.toml -- release --unsigned`.
+The packager reads tracked working-tree contents and the Git index's file modes;
+local source edits therefore change the release bytes. It does not regenerate
+source files as part of packaging.
+
+The source package inventory comes from `dev/src/release/package.rs`. Each archive
+includes the package, its declared source dependencies, and the root LICENSE and
+NOTICE files. Paths are sorted. Tar entries use timestamp zero, numeric owner and
+group zero, empty owner/group names, and Git's regular/executable file modes.
+Symlinks retain their link target and are not followed. Gzip includes neither a
+filename nor a timestamp. The checked-in `dev/Cargo.lock` fixes the compression
+implementation. Changing those dependencies can change archive bytes and requires
+repeating the reproduction checks.
+
+## Reproduce the complete package set
+
+From a trusted checkout containing the verification script:
+
+```shell
+python3 scripts/verify_source_reproducibility.py \
+ --revision <candidate-commit> \
+ --output /tmp/opendal-reproduction
+```
+
+The output directory must not already exist. The script creates two independent
+checkouts, changes their file timestamps, permissions and process timezones, and
+builds every source archive in both. It records the commit, packaging patch digest,
+host and compiler information, all archive hashes, and build logs. A mismatch or
+missing package fails the command. The first set of archives is retained alongside
+the report. Temporary checkouts are removed automatically.
+
+For local packaging-tool development, `--working-tree` applies tracked changes to
+both checkouts and retains the exact input patch in the output. Such a run is
+useful regression evidence, but release verification must use the committed
+candidate without this option.
+
+To validate a CI candidate on trusted hardware, download the complete voted-on
+`.tar.gz` set to a directory and add:
+
+```shell
+python3 scripts/verify_source_reproducibility.py \
+ --revision <candidate-commit> \
+ --compare /path/to/downloaded-candidate \
+ --output /tmp/opendal-candidate-reproduction
+```
+
+This compares the full filename set and every archive's SHA-512 against the local
+rebuilds. Verify the downloaded signatures separately and include both results in
+the release review. Reproducibility does not replace license review or testing.
+
+odev CI performs the same check on Linux and macOS and compares
+their manifests. A CI-to-CI comparison is regression coverage; it does not replace
+the required independent reproduction on trusted hardware before publication.
+
+See [PR #8232](https://github.com/apache/opendal/pull/8232) for the recorded
+reproduction evidence and [the trusted publishing procedure](./ci-signing-proposal.md)
+for source-only signing and staging.