Skip to content
Open
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f39ffd9
chore(gapic-generator-typescript): remove bazel dependency from build
GautamSharda Apr 6, 2026
24c6dc3
chore(gapic-generator-typescript): remove bazel dependency from build
GautamSharda Apr 6, 2026
df8f12f
Merge branch 'bazel' of https://github.com/googleapis/google-cloud-no…
GautamSharda Apr 6, 2026
1f7b615
chore: resolve merge conflicts with main
GautamSharda Apr 6, 2026
c121a9e
Merge branch 'main' into bazel
GautamSharda Apr 6, 2026
d3c679a
ci: fix generator tests after bazel removal
GautamSharda Apr 6, 2026
2daccb9
Merge branch 'bazel' of https://github.com/googleapis/google-cloud-no…
GautamSharda Apr 6, 2026
8ef6196
test: fix permission denied error in generator baselines
GautamSharda Apr 7, 2026
32a2130
fix: ensure templates are copied to build dir during compilation
GautamSharda Apr 7, 2026
f0eefc4
fix: rely on system protoc in CI
GautamSharda Apr 7, 2026
ebb1a64
ci: install protoc before running generator tests
GautamSharda Apr 7, 2026
db1eeff
test: provide PROTOC_PATH in CI
GautamSharda Apr 7, 2026
5da5416
fix: ensure protoc-plugin is executed with node
GautamSharda Apr 7, 2026
7e0eac9
ci: execute error conformance plugin with node
GautamSharda Apr 7, 2026
98d0c01
fix: ensure protoc-plugin is executable for protoc
GautamSharda Apr 7, 2026
ff718a1
fix: enable --experimental_editions in protoc
GautamSharda Apr 7, 2026
8027ef8
ci: revert gapic-error-conformance plugin execution
GautamSharda Apr 8, 2026
dd4bbb2
Merge branch 'main' into bazel
GautamSharda Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: ensure protoc-plugin is executable for protoc
When protoc invokes a plugin via the --plugin=name=path flag,
it expects 'path' to be an actual executable binary/script.
Prepending 'node' to the path caused protoc to fail to find
the executable.

This commit updates gapic-generator-typescript to explicitly
run fs.chmodSync(pluginPath, 0o755) before passing the path
to protoc, ensuring the generated script is executable and
can use its node shebang.
  • Loading branch information
GautamSharda committed Apr 7, 2026
commit 98d0c014d60393e36a00326fafdb62e51c4aba67
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,21 @@ async function main(processArgv: string[]) {
// Just in case if someone builds us without bazel, let's have a fallback to an actual
// JS protoc plugin without a wrapper.
const protocPluginBash = path.join(__dirname, '..', 'protoc_plugin.sh');
const protocPlugin = fs.existsSync(protocPluginBash)
let protocPlugin = fs.existsSync(protocPluginBash)
? protocPluginBash
: `node ${path.join(__dirname, 'protoc-plugin.js')}`;
: path.join(__dirname, 'protoc-plugin.js');

if (protocPlugin.endsWith('.js') && process.platform === 'win32') {
protocPlugin = `node ${protocPlugin}`;
} else if (protocPlugin.endsWith('.js')) {
// In Unix, protoc expects an actual executable file. We cannot pass "node file.js".
// Instead, we ensure the file has execution permissions so the shebang takes over.
try {
fs.chmodSync(protocPlugin, 0o755);
} catch (e) {
// ignore
}
}

const argv = await yargs(processArgv)
.array('I')
Expand Down
Loading