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

[kbn/optimizer] Fix windows support #57592

Merged
merged 10 commits into from
Feb 14, 2020

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Feb 13, 2020

globby is used to find kibana platform plugins, but for some reason on windows it returns paths using / path separators, which infected the @kbn/optimizer and made it all the way to the Webpack config, which complains that the path is not absolute. To fix this we need to pass the paths to Path.resolve() so that they are absolute in the way we expect.

@spalger spalger added Team:Operations Team label for Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Feb 13, 2020
@spalger spalger requested a review from a team as a code owner February 13, 2020 17:02
@elasticmachine
Copy link
Contributor

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

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

code lgtm - i don't have a windows env setup. @peteharverson let me know and i can get one put together

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

C:\Users\Tyler\elastic\kibana>node scripts/build_kibana_platform_plugins
 info initialized, 0 bundles cached
 info starting worker [8 bundles, ? modules]
 info starting worker [7 bundles, ? modules]
 info starting worker [7 bundles, ? modules]
 info starting worker [7 bundles, ? modules]
 info starting worker [7 bundles, ? modules]
 info starting worker [7 bundles, ? modules]
 succ 43 bundles compiled successfully after 43.3 sec

C:\Users\Tyler\elastic\kibana>git status
On branch fix/optimizer-windows-support
Your branch is up to date with 'spalger/fix/optimizer-windows-support'.

nothing to commit, working tree clean

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 on Windows laptop, and Kibana now starts up successfully! LGTM

@spalger
Copy link
Contributor Author

spalger commented Feb 13, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Feb 13, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Feb 13, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Feb 13, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Feb 13, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Feb 13, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Feb 14, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Feb 14, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@spalger spalger merged commit 343bc9c into elastic:master Feb 14, 2020
@mistic
Copy link
Member

mistic commented Feb 14, 2020

7.x/7.7: 9f94c39

spalger pushed a commit to spalger/kibana that referenced this pull request Feb 14, 2020
* [kbn/optimizer] simplify run_workers.ts a smidge

* use Path.resolve() to create windows paths from normalized ones

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 343bc9c)
spalger pushed a commit that referenced this pull request Feb 14, 2020
* build immutable bundles for new platform plugins (#53976)

* build immutable bundles for new platform plugins

* only inspect workers if configured to do so

* [navigation] use an index.scss file

* add yarn.lock symlink

* set pluginScanDirs in test so fixtures stay consistent

* cleanup helpers a little

* fix type error

* support KBN_OPTIMIZER_MAX_WORKERS for limiting workers via env

* test support for KBN_OPTIMIZER_MAX_WORKERS

* expand the available memory for workers when only running one or two

* add docs about KBN_OPTIMIZER_MAX_WORKERS environment variable

* fix README link

* update kbn/pm dist

* implement bundle caching/reuse

* update kbn/pm dist

* don't check for cache if --no-cache is passed

* update renovate config

* standardize on index.scss, move console styles over

* add support for --no-cache to cli

* include worker config vars in optimizer version

* ignore concatenated modules

* update integration test

* add safari to browserslist to avoid user-agent warnings in dev

* update docs, clean up optimizer message/misc naming

* always handle initialized messages, don't ignore states that are attached to specific events

* reword caching docs, add environment var to disable caching

* tweak logging and don't use optimizer.useBundleCache as that's disabled in dev

* handle change notifications

* batch changes for 1 second

* rename CompilerState type to CompilerMsg

* getChanges() no longer needs to assign changes to dirs

* remove unused deps

* split up run_worker.ts and share cacheKey generation logic

* add a couple docs

* update tests and remove unused imports

* specify files when creating bundle cache key

* remove one more unused import

* match existing dev cli output more closely

* update kbn/pm dist

* set KBN_NP_PLUGINS_BUILT to avoid warning in CI

* avoid extending global window type

* add note to keep pluginScanDirs in sync

* pass browserslistEnv in workerConfig so it is used for cache key

* load commons.bundle.js in parallel too

* emit initialized+success states if all bundles are cached

* load bootstraps as quickly as possible

* skip flaky suite

* bump

* update jest snapshots

* remove hashing from cache key generation

* remove unnecessary non-null assertion

* improve docs and break up Optimizer#run()

* remove unused import

* refactor kbn/optimizer to break up observable logic, implement more helpful cache invalidation logic with logging

* fix tests

* add initializing phase

* avoid rxjs observable constructor

* remove unnecessary rxjs helper, add tests for bundle cache

* update consumers of optimizer

* update readme with new call style

* replace "new platform" with "kibana platform"

* fix a couple more renames

* add support for several plain-text file formats

* fix naming of OptimizerMsg => OptimizerUpdate, use "store" naming too

* one more OptimizerMsg update

* ensure bundles are not cached when cache config is false

* test for initializing states and bundle cache events

* remove unnecessary timeout change

* Remove unnecessary helpers

* Add tests for BundleCache class

* Add tests for Bundle class

* test summarizeEvent$

* missing paths are no longer listed in mtimes map

* add tests for optimizer/cache_keys

* Add some extra docs

* Remove labeled loop

* add integration test for kbn-optimizer watcher components

* querystring-browser removed

* tweak logging a smidge, improve info and final message

* remove unused imports

* remove duplication of getModuleCount() method

* move type annotation that validates things

* clear up the build completion message

Co-authored-by: Elastic Machine <[email protected]>

* [kbn/optimizer] Fix windows support (#57592)

* [kbn/optimizer] simplify run_workers.ts a smidge

* use Path.resolve() to create windows paths from normalized ones

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 343bc9c)

* remove istanbul/code coverage references

* fix webpack config syntax

* removal of querystring-browser was backported to 7.x

Co-authored-by: Elastic Machine <[email protected]>
@spalger spalger deleted the fix/optimizer-windows-support branch February 14, 2020 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants