D3992 ended up masking this error message. Since the custom error message is more informative, I decided to move set -u instead of removing the message entirely. Not having set -u set after simple error messages like this should have negligible effect.
Details
Details
- Reviewers
deadalnix - Group Reviewers
Restricted Project - Commits
- rSTAGING79eec8bc0714: [build-configurations] Resurface the more informative error message when…
rABC79eec8bc0714: [build-configurations] Resurface the more informative error message when…
Run:
./build-configurations.sh
Result before patch:
./build-configurations.sh: line 7: ABC_BUILD_NAME: unbound variable
Result after patch:
+ '[' -z '' ']' + echo 'Error: Environment variable ABC_BUILD_NAME must be set' Error: Environment variable ABC_BUILD_NAME must be set + exit 1
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- better-error-msg
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 7691 Build 13421: Bitcoin ABC Buildbot (legacy) Build 13420: arc lint + arc unit
Event Timeline
Comment Actions
This whole approach do not seem to make a lot of sense. The build build_names are not composable in any way, and as it is mandatory, it seems like it should be a parameters rather than an environment variable.
In any case, you can avoid the -u dance by conditionally setting the variable to an empty string and testing against this.
Comment Actions
Good point on the composability aspect. I started to notice issues arising from the current design while working on D4213. It's more clear to me now that a composable design would make it more robust in addition to providing the caller with more customization of the build.