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

Remove bazel startup options in favor of .bazelrc #163

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
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
Loading