Skip to content

Fix fetch script on macos#662

Merged
gcharang merged 1 commit intodevfrom
fix-fetch-params-macos
Aug 21, 2025
Merged

Fix fetch script on macos#662
gcharang merged 1 commit intodevfrom
fix-fetch-params-macos

Conversation

@gcharang
Copy link

@gcharang gcharang commented Aug 20, 2025

re: GLEECBTC/komodo-defi-framework#2603

please verify the scripts work in both MacOs and linux

@gcharang gcharang requested review from DeckerSU and smk762 August 20, 2025 13:12
@gcharang gcharang changed the title use ubuntu22 image Fix hetch script on macos Aug 20, 2025
@gcharang gcharang changed the title Fix hetch script on macos Fix fetch script on macos Aug 20, 2025
@DeckerSU
Copy link

The script assumes that coreutils is installed, which is why it uses sha256sum instead of shasum or openssl dgst -sha256. Of course, we could approve these changes, or even add a fallback to calculate sha256 in a different way - for example, if sha256sum is not found, try openssl or shasum. But is that really necessary?

@gcharang
Copy link
Author

@DeckerSU as can be seen in GLEECBTC/komodo-defi-framework#2603 , the macos test was failing at this fetch script because there was a sha256sum command available but with a seemingly different parameter requirement than the linux one. I saw the same behavior in my local macos. I checked and don't have coreutils installed. Maybe the latest macos comes bundled with a different sha256sum command

sha256sum --version says just sha256sum (Darwin) 1.0. doesn't mention GNU coreutils at all like the same command on linux does

We need to fix this for the kdf test github action to work

@DeckerSU
Copy link

Wouldn't it be simpler to do something like:

- name: Install coreutils on macOS
  if: matrix.os == 'macos-latest'
  run: brew install coreutils

before https://github.com/KomodoPlatform/komodo-defi-framework/blob/a9fbf6096257b802e0aac4d936dcc5d2f0c28461/.github/workflows/test.yml#L155?

If that is not appropriate for some reason, I will approve this PR - consider it just a suggestion.

@gcharang
Copy link
Author

@DeckerSU we need to fix the fetch scripts for macos users of komodod too. Like it did in my local mac, the current scripts will fail for other users of latest macos as well

@DeckerSU
Copy link

p.s. I also think (haven’t tested it yet, but I will) that we can fix the error by changing in the script:

        "$SHA256CMD" $SHA256ARGS -c <<EOF
$expectedhash  $dlname

to:

        "$SHA256CMD" $SHA256ARGS -c - <<EOF
$expectedhash  $dlname

so that sha256sum -c - is executed instead of sha256sum -c.

I’ll try it today and post the results. I think the root of the issue is related to that.

@DeckerSU
Copy link

Yes, I’ve checked. With the changes below, everything should work as expected. Please test as well, remove your changes in this PR and apply the one below instead.

diff --git a/zcutil/fetch-params.sh b/zcutil/fetch-params.sh
index 930a8691a..d275273d9 100755
--- a/zcutil/fetch-params.sh
+++ b/zcutil/fetch-params.sh
@@ -115,7 +115,7 @@ function fetch_params {
             fi
         done

-        "$SHA256CMD" $SHA256ARGS -c <<EOF
+        "$SHA256CMD" $SHA256ARGS -c -<<EOF
 $expectedhash  $dlname
 EOF

@gcharang gcharang force-pushed the fix-fetch-params-macos branch from 22b0249 to 64187dc Compare August 21, 2025 08:32
@gcharang
Copy link
Author

gcharang commented Aug 21, 2025

@DeckerSU it works. tested on mac and linux. please approve

@gcharang gcharang merged commit 635112d into dev Aug 21, 2025
18 checks passed
@gcharang gcharang deleted the fix-fetch-params-macos branch August 21, 2025 09:46
DeckerSU added a commit to DeckerSU/KomodoOcean that referenced this pull request Aug 21, 2025
sha256sum requires explicitly using `-` as the input file on macOS.

- GLEECBTC/komodo-daemon#662
- ccache/ccache#1542
DeckerSU added a commit to DeckerSU/KomodoOcean that referenced this pull request Nov 14, 2025
…orship (#102)

* fix: correctly call sha256sum on macOS

sha256sum requires explicitly using `-` as the input file on macOS.

- GLEECBTC/komodo-daemon#662
- ccache/ccache#1542

* macOS build fixes and .gitignore updates (#101)

* qt: libpng, fix build on macOS with SDK 15

Remove obsolete inclusion of <fp.h> from bundled libpng, which no longer
exists in recent macOS SDKs (15+). The header is replaced with <math.h>,
matching upstream libpng fix (PR #529).

Without this change, Qt 5.15.x fails to build on macOS Sequoia / Xcode 16
with errors like:
    fatal error: 'fp.h' file not found

This aligns the embedded libpng with upstream behavior and restores
successful builds on modern macOS toolchains.

* depends: add aarch64 to .gitignore

Extend the ignore list in depends/.gitignore to cover build artifacts
for aarch64, alongside the existing x86_64, i686, mips, and arm
directories. This prevents accidental commits of target-specific
output when building for aarch64.

* build: macOS, replace nproc --all with sysctl -n hw.ncpu

Update macOS build scripts to use `sysctl -n hw.ncpu` instead of
`nproc --all`. The `nproc` utility is not available by default on
macOS, while `sysctl` provides a reliable way to query the number of
CPU cores.

* gitignore: add autogenerated files and binaries

Extend .gitignore to exclude files that are either generated during
compilation or produced as build artifacts:

- qa/pull-tester/run-komodod-for-test.sh
- src/cryptoconditions/compile   (autogenerated)
- src/komodo-cli
- src/komodo-tx
- src/univalue/test/object
- src/wallet-utility             (binaries)

This prevents accidental commits of temporary build outputs and
improves repository cleanliness.

* Update README.md to clarify developer roles and add funding link; create FUNDING.yml for GitHub sponsorship
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants