Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(NA): run del with force option on ref_output_cache #94307

Closed

Conversation

mistic
Copy link
Member

@mistic mistic commented Mar 10, 2021

Looks like deleting the build_refs caches is failing on Windows and that is fixed by running del with force option.

@mistic mistic added chore Team:Operations Team label for Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.13.0 labels Mar 10, 2021
@mistic mistic requested review from spalger and peteharverson March 10, 2021 15:14
@mistic mistic requested a review from a team as a code owner March 10, 2021 15:14
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mistic mistic enabled auto-merge (squash) March 10, 2021 17:31
@mistic mistic added the auto-backport Deprecated - use backport:version if exact versions are needed label Mar 10, 2021
@@ -130,7 +130,7 @@ export class RefOutputCache {
}

this.log.debug(`[${relative}] clearing outDir and replacing with cache`);
await del(outDir);
await del(outDir, { force: true });
Copy link
Contributor

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 an outDir be outside of the repo and require force?

Copy link
Member Author

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 returns C:\Users\IEUser\Downloads\kibana and after the require it while we are inside of it , it starts returning c:\users\ieuser\downlo~1\kibana. That will also affect the result of REPO_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 for kbn/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?

Copy link
Contributor

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.

@mistic
Copy link
Member Author

mistic commented Mar 12, 2021

Closing in favor of #94046

@mistic mistic closed this Mar 12, 2021
auto-merge was automatically disabled March 12, 2021 04:09

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed chore release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants