Strip release artifacts and bake production version info#211
Conversation
- Generate production version metadata at build time - Remove logging dependency from core runtime units - Add optional artifact stripping for release bundles
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 31 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes introduce a production build version baking system that generates a compile-time include file with hardcoded version and commit constants, refactor the build script to separate version computation logic, enhance artifact staging with binary stripping capability, and remove unused logger dependencies from multiple units. Changes
Sequence DiagramsequenceDiagram
participant CI as GitHub Actions<br/>(CI Workflow)
participant Git as Git Commands
participant BuildScript as build.pas
participant GenFile as Version Include<br/>Generator
participant Pascal as Pascal Compiler
participant Artifacts as Artifact Staging
CI->>Git: git describe (version)
Git-->>CI: version tag info
CI->>Git: git rev-parse (commit)
Git-->>CI: commit hash
CI->>BuildScript: Execute with computed<br/>DESCRIBE & COMMIT env vars
BuildScript->>BuildScript: ComputeVersion()<br/>(parse DESCRIBE)
BuildScript->>BuildScript: ComputeCommit()<br/>(parse COMMIT)
BuildScript->>GenFile: GenerateVersionInclude()<br/>(write BAKED_VERSION,<br/>BAKED_COMMIT)
GenFile-->>BuildScript: units/Goccia.Version.Generated.inc
BuildScript->>Pascal: Trigger compilation<br/>(-Fu./units includes generated file)
Pascal->>Pascal: Conditional compile:<br/>PRODUCTION mode
Pascal->>GenFile: Include BAKED_VERSION<br/>& BAKED_COMMIT constants
Pascal-->>BuildScript: Binary with baked version
BuildScript->>Artifacts: stage-build-artifacts.sh<br/>with --strip flag
Artifacts->>Artifacts: Strip binaries
Artifacts-->>CI: Distribution-ready artifacts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
build.pas (1)
428-431: Note: Include file generated for all build modes.The include file is generated even for
--devbuilds wherePRODUCTIONisn't defined and the file goes unused. This is fine for consistency, but if you want to skip unnecessary I/O in dev mode, you could gate generation onBuildMode = bmProd.♻️ Optional: Skip include generation in dev mode
GVersion := ComputeVersion; GCommit := ComputeCommit; + if BuildMode = bmProd then + GenerateVersionInclude(GVersion, GCommit); PrintVersion(GVersion, GCommit);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@build.pas` around lines 428 - 431, The build currently always calls GenerateVersionInclude(GVersion, GCommit) regardless of mode; change it to only generate the include in production builds by checking the build mode (e.g., if BuildMode = bmProd then call GenerateVersionInclude(GVersion, GCommit)); keep ComputeVersion, ComputeCommit and PrintVersion unchanged so printing still occurs in dev, but avoid the I/O when not in production.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@build.pas`:
- Around line 428-431: The build currently always calls
GenerateVersionInclude(GVersion, GCommit) regardless of mode; change it to only
generate the include in production builds by checking the build mode (e.g., if
BuildMode = bmProd then call GenerateVersionInclude(GVersion, GCommit)); keep
ComputeVersion, ComputeCommit and PrintVersion unchanged so printing still
occurs in dev, but avoid the I/O when not in production.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 35660cc6-4fb2-49ee-bbf7-b7aa9d7ad6a0
📒 Files selected for processing (8)
.github/scripts/stage-build-artifacts.sh.github/workflows/ci.yml.gitignoreScriptLoader.dprbuild.pasunits/Goccia.Interpreter.pasunits/Goccia.Values.FunctionValue.pasunits/Goccia.Version.pas
💤 Files with no reviewable changes (3)
- units/Goccia.Values.FunctionValue.pas
- units/Goccia.Interpreter.pas
- ScriptLoader.dpr
Benchmark Results274 benchmarks Interpreted: 🟢 201 improved · 🔴 20 regressed · 53 unchanged · avg +4.4% arraybuffer.js — Interp: 🟢 11, 🔴 1, 2 unch. · avg +8.3% · Bytecode: 🟢 8, 6 unch. · avg +2.0%
arrays.js — Interp: 🟢 19 · avg +7.3% · Bytecode: 🟢 13, 🔴 3, 3 unch. · avg +4.6%
async-await.js — Interp: 🟢 6 · avg +11.3% · Bytecode: 🟢 5, 1 unch. · avg +3.9%
classes.js — Interp: 🟢 25, 🔴 3, 3 unch. · avg +5.8% · Bytecode: 🟢 17, 14 unch. · avg +6.5%
closures.js — Interp: 🟢 11 · avg +4.6% · Bytecode: 🟢 3, 🔴 2, 6 unch. · avg +1.3%
collections.js — Interp: 🟢 9, 🔴 2, 1 unch. · avg +4.6% · Bytecode: 🟢 9, 3 unch. · avg +6.2%
destructuring.js — Interp: 🟢 10, 🔴 2, 10 unch. · avg +1.5% · Bytecode: 🟢 16, 🔴 1, 5 unch. · avg +3.8%
fibonacci.js — Interp: 🟢 5, 🔴 1, 2 unch. · avg +4.3% · Bytecode: 🟢 5, 🔴 2, 1 unch. · avg +2.6%
for-of.js — Interp: 🟢 1, 🔴 1, 5 unch. · avg -0.0% · Bytecode: 🟢 6, 🔴 1 · avg +4.9%
helpers/bench-module.js — Interp: 0 · Bytecode: 0
iterators.js — Interp: 🟢 15, 5 unch. · avg +3.7% · Bytecode: 🟢 19, 1 unch. · avg +5.8%
json.js — Interp: 🟢 17, 3 unch. · avg +5.6% · Bytecode: 🟢 15, 5 unch. · avg +4.1%
jsx.jsx — Interp: 🟢 12, 9 unch. · avg +2.3% · Bytecode: 🟢 19, 2 unch. · avg +5.2%
modules.js — Interp: 🟢 8, 1 unch. · avg +3.4% · Bytecode: 🟢 1, 🔴 4, 4 unch. · avg +0.5%
numbers.js — Interp: 🟢 9, 🔴 1, 1 unch. · avg +6.6% · Bytecode: 🟢 8, 3 unch. · avg +4.3%
objects.js — Interp: 🟢 6, 🔴 1 · avg +3.7% · Bytecode: 🟢 5, 2 unch. · avg +3.8%
promises.js — Interp: 🟢 11, 1 unch. · avg +4.4% · Bytecode: 🟢 10, 2 unch. · avg +2.9%
regexp.js — Interp: 🟢 7, 4 unch. · avg +4.5% · Bytecode: 🟢 9, 2 unch. · avg +4.1%
strings.js — Interp: 🟢 10, 1 unch. · avg +5.1% · Bytecode: 🟢 10, 1 unch. · avg +5.8%
typed-arrays.js — Interp: 🟢 9, 🔴 8, 5 unch. · avg +0.8% · Bytecode: 🟢 17, 🔴 3, 2 unch. · avg +2.4%
Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
Suite Timing
Measured on ubuntu-latest x64. |
- Generate version/commit constants in CI for every build - Remove the runtime git probe from `Goccia.Version`
Summary
Goccia.VersionwhenPRODUCTIONis defined.--stripand use it in release packaging to reduce binary size.Goccia.Loggerdependencies from runtime entrypoints and keep the generated version include out of version control.Testing
Summary by CodeRabbit
New Features
Chores