Skip to content

Commit 2676400

Browse files
aherrmannittaiz
authored andcommitted
/bin/bash does not exist on certain systems (bazelbuild#615)
* Convert shebang /bin/bash -> /usr/bin/env bash /bin/bash does not exist on some systems, notably [NixOS][1] and some of the [BSDs][2]. Using `/usr/bin/env bash` is the more compatible option. [1]: https://nixos.org/ [2]: https://stackoverflow.com/a/21613044/841562 * Use patched version of java_stub_template
1 parent a0436ef commit 2676400

12 files changed

+13
-13
lines changed

lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright 2018 The Bazel Authors. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");

scala/private/rule_impls.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def _write_java_wrapper(ctx, args = "", wrapper_preamble = ""):
493493
wrapper = ctx.actions.declare_file(ctx.label.name + "_wrapper.sh")
494494
ctx.actions.write(
495495
output = wrapper,
496-
content = """#!/bin/bash
496+
content = """#!/usr/bin/env bash
497497
{preamble}
498498
499499
{exec_str}{javabin} "$@" {args}

scala/scala.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def scala_repositories(
362362
)
363363

364364
# Template for binary launcher
365-
BAZEL_JAVA_LAUNCHER_VERSION = "0.14.1"
365+
BAZEL_JAVA_LAUNCHER_VERSION = "0.17.1"
366366
java_stub_template_url = (
367367
"raw.githubusercontent.com/bazelbuild/bazel/" +
368368
BAZEL_JAVA_LAUNCHER_VERSION +
@@ -375,7 +375,7 @@ def scala_repositories(
375375
"https://%s" % java_stub_template_url
376376
],
377377
sha256 =
378-
"2cbba7c512e400df0e7d4376e667724a38d1155db5baaa81b72ad785c6d761d1",
378+
"39097bdc47407232e0fe7eed4f2c175c067b7eda95873cb76ffa76f1b4c18895",
379379
)
380380

381381
native.bind(

test/test_binary.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
echo "Executing: " $@
44
$@

test_all.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -euo pipefail
44

test_intellij_aspect.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Test the IntelliJ aspect. Override intellij's rules_scala with this one for an
44
# integration test. See https://github.com/bazelbuild/rules_scala/issues/308.

test_lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -eou pipefail
44

test_reproducibility.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

test_rules_scala.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

test_runner.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Test runner functions for rules_scala integration tests.
44

test_version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
echo "Executing: " $@
44
$@

0 commit comments

Comments
 (0)