tenseleyflow/bencch / 102e3ea

Browse files

Add external-only bootstrap workspace

Authored by espadonne
SHA
102e3ea2fbc0fb760484b660cbbc3b47b5ec95a7
Parents
196f49a
Tree
918f435

5 changed files

StatusFile+-
M .github/workflows/standalone-bootstrap.yml 24 0
M .gitignore 1 0
M README.md 10 0
M scripts/bootstrap-linked-armfortas.sh 4 0
A scripts/bootstrap-standalone-external.sh 87 0
.github/workflows/standalone-bootstrap.ymlmodified
@@ -33,3 +33,27 @@ jobs:
3333
           cargo run --manifest-path .bencch-local/Cargo.toml -p afs-tests --bin bencch -- doctor > doctor.txt
3434
           grep "armfortas_capture_root: .*external-armfortas" doctor.txt
3535
           grep "armfortas_capture_status: linked via Cargo to .*external-armfortas" doctor.txt
36
+
37
+  bootstrap-standalone-external:
38
+    runs-on: macos-latest
39
+
40
+    steps:
41
+      - name: Check out bencch
42
+        uses: actions/checkout@v4
43
+
44
+      - name: Set up Rust
45
+        uses: dtolnay/rust-toolchain@stable
46
+
47
+      - name: Generate external-only workspace
48
+        run: scripts/bootstrap-standalone-external.sh
49
+
50
+      - name: Verify external-only doctor
51
+        run: |
52
+          cargo run --manifest-path .bencch-external/Cargo.toml -p afs-tests --bin bencch -- doctor > doctor.txt
53
+          grep "armfortas_capture_mode: unavailable" doctor.txt
54
+          grep "linked capture is unavailable in this build" doctor.txt
55
+
56
+      - name: Verify external-only compare
57
+        run: |
58
+          cargo run --manifest-path .bencch-external/Cargo.toml -p afs-tests --bin bencch -- compare fixtures/fake_compilers/match_42_a.sh fixtures/fake_compilers/match_42_b.sh --program fixtures/runtime/if_else.f90 > compare.txt
59
+          grep "status: MATCH" compare.txt
.gitignoremodified
@@ -1,5 +1,6 @@
11
 .docs/
22
 .bencch-local/
3
+.bencch-external/
34
 reports/
45
 target/
56
 afs_*.dat
README.mdmodified
@@ -35,6 +35,16 @@ cargo run --manifest-path .bencch-local/Cargo.toml -p afs-tests --bin bencch --
3535
 That generated path keeps linked capture working and makes `doctor` report the
3636
 actual linked `armfortas` checkout instead of assuming `bencch` is embedded.
3737
 
38
+Standalone external-only usage now works through a second generated workspace:
39
+
40
+```bash
41
+scripts/bootstrap-standalone-external.sh
42
+cargo run --manifest-path .bencch-external/Cargo.toml -p afs-tests --bin bencch -- doctor
43
+```
44
+
45
+That mode drops linked capture entirely and keeps the generic external-driver
46
+surface available for `compare`, `introspect`, and external-facing `run` work.
47
+
3848
 ## Usage
3949
 
4050
 List suites:
scripts/bootstrap-linked-armfortas.shmodified
@@ -67,6 +67,10 @@ edition = "2021"
6767
 description = "Structured generic compiler bench runner"
6868
 build = "../../bench/build.rs"
6969
 
70
+[features]
71
+default = ["linked-armfortas"]
72
+linked-armfortas = []
73
+
7074
 [lib]
7175
 path = "../../bench/src/lib.rs"
7276
 
scripts/bootstrap-standalone-external.shadded
@@ -0,0 +1,87 @@
1
+#!/usr/bin/env bash
2
+
3
+set -euo pipefail
4
+
5
+usage() {
6
+    cat <<'EOF'
7
+Usage: scripts/bootstrap-standalone-external.sh [output-dir]
8
+
9
+Generate a local bencch workspace that builds without linked armfortas support.
10
+This keeps compare/introspect/doctor available on the generic external-driver
11
+surface.
12
+
13
+Examples:
14
+  scripts/bootstrap-standalone-external.sh
15
+  scripts/bootstrap-standalone-external.sh .bencch-external
16
+EOF
17
+}
18
+
19
+if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
20
+    usage
21
+    exit 0
22
+fi
23
+
24
+if [[ $# -gt 1 ]]; then
25
+    usage >&2
26
+    exit 1
27
+fi
28
+
29
+script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
30
+repo_root="$(cd "${script_dir}/.." && pwd)"
31
+output_dir="${1:-${repo_root}/.bencch-external}"
32
+output_dir="$(mkdir -p "${output_dir}" && cd "${output_dir}" && pwd)"
33
+
34
+mkdir -p "${output_dir}/bench"
35
+
36
+cat > "${output_dir}/Cargo.toml" <<EOF
37
+# Generated by scripts/bootstrap-standalone-external.sh
38
+[workspace]
39
+members = ["bench"]
40
+default-members = ["bench"]
41
+resolver = "2"
42
+EOF
43
+
44
+cat > "${output_dir}/bench/Cargo.toml" <<EOF
45
+# Generated by scripts/bootstrap-standalone-external.sh
46
+[package]
47
+name = "afs-tests"
48
+version = "0.1.0"
49
+edition = "2021"
50
+description = "Structured generic compiler bench runner"
51
+build = "../../bench/build.rs"
52
+
53
+[features]
54
+default = []
55
+linked-armfortas = []
56
+
57
+[lib]
58
+path = "../../bench/src/lib.rs"
59
+
60
+[[bin]]
61
+name = "afs-tests"
62
+path = "../../bench/src/main.rs"
63
+
64
+[[bin]]
65
+name = "bencch"
66
+path = "../../bench/src/bin/bencch.rs"
67
+
68
+[dependencies]
69
+bencch-core = { path = "../../bench-core" }
70
+EOF
71
+
72
+cat > "${output_dir}/README.md" <<EOF
73
+# Generated external-only workspace
74
+
75
+This directory is generated by scripts/bootstrap-standalone-external.sh.
76
+
77
+It builds bencch without linked armfortas capture.
78
+
79
+Use it with:
80
+
81
+  cargo run --manifest-path "${output_dir}/Cargo.toml" -p afs-tests --bin bencch -- doctor
82
+EOF
83
+
84
+echo "Generated external-only workspace at ${output_dir}"
85
+echo
86
+echo "Next step:"
87
+echo "  cargo run --manifest-path \"${output_dir}/Cargo.toml\" -p afs-tests --bin bencch -- doctor"