Skip to content

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Feb 7, 2026


Latest Update: v30 — Compare vs v29

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v30 v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v29 v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v28 v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v27 v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v26 v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v25 v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v24 v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v23 v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v22 v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v21 v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v20 v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v19 v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v18 v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v17 v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v16 v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v15 v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v14 v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v13 v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v12 v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v11 v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v10 v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v9 v8 v7 v6 v5 v4 v3 v2 v1 Base
v8 v7 v6 v5 v4 v3 v2 v1 Base
v7 v6 v5 v4 v3 v2 v1 Base
v6 v5 v4 v3 v2 v1 Base
v5 v4 v3 v2 v1 Base
v4 v3 v2 v1 Base
v3 v2 v1 Base
v2 v1 Base
v1 Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a && git checkout -b pr-G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a FETCH_HEAD

Checkout

git fetch origin refs/heads/G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a

Stacked PRs enabled by GHerrit.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joshlf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors how Hermes resolves and manages critical build directories. It introduces explicit tracking for both the Cargo target directory and a uniquely generated shadow root, enhancing build isolation and preventing potential conflicts across different workspaces. Furthermore, it ensures that the shadow directory is always created in a clean state, improving build reliability and consistency.

Highlights

  • Explicit Target Directory Management: Introduced new fields cargo_target_dir and shadow_root to the Roots struct in resolve.rs to explicitly manage the Cargo build output directory and the Hermes-specific shadow directory.
  • Unique Shadow Path Resolution: Implemented a resolve_shadow_path function that generates a unique path for the shadow directory. This path is derived by hashing the workspace root with a salt and combining it with the Cargo target directory, preventing potential collisions when multiple workspaces might share the same target directory.
  • Clean Shadow Skeleton Creation: Modified the create_shadow_skeleton function in shadow.rs to ensure a clean state for the shadow directory. It now explicitly removes the destination root if it already exists before recreating it, guaranteeing that previous build artifacts do not interfere.
  • Updated Shadow Skeleton Call: The main.rs file was updated to pass the newly resolved shadow_root and cargo_target_dir to the create_shadow_skeleton function, integrating the new path resolution logic.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • tools/hermes/src/main.rs
    • Updated the create_shadow_skeleton function call to include shadow_root and cargo_target_dir arguments.
  • tools/hermes/src/resolve.rs
    • Added cargo_target_dir and shadow_root fields to the Roots struct.
    • Implemented the resolve_shadow_path function to compute a unique shadow directory path based on the workspace root and Cargo target directory.
    • Populated the new cargo_target_dir and shadow_root fields within the resolve_roots function.
  • tools/hermes/src/shadow.rs
    • Modified create_shadow_skeleton to remove the dest_root if it exists and then recreate it, ensuring a clean directory for the shadow skeleton.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces logic to resolve Cargo's target directory and create a unique, hashed shadow directory for Hermes. This is a good approach to avoid collisions between different workspaces. The change to clean the shadow directory before creating it is also a solid improvement for ensuring a clean state. My primary feedback relates to the choice of hashing algorithm, which could be improved for better cross-platform and cross-version stability.

Comment on lines +162 to +167
let workspace_root_hash = {
let mut hasher = std::hash::DefaultHasher::new();
hasher.write(b"hermes_shadow_salt");
metadata.workspace_root.hash(&mut hasher);
hasher.finish()
};
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

std::hash::DefaultHasher is not guaranteed to be stable across different Rust versions, or even between 32-bit and 64-bit platforms. This means the generated shadow path could change unexpectedly, which could cause problems with build caching and reproducibility.

For a build tool where deterministic output is important, it's better to use a stable hashing algorithm. A simple and fast option is FnvHasher from the fnv crate.

Here is an example of how you could use it:

  1. Add fnv to tools/hermes/Cargo.toml:
[dependencies]
# ...
fnv = "1.0"
  1. Update the code to use FnvHasher:
// Add to imports: use fnv::FnvHasher;
let workspace_root_hash = {
    let mut hasher = FnvHasher::default();
    hasher.write(b"hermes_shadow_salt");
    metadata.workspace_root.hash(&mut hasher);
    hasher.finish()
};

@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (Gdc72294eb3c40c4afa61ea6e8f965ba310cd22ef@c475f79). Learn more about missing BASE report.

Additional details and impacted files
@@                             Coverage Diff                              @@
##             Gdc72294eb3c40c4afa61ea6e8f965ba310cd22ef    #3007   +/-   ##
============================================================================
  Coverage                                             ?   91.87%           
============================================================================
  Files                                                ?       20           
  Lines                                                ?     6057           
  Branches                                             ?        0           
============================================================================
  Hits                                                 ?     5565           
  Misses                                               ?      492           
  Partials                                             ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joshlf
Copy link
Member Author

joshlf commented Feb 7, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces logic to resolve paths for Cargo's target directory and a new "shadow" directory for Hermes. The changes are generally in the right direction, but I've identified a couple of issues. In resolve.rs, the use of DefaultHasher could lead to path instability across different Rust versions, which might clutter the target directory over time. More critically, the directory cleanup logic in shadow.rs is not robust and can cause the tool to fail under certain filesystem conditions, such as when the destination path is a file or a dangling symlink. I've provided detailed feedback and a suggested fix for this critical issue.

Comment on lines +20 to +23
if dest_root.exists() {
std::fs::remove_dir_all(&dest_root)?;
}
std::fs::create_dir_all(&dest_root)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The current logic for cleaning the destination directory has a couple of race conditions and bugs that can cause the tool to fail unexpectedly:

  1. If dest_root is a dangling symlink, dest_root.exists() returns false. The code then proceeds to std::fs::create_dir_all, which will fail because the path is already occupied by the symlink.
  2. If dest_root is a file (not a directory), dest_root.exists() returns true, but std::fs::remove_dir_all will fail on Unix-like systems, causing an unhandled error.

A more robust approach is needed to handle all these filesystem states correctly.

Suggested change
if dest_root.exists() {
std::fs::remove_dir_all(&dest_root)?;
}
std::fs::create_dir_all(&dest_root)?;
if dest_root.symlink_metadata().is_ok() {
// The path exists. To ensure a clean state, we remove it.
// This handles files, directories, and symlinks (including dangling ones).
std::fs::remove_dir_all(dest_root).or_else(|_| std::fs::remove_file(dest_root))?;
}
std::fs::create_dir_all(dest_root)?;

// Hash the path to the workspace root to avoid collisions between different
// workspaces using the same target directory.
let workspace_root_hash = {
let mut hasher = std::hash::DefaultHasher::new();
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

std::hash::DefaultHasher is not guaranteed to produce the same hash across different Rust versions or platforms. This means that if the Rust toolchain is updated, the generated hash for the workspace path might change. This would result in a new hermes_shadow_* directory being created in your target directory, leaving the old one as an orphaned artifact.

While this is not a correctness issue for a single run (as the shadow directory is cleaned), it can lead to clutter in the build output directory over time. If a stable path is desirable, consider using a stable hashing algorithm. You could use a hasher from a crate like seahash or ahash with a fixed seed, or a cryptographic hash like SHA-2.

gherrit-pr-id: G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a
@joshlf joshlf force-pushed the Gdc72294eb3c40c4afa61ea6e8f965ba310cd22ef branch from 169b4eb to c475f79 Compare February 10, 2026 00:50
@joshlf joshlf force-pushed the G48b27aa33306f1b4bae6f7996a68c1a1869d0a9a branch from 7ee6fde to 1f72412 Compare February 10, 2026 00:50
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