Skip to content

Commit dd277d1

Browse files
committed
Use POSIX way of generating sha256 hashes as suggested in PR comments
1 parent c5dc683 commit dd277d1

File tree

6 files changed

+5
-15
lines changed

6 files changed

+5
-15
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ jobs:
178178
submodules: true
179179
- name: Install llvm 16
180180
run: brew install llvm@16
181-
- name: Install coreutils
182-
run: brew install coreutils
183-
- name: Install docker
181+
- name: Install riscv64 target
184182
run: rustup target add riscv64imac-unknown-none-elf
185183
- name: Install cargo generate
186184
run: cargo install cargo-generate
@@ -223,8 +221,6 @@ jobs:
223221
uses: douglascamata/setup-docker-macos-action@v1-alpha
224222
- name: Install llvm 16
225223
run: brew install llvm@16
226-
- name: Install coreutils
227-
run: brew install coreutils
228224
- name: Install riscv64 target
229225
run: rustup target add riscv64imac-unknown-none-elf
230226
- name: Install cargo generate

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,6 @@ $ ./scripts/reproducible_build_docker --proxy "..." # Setup docker container so
195195

196196
By default, the checksum file is stored in `checksums.txt` in the root of the repository. It is strongly recommended that this file is checked into version control, and a CI is setup so reproducible build is always checked in new commits.
197197

198-
Note that reproducible build here relies on the presence of `sha256sum` command, if you are using macOS, you can install it via the following command:
199-
200-
```
201-
brew install coreutils
202-
```
203-
204198
### Standalone Contract Crate
205199

206200
In rare cases if you want to simply use a standalone contract crate without a workspace. The [standalone-contract](https://github.com/cryptape/ckb-script-templates/tree/main/standalone-contract) template is prepared for you:

standalone-contract/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ prepare:
7878
# Generate checksum info for reproducible build
7979
CHECKSUM_FILE := build/checksums-$(MODE).txt
8080
checksum: build
81-
sha256sum build/$(MODE)/* > $(CHECKSUM_FILE)
81+
shasum -a 256 build/$(MODE)/* > $(CHECKSUM_FILE)
8282

8383
.PHONY: build test check clippy fmt cargo clean prepare

standalone-contract/scripts/reproducible_build_docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ $DOCKER run --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $
6161
if [[ "${UPDATE}" = "yes" ]]; then
6262
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"
6363
else
64-
sha256sum -c ${CHECKSUM_FILE_PATH}
64+
shasum -a 256 -c ${CHECKSUM_FILE_PATH}
6565
fi

workspace/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ prepare:
110110
# Generate checksum info for reproducible build
111111
CHECKSUM_FILE := build/checksums-$(MODE).txt
112112
checksum: build
113-
sha256sum build/$(MODE)/* > $(CHECKSUM_FILE)
113+
shasum -a 256 build/$(MODE)/* > $(CHECKSUM_FILE)
114114

115115
.PHONY: build test check clippy fmt cargo clean prepare checksum

workspace/scripts/reproducible_build_docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ $DOCKER run --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $
6161
if [[ "${UPDATE}" = "yes" ]]; then
6262
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"
6363
else
64-
sha256sum -c ${CHECKSUM_FILE_PATH}
64+
shasum -a 256 -c ${CHECKSUM_FILE_PATH}
6565
fi

0 commit comments

Comments
 (0)