-
Notifications
You must be signed in to change notification settings - Fork 7
feat(cef): CI-first Wave 2 bootstrap — SDK fetch, dependency inventory, version diagnostics #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # ============================================================ | ||
| # WorldScript Studio – CEF Learning Harness (Wave 2 bootstrap) | ||
| # | ||
| # docs/cef/ROADMAP-CEF-DESKTOP-MIGRATION.md §3142 (Wave 2 deliverables), ADR-0020 | ||
| # (CEF binding choice — the Wave 2 spike this harness formalizes into a real, | ||
| # repo-committed, CI-run check per §61.1.4's evidence-link discipline). | ||
| # | ||
| # Scope of this first increment: fetch + verify the pinned CEF SDK, report a | ||
| # clean-machine Linux runtime-dependency inventory (before any apt-get — a genuinely | ||
| # new data point vs. the spike's already-configured dev machine), and print real | ||
| # version diagnostics parsed from the fetched SDK itself. The actual CEF host | ||
| # build/run/shutdown proof (§4.11.3's "isolated learning harness") is deliberately | ||
| # NOT part of this increment — see ADR-0020's Consequences for why that needs its | ||
| # own CMake/Cargo bootstrap PR. | ||
| # | ||
| # Advisory only: not part of the required `ci-success` aggregator. Wave 2 is still | ||
| # in progress; this harness informs it rather than gating unrelated PRs on it. | ||
| # ============================================================ | ||
|
|
||
| name: 🧪 CEF Learning Harness | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'scripts/cef/**' | ||
| - 'docs/cef/**' | ||
| - '.github/workflows/cef-learning-harness.yml' | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'scripts/cef/**' | ||
| - 'docs/cef/**' | ||
| - '.github/workflows/cef-learning-harness.yml' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: cef-learning-harness-${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| harness: | ||
| name: 🧪 Fetch CEF SDK + dependency inventory + version diagnostics | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
| # Runs on the stock runner before any apt-get — the "clean machine" data point | ||
| # docs/cef/knowledge/linux-runtime-notes.md flags as still open. | ||
| - name: Clean-machine Linux dependency inventory | ||
| run: node scripts/cef/check-linux-runtime-deps.mjs | ||
|
|
||
| - name: Restore CEF SDK cache | ||
| id: cef-cache | ||
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | ||
| with: | ||
| path: .cef-cache | ||
| key: cef-sdk-${{ hashFiles('scripts/cef/cef-version.json') }} | ||
|
|
||
| - name: Fetch + verify CEF SDK | ||
| run: | | ||
| set -o pipefail | ||
| CEF_DIR=$(node scripts/cef/fetch-cef-sdk.mjs --cache-dir .cef-cache | tail -1) | ||
| echo "CEF_DIR=$CEF_DIR" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Print CEF version diagnostics | ||
| run: node scripts/cef/print-cef-version-diagnostics.mjs "$CEF_DIR" | ||
|
|
||
| - name: Summary | ||
| run: | | ||
| echo "## 🧪 CEF Learning Harness" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- Pinned SDK: \`$(node -e "console.log(require('./scripts/cef/cef-version.json').cefVersion)")\`" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- Cache hit: \`${{ steps.cef-cache.outputs.cache-hit }}\`" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- Scope: fetch/verify + clean-machine dependency inventory + version diagnostics only." >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- Not yet in scope: CEF host build/run/shutdown proof (see ADR-0020 Consequences)." >> "$GITHUB_STEP_SUMMARY" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "$comment": "Pinned CEF binary distribution for the Wave 2 learning harness (docs/cef/ROADMAP-CEF-DESKTOP-MIGRATION.md §3142, ADR-0020). Bump this file — and only this file — to move to a new CEF version; scripts/cef/fetch-cef-sdk.mjs reads it, never hardcodes a version. sha1/sizeBytes come straight from https://cef-builds.spotifycdn.com/index.json — do not hand-compute them.", | ||
| "cefVersion": "151.3.18+gbeff58d+chromium-151.0.7922.138", | ||
| "platform": "linux64", | ||
| "distType": "minimal", | ||
| "filename": "cef_binary_151.3.18+gbeff58d+chromium-151.0.7922.138_linux64_minimal.tar.bz2", | ||
| "sha1": "5fc23dcccfead1044b2c3bf02e4ad27e86c29c0f", | ||
| "sizeBytes": 321422583, | ||
| "baseUrl": "https://cef-builds.spotifycdn.com" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env node | ||
| /** | ||
| * Shared cache-path computation for the CEF Wave 2 scripts (ADR-0020) — kept in one place so | ||
| * fetch-cef-sdk.mjs and print-cef-version-diagnostics.mjs can never compute a different path for | ||
| * the same pinned SDK. | ||
| */ | ||
| import path from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
| const root = path.join(__dirname, '..', '..'); | ||
|
|
||
| /** | ||
| * @param {{filename: string}} pin | ||
| * @param {string} [cacheDirArg] | ||
| */ | ||
| export function resolveCefPaths(pin, cacheDirArg) { | ||
| const cacheDir = cacheDirArg ? path.resolve(cacheDirArg) : path.join(root, '.cef-cache'); | ||
| const archivePath = path.join(cacheDir, pin.filename); | ||
| const extractedDirName = pin.filename.replace(/\.tar\.bz2$/, ''); | ||
| const extractedDir = path.join(cacheDir, extractedDirName); | ||
| return { cacheDir, archivePath, extractedDir, extractedDirName }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| #!/usr/bin/env node | ||
| /** | ||
| * CEF Linux runtime-dependency inventory (docs/cef/ROADMAP-CEF-DESKTOP-MIGRATION.md §44.3, ADR-0020). | ||
| * | ||
| * Formalizes the Wave 2 spike's informal dev-machine findings | ||
| * (docs/cef/knowledge/linux-runtime-notes.md) into a real, CI-runnable check. Reports which of | ||
| * CEF's documented runtime shared-library dependencies are present via dpkg, on *this* machine. | ||
| * | ||
| * Deliberately non-fatal by default (exit 0 even with missing packages): this script's job is to | ||
| * produce an honest inventory data point, not to gate CI on a specific distro's package set — | ||
| * that gate belongs to a later packaging wave (§44's clean-machine test), once WorldScript ships | ||
| * an actual installer with declared dependencies. Pass --strict to fail on any missing package | ||
| * once a real compatibility floor has been proven (not yet — see the roadmap warning below). | ||
| * | ||
| * Run: node scripts/cef/check-linux-runtime-deps.mjs [--strict] | ||
| */ | ||
| import { execFileSync } from 'node:child_process'; | ||
|
|
||
| // QNBS-v3: list is what CEF's own build docs call out, confirmed present on one dev machine — see docs/cef/knowledge/linux-runtime-notes.md; don't add packages from generic Chromium docs without a real WorldScript test. | ||
| const REQUIRED_PACKAGES = [ | ||
| 'libnss3', | ||
| 'libnspr4', | ||
| 'libatk1.0-0', | ||
| 'libatk-bridge2.0-0', | ||
| 'libcups2', | ||
| 'libdrm2', | ||
| 'libgbm1', | ||
| 'libxcomposite1', | ||
| 'libxdamage1', | ||
| 'libxfixes3', | ||
| 'libxrandr2', | ||
| 'libxkbcommon0', | ||
| 'libpango-1.0-0', | ||
| 'libcairo2', | ||
| 'libasound2', | ||
| 'libgtk-3-0', | ||
| 'libx11-xcb1', | ||
| 'libxcb1', | ||
| ]; | ||
|
qnbs marked this conversation as resolved.
|
||
|
|
||
| /** @param {string} pkg */ | ||
| function dpkgReportsInstalled(pkg) { | ||
| try { | ||
| // QNBS-v3: dpkg -s exits 0 even for a removed package still holding config-files state — only the Status line's "installed" word confirms it's actually present. | ||
| const out = execFileSync('dpkg', ['-s', pkg], { | ||
| stdio: ['ignore', 'pipe', 'ignore'], | ||
| }).toString(); | ||
| return /^Status:.*\binstalled\b/m.test(out); | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| // QNBS-v3: Ubuntu 24.04's 64-bit-time_t transition renamed several of these to a "t64" suffix (confirmed on the real ubuntu-latest CI runner) — check both spellings. | ||
| /** @param {string} pkg */ | ||
| function isInstalled(pkg) { | ||
| return dpkgReportsInstalled(pkg) || dpkgReportsInstalled(`${pkg}t64`); | ||
| } | ||
|
|
||
| const strict = process.argv.includes('--strict'); | ||
| const results = REQUIRED_PACKAGES.map((pkg) => ({ pkg, present: isInstalled(pkg) })); | ||
| const missing = results.filter((r) => !r.present); | ||
|
|
||
| console.log('[check-linux-deps] CEF Linux runtime-dependency inventory:'); | ||
| for (const { pkg, present } of results) { | ||
| console.log(` ${present ? '✓' : '✗'} ${pkg}`); | ||
| } | ||
|
|
||
| if (missing.length > 0) { | ||
| console.log( | ||
| `\n[check-linux-deps] ${missing.length}/${results.length} package(s) missing on this machine: ` + | ||
| missing.map((m) => m.pkg).join(', '), | ||
| ); | ||
| } else { | ||
| console.log(`\n[check-linux-deps] All ${results.length} documented packages present.`); | ||
| } | ||
|
|
||
| if (strict && missing.length > 0) { | ||
| console.error('[check-linux-deps] --strict requested and packages are missing — failing.'); | ||
| process.exit(1); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.