Skip to content

Commit

Permalink
Remove implicit startup options in favor of .bazelrc
Browse files Browse the repository at this point in the history
  • Loading branch information
shYkiSto committed Dec 20, 2024
1 parent 172581c commit 8cbf761
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ run() {
ACTUAL_VERSION=$(cat "$ROOT/bazel-bin/jazelle.runfiles/jazelle/package.json" | grep version | awk '{print substr($2, 2, length($2) - 3)}')
if ! grep "$ACTUAL_VERSION" "$ROOT/WORKSPACE" || [[ $ACTUAL_VERSION = "" ]] || [ ! -f "$ROOT/bazel-bin/jazelle.runfiles/jazelle/bin/cli.sh" ]
then
"$BAZELISK_PATH" --host_jvm_args=-Xmx15g run //:jazelle -- setup 2>/tmp/jazelle.log || true
"$BAZELISK_PATH" run //:jazelle -- setup 2>/tmp/jazelle.log || true
fi
fi
}
Expand Down
33 changes: 11 additions & 22 deletions utils/bazel-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const {randomBytes} = require('crypto');
const {bazel, node} = require('./binary-paths.js');
const {spawnOrExit, exec: nodeExec} = require('./node-helpers.js');

const startupFlags = ['--host_jvm_args=-Xmx15g'];

/*::
import type {Stdio} from './node-helpers.js';
export type {ExecException as BazelQueryException} from './node-helpers.js';
Expand All @@ -27,7 +25,7 @@ const build /*: Build */ = async ({
stdio = 'inherit',
}) => {
cwd = relative(root, cwd);
await spawnOrExit(bazel, [...startupFlags, 'build', `//${cwd}:${name}`], {
await spawnOrExit(bazel, ['build', `//${cwd}:${name}`], {
stdio,
env: {...process.env},
cwd: root,
Expand All @@ -53,15 +51,11 @@ const test /*: Test */ = async ({
}) => {
cwd = relative(root, cwd);
const testParams = args.map(arg => `--test_arg=${arg}`);
await spawnOrExit(
bazel,
[...startupFlags, 'run', `//${cwd}:${name}`, ...testParams],
{
stdio,
env: {...process.env},
cwd: root,
}
);
await spawnOrExit(bazel, ['run', `//${cwd}:${name}`, ...testParams], {
stdio,
env: {...process.env},
cwd: root,
});
};

/*::
Expand All @@ -83,15 +77,11 @@ const run /*: Run */ = async ({
}) => {
cwd = relative(root, cwd);
const runParams = args.length > 0 ? ['--', ...args] : [];
await spawnOrExit(
bazel,
[...startupFlags, 'run', `//${cwd}:${name}`, ...runParams],
{
stdio,
env: {...process.env},
cwd: root,
}
);
await spawnOrExit(bazel, ['run', `//${cwd}:${name}`, ...runParams], {
stdio,
env: {...process.env},
cwd: root,
});
};

/*::
Expand Down Expand Up @@ -232,7 +222,6 @@ const bazelQuery /*: BazelQuery */ = async ({cwd, query, args = []}) => {
};

module.exports = {
startupFlags,
bazelQuery,
build,
test,
Expand Down

0 comments on commit 8cbf761

Please sign in to comment.