File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,25 @@ well. This is to ensure that when users download a published version from NPM,
2323they will be able to install all dependencies correctly without Bazel. It is the
2424responsibility of the developer to keep both ` package.json ` in sync.
2525
26+ ## Windows support
27+
28+ In general, any sort of node file lookup on Bazel should be subject to ` require.resolve ` .
29+ This is how rules_nodejs resolves paths using the Bazel runfiles mechanism, where a given
30+ Bazel target only has access to outputs from its dependencies.
31+
32+ In practice, this does not make a lot of difference on Linux.
33+ A symlink forest is laid down where the target is going to actually run, and mostly the
34+ files are resolved correctly whether you use ` require.resolve ` or not because the files are there.
35+
36+ On Windows though, that's a stricter. Bazel does not lay down a symlink forest on
37+ windows by default. If you don't use ` require.resolve ` , it's still possible to correctly
38+ resolve some files, like outputs from other rules. But other files, like node modules
39+ dependencies and data files, need to be looked up in the runfiles.
40+
41+ Since the requirement is quite lax on Linux but quite strict on windows, what ends up
42+ happening is that lack of ` require.resolve ` calls go unnoticed until someone tries to run
43+ things on Windows, at which point it breaks.
44+
2645## Issues
2746
28471 . Yarn workspaces is not compatible with Bazel-managed deps
You canβt perform that action at this time.
0 commit comments