chore(NA): stop grouping bazel out symlink folders (#96066)

This commit is contained in:
Tiago Costa 2021-04-01 20:16:14 +01:00 committed by GitHub
parent 574391985b
commit 7c689a5b5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 15 deletions

View file

@ -8,7 +8,10 @@
.idea
.teamcity
.yarn-local-mirror
/bazel
bazel-bin
bazel-kibana
bazel-out
bazel-testlogs
build
node_modules
target

View file

@ -18,17 +18,16 @@ build --disk_cache=~/.bazel-cache/disk-cache
build --repository_cache=~/.bazel-cache/repository-cache
# Bazel will create symlinks from the workspace directory to output artifacts.
# Build results will be placed in a directory called "bazel/bin"
# Build results will be placed in a directory called "bazel-bin"
# This will still create a bazel-out symlink in
# the project directory, which must be excluded from the
# editor's search path.
build --symlink_prefix=bazel/
# To disable the symlinks altogether (including bazel-out) we can use
# build --symlink_prefix=/
# however this makes it harder to find outputs.
# Prevents the creation of bazel-out dir
build --experimental_no_product_name_out_symlink
# build --experimental_no_product_name_out_symlink
# Make direct file system calls to create symlink trees
build --experimental_inprocess_symlink_creation

View file

@ -48,4 +48,4 @@ snapshots.js
/packages/kbn-monaco/src/painless/antlr
# Bazel
/bazel
/bazel-*

4
.gitignore vendored
View file

@ -75,5 +75,5 @@ report.asciidoc
.yarn-local-mirror
# Bazel
/bazel
/.bazelrc.user
bazel-*
.bazelrc.user

View file

@ -1,3 +1,4 @@
x-pack/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss
build
target
bazel-*

View file

@ -22981,7 +22981,7 @@ class Project {
ensureValidProjectDependency(project) {
const relativePathToProject = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, project.path));
const relativePathToProjectIfBazelPkg = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, `bazel/bin/packages/${path__WEBPACK_IMPORTED_MODULE_1___default.a.basename(project.path)}`));
const relativePathToProjectIfBazelPkg = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, `bazel-bin/packages/${path__WEBPACK_IMPORTED_MODULE_1___default.a.basename(project.path)}`));
const versionInPackageJson = this.allDependencies[project.name];
const expectedVersionInPackageJson = `link:${relativePathToProject}`;
const expectedVersionInPackageJsonIfBazelPkg = `link:${relativePathToProjectIfBazelPkg}`; // TODO: after introduce bazel to build all the packages and completely remove the support for kbn packages
@ -23143,7 +23143,7 @@ const createProductionPackageJson = pkgJson => _objectSpread(_objectSpread({}, p
dependencies: transformDependencies(pkgJson.dependencies)
});
const isLinkDependency = depVersion => depVersion.startsWith('link:');
const isBazelPackageDependency = depVersion => depVersion.startsWith('link:bazel/bin/');
const isBazelPackageDependency = depVersion => depVersion.startsWith('link:bazel-bin/');
/**
* Replaces `link:` dependencies with `file:` dependencies. When installing
* dependencies, these `file:` dependencies will be copied into `node_modules`
@ -23153,7 +23153,7 @@ const isBazelPackageDependency = depVersion => depVersion.startsWith('link:bazel
* will then _copy_ the `file:` dependencies into `node_modules` instead of
* symlinking like we do in development.
*
* Additionally it also taken care of replacing `link:bazel/bin/` with
* Additionally it also taken care of replacing `link:bazel-bin/` with
* `file:` so we can also support the copy of the Bazel packages dist already into
* build/packages to be copied into the node_modules
*/
@ -23170,7 +23170,7 @@ function transformDependencies(dependencies = {}) {
}
if (isBazelPackageDependency(depVersion)) {
newDeps[name] = depVersion.replace('link:bazel/bin/', 'file:');
newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:');
continue;
}

View file

@ -35,7 +35,7 @@ export const createProductionPackageJson = (pkgJson: IPackageJson) => ({
export const isLinkDependency = (depVersion: string) => depVersion.startsWith('link:');
export const isBazelPackageDependency = (depVersion: string) =>
depVersion.startsWith('link:bazel/bin/');
depVersion.startsWith('link:bazel-bin/');
/**
* Replaces `link:` dependencies with `file:` dependencies. When installing
@ -46,7 +46,7 @@ export const isBazelPackageDependency = (depVersion: string) =>
* will then _copy_ the `file:` dependencies into `node_modules` instead of
* symlinking like we do in development.
*
* Additionally it also taken care of replacing `link:bazel/bin/` with
* Additionally it also taken care of replacing `link:bazel-bin/` with
* `file:` so we can also support the copy of the Bazel packages dist already into
* build/packages to be copied into the node_modules
*/
@ -61,7 +61,7 @@ export function transformDependencies(dependencies: IPackageDependencies = {}) {
}
if (isBazelPackageDependency(depVersion)) {
newDeps[name] = depVersion.replace('link:bazel/bin/', 'file:');
newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:');
continue;
}

View file

@ -92,7 +92,7 @@ export class Project {
public ensureValidProjectDependency(project: Project) {
const relativePathToProject = normalizePath(Path.relative(this.path, project.path));
const relativePathToProjectIfBazelPkg = normalizePath(
Path.relative(this.path, `bazel/bin/packages/${Path.basename(project.path)}`)
Path.relative(this.path, `bazel-bin/packages/${Path.basename(project.path)}`)
);
const versionInPackageJson = this.allDependencies[project.name];