Skip to content

Track RPL_PATS environment variable and pattern files#110

Merged
TheVeryDarkness merged 2 commits intoRPL-Toolchain:masterfrom
TheVeryDarkness:track-rpl-pats
Apr 22, 2026
Merged

Track RPL_PATS environment variable and pattern files#110
TheVeryDarkness merged 2 commits intoRPL-Toolchain:masterfrom
TheVeryDarkness:track-rpl-pats

Conversation

@TheVeryDarkness
Copy link
Copy Markdown
Collaborator

This should be able to fix the interaction issue between RPL and rustc's incremental mechanism.

@TheVeryDarkness
Copy link
Copy Markdown
Collaborator Author

TODO: add some basic CI for this

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Tracks RPL_PATS (env var value + referenced pattern paths) in rustc dep-info so Cargo/rustc incremental correctly invalidates when RPL’s configuration changes.

Changes:

  • Capture RPL_PATS as a Result in the driver and pass both the raw env var value and parsed paths into RplCallbacks.
  • Add RPL_PATS env dep tracking and pattern-path file dep tracking in RplCallbacks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/driver.rs Plumbs RPL_PATS env var value and parsed pattern paths into RplCallbacks.
crates/rpl_interface/src/callbacks.rs Tracks RPL_PATS in env_depinfo and adds pattern-path entries to file_depinfo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/rpl_interface/src/callbacks.rs
Comment thread src/driver.rs Outdated
Comment on lines +224 to +225
let rpl_pats_var = env::var("RPL_PATS");
let pattern_paths = match &rpl_pats_var {
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The driver hard-codes the env var name ("RPL_PATS") instead of using a shared constant (similar to rpl_interface::RPL_ARGS_ENV). Consider re-exporting/using RPL_PATS_ENV so changes to the env var name can’t silently diverge across crates.

Copilot uses AI. Check for mistakes.
Comment thread crates/rpl_interface/src/callbacks.rs
Comment on lines 104 to +123
let rpl_args_var = self.rpl_args_var.take();
let rpl_pats_var = self.rpl_pats_var.take();
let rpl_pats = self.pattern_paths.clone();
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let rpl_pats = self.pattern_paths.clone(); needlessly clones the full pattern path list just to feed dep-info tracking. Since patterns are already being collected into PATTERNS in this method, you can derive the tracked path list once from that result (or take() the option) and avoid the extra allocation/copy.

Copilot uses AI. Check for mistakes.
@TheVeryDarkness TheVeryDarkness marked this pull request as ready for review April 22, 2026 04:31
@TheVeryDarkness TheVeryDarkness merged commit bd9454f into RPL-Toolchain:master Apr 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants