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

fix(bazel): pass custom bazel compiler host rather than rewriting one #31496

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 5 additions & 8 deletions packages/bazel/src/ngc-wrapped/index.ts
Expand Up @@ -145,15 +145,15 @@ export function relativeToRootDirs(filePath: string, rootDirs: string[]): string
}

export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost, bazelOpts, files,
inputs, expectedOuts, gatherDiagnostics, oldBazelHost}: {
inputs, expectedOuts, gatherDiagnostics, bazelHost}: {
allDepsCompiledWithBazel?: boolean,
compilerOpts: ng.CompilerOptions,
tsHost: ts.CompilerHost, inputs?: {[path: string]: string},
bazelOpts: BazelOptions,
files: string[],
expectedOuts: string[],
gatherDiagnostics?: (program: ng.Program) => ng.Diagnostics,
oldBazelHost?: CompilerHost,
bazelHost?: CompilerHost,
}): {diagnostics: ng.Diagnostics, program: ng.Program} {
let fileLoader: FileLoader;

Expand Down Expand Up @@ -246,12 +246,9 @@ export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost,
moduleName, containingFile, compilerOptions, generatedFileModuleResolverHost);
}

const bazelHost = new CompilerHost(
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);
if (oldBazelHost) {
// TODO(ayazhafiz): this kind of patching is hacky. Revisit this after the
// indexer consumer of this code is known to be working.
Object.assign(bazelHost, oldBazelHost);
if (!bazelHost) {
bazelHost = new CompilerHost(
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);
}

// Also need to disable decorator downleveling in the BazelHost in Ivy mode.
Expand Down