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 0586b11
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 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
3 changes: 1 addition & 2 deletions commands/bazel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const {bazel} = require('../utils/binary-paths.js');
const {spawnOrExit} = require('../utils/node-helpers.js');
const {getPassThroughArgs} = require('../utils/parse-argv.js');
const {startupFlags} = require('../utils/bazel-commands.js');

/*::
import type {Stdio} from '../utils/node-helpers.js';
Expand All @@ -16,7 +15,7 @@ export type Bazel = (BazelArgs) => Promise<void>
*/
const runBazel /*: Bazel */ = async ({root, args, stdio = 'inherit'}) => {
const params = getPassThroughArgs(args);
await spawnOrExit(bazel, [...startupFlags, ...params], {
await spawnOrExit(bazel, [...params], {
stdio,
env: {...process.env},
cwd: root,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jazelle",
"version": "0.0.0-standalone.97",
"version": "0.0.0-alpha.98",
"main": "index.js",
"bin": {
"barn": "bin/bootstrap.sh",
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 0586b11

Please sign in to comment.