Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
outDir
values are all expected to be relative to the repo, in what case would anoutDir
be outside of the repo and requireforce
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I think I found the root cause for this. On the current Node.js version on Windows (probably also happening in previous ones), as soon as we require some file/module that is contained inside a symlink it is treated by Windows like it was on a literally different but still equivalent path. In our case as we require
@kbn/optimizer
as part of the setup_node_env the problem starts right here. For example, before requiring the optimizer__dirname
returnsC:\Users\IEUser\Downloads\kibana
and after the require it while we are inside of it , it starts returningc:\users\ieuser\downlo~1\kibana
. That will also affect the result ofREPO_ROOT
that we use all over. When running node with--preserve-symlinks
it stops happening so I think we are on the right path. Aside from that, I was not able to fully bootstrap on windows as the build forkbn/ui-shared-deps
complains about a node_module that is being loaded from 2 different paths by the same reason listed above and I was in fact able to found old issues about this problem nodejs/node#6624 webpack/webpack#2362.For our Bazel work I was already working on #94046 which might also solve that issue. @peteharverson could you please try that other PR I have open to see if that alternative solution also works for you on Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mistic I gave #94046 a test, but see errors - see #94046 (comment). Let me know if you want me to try anything else.