Skip to content

Commit

Permalink
/bin/bash does not exist on certain systems
Browse files Browse the repository at this point in the history
Bazel and rules_scala refer to `/bin/bash` which does not exist on certain systems. In particular on [NixOS](https://nixos.org/) where the issue was discovered. Replacing `/bin/bash` by `/usr/bin/env bash` resolves the issue.

On NixOS this problem is usually circumvented by the corresponding package description for bazel patching these paths. However, rules_scala downloads the `java_stub_template` directly from the GitHub repository. See the corresponding [issue on rules_scala][rules_scala_issue] for more information.

This PR replaces `/bin/bash` by `/usr/bin/env bash` in `java_stub_template`.

[rules_scala_issue]: bazelbuild/rules_scala#595

Closes #5979.

PiperOrigin-RevId: 212782646
  • Loading branch information
aherrmann authored and Copybara-Service committed Sep 13, 2018
1 parent faaff7f commit 8662202
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash --posix
#!/usr/bin/env bash
# Copyright 2014 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -44,6 +44,8 @@
#
# The remainder of the command line is passed to the program.

set -o posix

# Make it easy to insert 'set -x' or similar commands when debugging problems with this script.
eval "$JAVA_STUB_DEBUG"

Expand Down

0 comments on commit 8662202

Please sign in to comment.