- Notifications
You must be signed in to change notification settings - Fork471
Keep track of compiler info during build#7889
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
pkg-pr-newbot commentedSep 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
rescript@rescript/darwin-arm64@rescript/darwin-x64@rescript/linux-arm64@rescript/linux-x64@rescript/runtime@rescript/win32-x64commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR implements compiler tracking functionality during builds to detect compiler changes and trigger necessary package cleaning. It adds compiler metadata including version, BSC path/hash, and runtime path to facilitate build invalidation when the compiler environment changes.
Key changes:
- Introduces a
CompilerInfostruct containing BSC path, hash, and runtime path - Adds compiler verification logic that compares current compiler info with stored metadata
- Implements automatic package cleaning when compiler changes are detected
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rewatch/src/build/compiler_info.rs | New module implementing compiler info verification and metadata file writing |
| rewatch/src/build/build_types.rs | Adds CompilerInfo struct and updates BuildState to use it |
| rewatch/src/build.rs | Integrates compiler verification into build initialization |
| rewatch/src/build/packages.rs | Adds method to get compiler info file path |
| rewatch/src/build/parse.rs | Updates AST generation to use compiler info |
| rewatch/src/build/compile.rs | Refactors runtime path handling and updates compilation |
| rewatch/src/build/clean.rs | Updates cleaning logic and adds compiler info cleanup |
Comments suppressed due to low confidence (1)
rewatch/src/build/compiler_info.rs:1
- This TODO comment appears to be in the wrong location. It's placed in the compile.rs diff but seems unrelated to the compiler info functionality being added.
use crate::helpers;Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
We are going to merge this, as it is a nice step in the right direction towards release candidate. Someone (@jfrolich or@rolandpeelen) do please take a look at the code here. |
1d0166b intorescript-lang:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fixes#7436
It produces a
lib/bs/compiler-info.jsonfile which contains:{"version":"12.0.0-beta.12","bsc_path":"/Users/nojaf/Projects/vrindelycker/node_modules/@rescript/darwin-arm64/bin/bsc.exe","bsc_hash":"7d113813ca550965be97771da2ce2d47f85d297eda9e568763e54d31e0b8098d","rescript_config_hash":"226055db0876bea957f7b3b597478f95fdaefb4547704d6557c5dceb64772a1b","runtime_path":"/Users/nojaf/Projects/vrindelycker/node_modules/@rescript/runtime","generated_at":"1757936814848"}"runtime_path"and"bsc_path"might be interesting for tooling to pick up.That hash compare is also really useful when working with a local compiler.