Skip to content

Conversation

@captbaritone
Copy link
Contributor

Summary

Fixes 61 failing Rust integration tests on Windows by normalizing path separators in artifact map debug output.

Problem

The Rust tests in relay_compiler_relay_compiler_integration_test were failing on Windows with snapshot mismatches like:

- Path: __generated__/barMutation.graphql.js
+ Path: __generated__\barMutation.graphql.js

This occurred because PathBuf's Debug implementation uses platform-native path separators (backslashes on Windows), but the test snapshots expect forward slashes for cross-platform consistency.

Solution

Added a custom Debug implementation for ArtifactRecord in compiler/crates/relay-compiler/src/artifact_map.rs that:

  1. Converts paths to strings using to_string_lossy()
  2. Replaces all backslashes with forward slashes
  3. Uses the normalized path in the debug output

Testing

This fix targets the Windows-specific test failures. CI will verify:

  • All 61 previously failing tests on Windows now pass
  • Existing tests on macOS and Linux continue to pass
  • No regressions in other test suites

Related

Fixes CI failures visible in recent runs on the main branch.

The Rust tests were failing on Windows because PathBuf's Debug
implementation uses backslashes on Windows but the test snapshots
expect forward slashes.

This adds a custom Debug implementation for ArtifactRecord that
normalizes path separators to forward slashes for cross-platform
consistency.

Fixes 61 failing tests in relay_compiler_relay_compiler_integration_test
on Windows.
The previous fix in artifact_map.rs wasn't being used. The actual path
formatting happens in ProjectArtifactMap's Debug impl in compiler_state.rs.

This normalizes the path separators when formatting the artifact map for
test output.
@captbaritone
Copy link
Contributor Author

This was created as a validation of #5129. I already had a better hand-crafted fix in D90190629

meta-codesync bot pushed a commit that referenced this pull request Jan 13, 2026
Summary:
Now you can open Calude in the Relay repo and run `/fix-ci` to have Claude attempt to fix any CI issues.

Example PR created with this command: #5128

Pull Request resolved: #5129

Reviewed By: evanyeung

Differential Revision: D90196913

Pulled By: captbaritone

fbshipit-source-id: 817dcda33cb17b4fdea6efc2d4c98d645208a75a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants