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

Bash, runfiles lib v2: shorter init code #8461

Closed
wants to merge 1 commit into from

Conversation

laszlocsomor
Copy link
Contributor

@laszlocsomor laszlocsomor commented May 24, 2019

The Bash Runfiles Library is now at its version 2.

The new version:

  • has a shorter init code (copy-pasted "stanza")
  • has a long (more readable but equivalent)
    version of the new init code, which is suitable
    if the source file's line length is limited

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:

  • two mock binaries with the init code
  • an actual test (help_test.sh) the init code

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see tools/bash/runfiles/runfiles.bash. The rlocation() implementation is the same.

@laszlocsomor laszlocsomor force-pushed the bash-rf-lib branch 4 times, most recently from 2041eed to d9b5de4 Compare May 27, 2019 08:31
The Bash Runfiles Library is now at its version 2.

The new version has a shorter init code
(copy-pasted "stanza"). The rlocation() function
is unchanged.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

To demonstrate correctness, I updated:
- mock binaries used in the runfiles tests
- an actual test (help_test.sh)
@laszlocsomor laszlocsomor changed the title WIP: Bash, runfiles lib v2: shorter init code Bash, runfiles lib v2: shorter init code May 27, 2019
@laszlocsomor laszlocsomor requested a review from meteorcloudy May 27, 2019 09:39
@laszlocsomor
Copy link
Contributor Author

FYI @alexeagle

@bazel-io bazel-io closed this in 229fe56 May 27, 2019
bazel-io pushed a commit that referenced this pull request May 28, 2019
*** Reason for rollback ***

Broke many Bazel downstream projects

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1002#_

Culprit Finder: https://buildkite.com/bazel/culprit-finder/builds/162

*** Original change description ***

Bash, runfiles lib v2: shorter init code

The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same.

Closes #8461.

PiperOrigin-RevId: 250234181
bazel-io pushed a commit that referenced this pull request May 28, 2019
This CL rolls forward commit 229fe56, which was
rolled back by commit 4f9110e.

Reason for roll-forward:
- Skydoc project on Bazel CI was broke because it
  used "set -e" instead of "set -euo pipefail",
  but the new runfiles library forced
  "set -euo pipefail" on it

Differences between original and roll-forward:
- remove "set -euo pipefail" from runfiles.bash,
  and move it to init code (like in v1 init), so
  users can employ a less strict mode
- added comments to runfiles.bash explaining
  version compatibility
- added test to ensure v1 init code can load v2
  library

Original description:

The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. To use the new init code, you need Bazel 0.27 or newer. The old (longer) init code still works.

Closes #8461.

PiperOrigin-RevId: 250258548
irengrig pushed a commit to irengrig/bazel that referenced this pull request Jun 18, 2019
The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same.

Closes bazelbuild#8461.

PiperOrigin-RevId: 250142259
irengrig pushed a commit to irengrig/bazel that referenced this pull request Jun 18, 2019
*** Reason for rollback ***

Broke many Bazel downstream projects

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1002#_

Culprit Finder: https://buildkite.com/bazel/culprit-finder/builds/162

*** Original change description ***

Bash, runfiles lib v2: shorter init code

The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same.

Closes bazelbuild#8461.

PiperOrigin-RevId: 250234181
irengrig pushed a commit to irengrig/bazel that referenced this pull request Jun 18, 2019
This CL rolls forward commit 229fe56, which was
rolled back by commit 4f9110e.

Reason for roll-forward:
- Skydoc project on Bazel CI was broke because it
  used "set -e" instead of "set -euo pipefail",
  but the new runfiles library forced
  "set -euo pipefail" on it

Differences between original and roll-forward:
- remove "set -euo pipefail" from runfiles.bash,
  and move it to init code (like in v1 init), so
  users can employ a less strict mode
- added comments to runfiles.bash explaining
  version compatibility
- added test to ensure v1 init code can load v2
  library

Original description:

The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. To use the new init code, you need Bazel 0.27 or newer. The old (longer) init code still works.

Closes bazelbuild#8461.

PiperOrigin-RevId: 250258548
irengrig pushed a commit to irengrig/bazel that referenced this pull request Jul 15, 2019
The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same.

Closes bazelbuild#8461.

PiperOrigin-RevId: 250142259
irengrig pushed a commit to irengrig/bazel that referenced this pull request Jul 15, 2019
*** Reason for rollback ***

Broke many Bazel downstream projects

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1002#_

Culprit Finder: https://buildkite.com/bazel/culprit-finder/builds/162

*** Original change description ***

Bash, runfiles lib v2: shorter init code

The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. The rlocation() implementation is the same.

Closes bazelbuild#8461.

PiperOrigin-RevId: 250234181
irengrig pushed a commit to irengrig/bazel that referenced this pull request Jul 15, 2019
This CL rolls forward commit 229fe56, which was
rolled back by commit 4f9110e.

Reason for roll-forward:
- Skydoc project on Bazel CI was broke because it
  used "set -e" instead of "set -euo pipefail",
  but the new runfiles library forced
  "set -euo pipefail" on it

Differences between original and roll-forward:
- remove "set -euo pipefail" from runfiles.bash,
  and move it to init code (like in v1 init), so
  users can employ a less strict mode
- added comments to runfiles.bash explaining
  version compatibility
- added test to ensure v1 init code can load v2
  library

Original description:

The Bash Runfiles Library is now at its version 2.

The new version has a shorter copy-pasted init
code ("stanza") than v1.

The init code does the bare minimum to load the
runfiles library. Everything else is done in the
library itself (e.g. export RUNFILES_* envvars).

The rlocation() function is unchanged.

To demonstrate correctness, I updated:
- two mock binaries
- two actual tests

RELNOTES[NEW]: Bash, runfiles: the copy-pasted init code of the Bash runfiles library is now shorter, see `tools/bash/runfiles/runfiles.bash`. To use the new init code, you need Bazel 0.27 or newer. The old (longer) init code still works.

Closes bazelbuild#8461.

PiperOrigin-RevId: 250258548
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants