Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Apr 28, 2020

On master (5352d14) CI_RETRY_EXE=${CI_RETRY_EXE:retry} works as a Substring Expansion, and that is wrong.
If CI_RETRY_EXE variable was unset initially, its new value becomes an empty string, but not "retry" as one could expect. Consequently, the ${CI_RETRY_EXE} ... command does not use ci/retry/retry script.

This PR makes for CI_RETRY_EXE variable a usual parameter expansion, i.e., ${parameter:-word}.

Reference: #18735 (comment)

@fanquake fanquake added the Tests label Apr 28, 2020
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
}
fi
export -f DOCKER_EXEC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part I don't understand. It was working "correctly" before (without retry).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides Bash Reference Manual, there are more references:

If shell function retry is used, it runs a subshell, and cannot see definitions of other shell functions unless they are exported: "Functions may be exported so that subshells automatically have them defined with the -f option to the export builtin." (from Bash Reference Manual).

This could be verified by set -x.

@maflcko maflcko closed this Apr 28, 2020
@maflcko maflcko reopened this Apr 28, 2020
@hebasto
Copy link
Member Author

hebasto commented Apr 28, 2020

@maflcko maflcko merged commit ab91a0e into bitcoin:master Apr 29, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 29, 2020
45615de ci: Fix default retry script usage (Hennadii Stepanov)

Pull request description:

  On master (5352d14) `CI_RETRY_EXE=${CI_RETRY_EXE:retry}` works as a [Substring Expansion](https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html), and that is wrong.
  If `CI_RETRY_EXE` variable was unset initially, its new value becomes an empty string, but not "retry" as one could expect. Consequently, the `${CI_RETRY_EXE} ...` command does _not_ use `ci/retry/retry` script.

  This PR makes for `CI_RETRY_EXE` variable a usual parameter expansion, i.e., `${parameter:-word}`.

  Reference: bitcoin#18735 (comment)

Top commit has no ACKs.

Tree-SHA512: 108173f6b2677979b9ddf2f9b9df4a6c56f5efa81c36543a1816bb3b984e42984bf3c83fe413ea3a5ca1e2317c4efb02fea7180a6b44863af7cfe6202e9cf94d
@hebasto hebasto deleted the 200428-ci-retry branch April 29, 2020 16:29
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants