mit-dci / opencbdc-tx

A transaction processor for a hypothetical, general-purpose, central bank digital currency
Other
896 stars 198 forks source link

Circular dependency on bash within 'scripts/install-build-tools.sh' #287

Open rockett-m opened 1 month ago

rockett-m commented 1 month ago

Abstract

We can't rely on bash as the shebang if we install bash within the script:scripts/install-build-tools.sh

Proposal: switch the shebang to #!/bin/sh or #!/usr/bin/env sh to eliminate circular dependency on bash. This may trigger several other errors as well. Could also have a mini script to install bash first so that scripts/install-build-tools.sh can remain as is.

Issue stemmed from a discussion with @maurermi about this

Description

Changing the shebang to #!/bin/sh triggered issues right away, for example:

| 0.091 scripts/install-build-tools.sh: 13: !=: not found
| 0.091 scripts/install-build-tools.sh: 19: Syntax error: "(" unexpected
| ------
| Dockerfile:25
| --------------------
|   23 |     WORKDIR /opt/tx-processor
|   24 |     
|   25 | >>> RUN scripts/install-build-tools.sh
|   26 |     RUN scripts/setup-dependencies.sh
|   27 |     

So we should consider keeping the same shell requirement and a script to get bash installed first or changing it to sh and fixing all the issues that arise.

Code of Conduct