Skip to content

Commit

Permalink
fix(bazel): api-gen rendering not working in RBE
Browse files Browse the repository at this point in the history
In Bazel v6 a bug in Bazel was fixed to address this. We cannot
update though because of `rules_nodejs`. We work around the issue,
where the output directory tree artifact not created:

bazelbuild/bazel@4310aeb
  • Loading branch information
devversion committed Oct 6, 2023
1 parent fb30926 commit c4a2ff4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bazel/api-gen/rendering/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {readFileSync, writeFileSync} from 'fs';
import {mkdirSync, readFileSync, writeFileSync} from 'fs';
import path from 'path';
import {DocEntry} from './entities';
import {getRenderable} from './processing';
Expand Down Expand Up @@ -29,6 +29,12 @@ function getNormalizedFilename(moduleName: string, entryName: string): string {
function main() {
const [srcs, outputFilenameExecRootRelativePath] = process.argv.slice(2);

// TODO: Remove when we are using Bazel v6+
// On RBE, the output directory is not created properly due to a bug.
// https://github.com/bazelbuild/bazel/commit/4310aeb36c134e5fc61ed5cdfdf683f3e95f19b7.
mkdirSync(outputFilenameExecRootRelativePath, {recursive: true})


// Docs rendering happens in three phases that occur here:
// 1) Aggregate all the raw extracted doc info.
// 2) Transform the raw data to a renderable state.
Expand Down

0 comments on commit c4a2ff4

Please sign in to comment.