Skip to content

[flow] Fix Windows path separator mismatches in File_key and flowconfig expansion (#9402)#9402

Open
panagosg7 wants to merge 1 commit intomainfrom
export-D102285839
Open

[flow] Fix Windows path separator mismatches in File_key and flowconfig expansion (#9402)#9402
panagosg7 wants to merge 1 commit intomainfrom
export-D102285839

Conversation

@panagosg7
Copy link
Copy Markdown
Contributor

@panagosg7 panagosg7 commented Apr 24, 2026

Summary:

Normalize directory separators to '/' in File_key suffixes at creation time (strip_project_root, lib_file_of_absolute) so that file keys are always '/'-based regardless of platform. This fixes the Graph.NodeNotFound crash when loading Linux-generated saved state on Windows, where ''-based local file keys failed to match '/'-based saved state keys.

Also normalize separators in expand_project_root_token_as_relative so that flowconfig directives like module.system.node.root_relative_dirname with <PROJECT_ROOT> prefixes produce '/'-based paths, matching the now-normalized File_key suffixes. Without this, Files.is_prefix would append '' on Windows while suffixes use '/', breaking root-relative module resolution.

Fix Files.is_prefix to append '/' instead of Filename.dir_sep when the prefix lacks a trailing separator. Previously, is_prefix would append '' on Windows, which failed to match the now '/'-based File_key suffixes — breaking scoped root-relative module resolution (e.g., the config_module_system_node_root_relative_dirnames test).

Both normalizations are no-ops on Unix.

Changelog: [internal]

Differential Revision: D102285839

@meta-cla meta-cla Bot added the CLA Signed label Apr 24, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 24, 2026

@panagosg7 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D102285839.

@meta-codesync meta-codesync Bot changed the title [flow] Fix Windows path separator mismatches in File_key and flowconfig expansion [flow] Fix Windows path separator mismatches in File_key and flowconfig expansion (#9402) Apr 24, 2026
meta-codesync Bot pushed a commit that referenced this pull request Apr 24, 2026
…ig expansion (#9402)

Summary:

Normalize directory separators to '/' in File_key suffixes at creation time (strip_project_root, lib_file_of_absolute) so that file keys are always '/'-based regardless of platform. This fixes the Graph.NodeNotFound crash when loading Linux-generated saved state on Windows, where '\'-based local file keys failed to match '/'-based saved state keys.

Also normalize separators in expand_project_root_token_as_relative so that flowconfig directives like module.system.node.root_relative_dirname with <PROJECT_ROOT> prefixes produce '/'-based paths, matching the now-normalized File_key suffixes. Without this, Files.is_prefix would append '\' on Windows while suffixes use '/', breaking root-relative module resolution.

Fix Files.is_prefix to append '/' instead of Filename.dir_sep when the prefix lacks a trailing separator. Previously, is_prefix would append '\' on Windows, which failed to match the now '/'-based File_key suffixes — breaking scoped root-relative module resolution (e.g., the `config_module_system_node_root_relative_dirnames` test).


Both normalizations are no-ops on Unix.

Changelog: [internal]

Differential Revision: D102285839
@meta-codesync meta-codesync Bot force-pushed the export-D102285839 branch from f709109 to 20799ad Compare April 24, 2026 23:52
meta-codesync Bot pushed a commit that referenced this pull request Apr 25, 2026
…ig expansion (#9402)

Summary:

Normalize directory separators to '/' in File_key suffixes at creation time (strip_project_root, lib_file_of_absolute) so that file keys are always '/'-based regardless of platform. This fixes the Graph.NodeNotFound crash when loading Linux-generated saved state on Windows, where '\'-based local file keys failed to match '/'-based saved state keys.

Also normalize separators in expand_project_root_token_as_relative so that flowconfig directives like module.system.node.root_relative_dirname with <PROJECT_ROOT> prefixes produce '/'-based paths, matching the now-normalized File_key suffixes. Without this, Files.is_prefix would append '\' on Windows while suffixes use '/', breaking root-relative module resolution.

Fix Files.is_prefix to append '/' instead of Filename.dir_sep when the prefix lacks a trailing separator. Previously, is_prefix would append '\' on Windows, which failed to match the now '/'-based File_key suffixes — breaking scoped root-relative module resolution (e.g., the `config_module_system_node_root_relative_dirnames` test).


Both normalizations are no-ops on Unix.

Changelog: [internal]

Differential Revision: D102285839
@meta-codesync meta-codesync Bot force-pushed the export-D102285839 branch from 20799ad to 98d520e Compare April 25, 2026 01:52
meta-codesync Bot pushed a commit that referenced this pull request Apr 25, 2026
…ig expansion (#9402)

Summary:

Normalize directory separators to '/' in File_key suffixes at creation time (strip_project_root, lib_file_of_absolute) so that file keys are always '/'-based regardless of platform. This fixes the Graph.NodeNotFound crash when loading Linux-generated saved state on Windows, where '\'-based local file keys failed to match '/'-based saved state keys.

Also normalize separators in expand_project_root_token_as_relative so that flowconfig directives like module.system.node.root_relative_dirname with <PROJECT_ROOT> prefixes produce '/'-based paths, matching the now-normalized File_key suffixes. Without this, Files.is_prefix would append '\' on Windows while suffixes use '/', breaking root-relative module resolution.

Fix Files.is_prefix to append '/' instead of Filename.dir_sep when the prefix lacks a trailing separator. Previously, is_prefix would append '\' on Windows, which failed to match the now '/'-based File_key suffixes — breaking scoped root-relative module resolution (e.g., the `config_module_system_node_root_relative_dirnames` test).


Both normalizations are no-ops on Unix.

Changelog: [internal]

Differential Revision: D102285839
@meta-codesync meta-codesync Bot force-pushed the export-D102285839 branch from 98d520e to 4e067c0 Compare April 25, 2026 03:11
meta-codesync Bot pushed a commit that referenced this pull request Apr 25, 2026
…ig expansion (#9402)

Summary:

Normalize directory separators to '/' in File_key suffixes at creation time (strip_project_root, lib_file_of_absolute) so that file keys are always '/'-based regardless of platform. This fixes the Graph.NodeNotFound crash when loading Linux-generated saved state on Windows, where '\'-based local file keys failed to match '/'-based saved state keys.

Also normalize separators in expand_project_root_token_as_relative so that flowconfig directives like module.system.node.root_relative_dirname with <PROJECT_ROOT> prefixes produce '/'-based paths, matching the now-normalized File_key suffixes. Without this, Files.is_prefix would append '\' on Windows while suffixes use '/', breaking root-relative module resolution.

Fix Files.is_prefix to append '/' instead of Filename.dir_sep when the prefix lacks a trailing separator. Previously, is_prefix would append '\' on Windows, which failed to match the now '/'-based File_key suffixes — breaking scoped root-relative module resolution (e.g., the `config_module_system_node_root_relative_dirnames` test).


Both normalizations are no-ops on Unix.

Changelog: [internal]

Differential Revision: D102285839
@meta-codesync meta-codesync Bot force-pushed the export-D102285839 branch from 4e067c0 to 07c9699 Compare April 25, 2026 04:55
…ig expansion (#9402)

Summary:

Normalize directory separators to '/' in File_key suffixes at creation time (strip_project_root, lib_file_of_absolute) so that file keys are always '/'-based regardless of platform. This fixes the Graph.NodeNotFound crash when loading Linux-generated saved state on Windows, where '\'-based local file keys failed to match '/'-based saved state keys.

Also normalize separators in expand_project_root_token_as_relative so that flowconfig directives like module.system.node.root_relative_dirname with <PROJECT_ROOT> prefixes produce '/'-based paths, matching the now-normalized File_key suffixes. Without this, Files.is_prefix would append '\' on Windows while suffixes use '/', breaking root-relative module resolution.

Fix Files.is_prefix to append '/' instead of Filename.dir_sep when the prefix lacks a trailing separator. Previously, is_prefix would append '\' on Windows, which failed to match the now '/'-based File_key suffixes — breaking scoped root-relative module resolution (e.g., the `config_module_system_node_root_relative_dirnames` test).


Both normalizations are no-ops on Unix.

Changelog: [internal]

Differential Revision: D102285839
@meta-codesync meta-codesync Bot force-pushed the export-D102285839 branch from 07c9699 to 90f0cb7 Compare April 25, 2026 05:03
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.

1 participant