Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"PKG_MIRROR_HASH:=skip" in Makefile, but build fails with "Package HASH check failed". #35

Open
qwerttvv opened this issue Mar 8, 2024 · 2 comments

Comments

@qwerttvv
Copy link

qwerttvv commented Mar 8, 2024

"PKG_MIRROR_HASH:=skip" in Makefile, but build fails with "Package HASH check failed".

I saw this #18 but it didn't help

Makefile like

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://www.github.com/xx/xx.git
PKG_MIRROR_HASH:=skip
PKG_SOURCE_VERSION:=b482340c35d47f63fecfb324f4d513c5f2255190

build log
step: make package/openwrt-pkg/check

make[1]: Entering directory '/builder'
make[2]: Entering directory '/feed/openwrt-pkg'
WARNING: PKG_MIRROR_HASH uses deprecated hash, set to 5cb6d1cf30437d42a1b172a7d3477eea178f26330dd26e32fff2c7741559cae1
make[2]: Leaving directory '/feed/openwrt-pkg'
time: package/feeds/packages_ci/openwrt-pkg/check#0.01#0.00#0.02
make[1]: Leaving directory '/builder'
Package HASH check failed
Error: Process completed with exit code 1.

I removed "PKG_MIRROR_HASH:=skip" from the Makefile, the problem is still there, the error is
WARNING: PKG_MIRROR_HASH is missing, set to

Any help?

@qwerttvv
Copy link
Author

qwerttvv commented Mar 9, 2024

May I ask how this PKG_MIRROR_HASH is derived?

I read the documentation, it is source code to generate tar.xz sha265, but I tried for a long time, the hash is never correct, I think it is the step of generating the tar.xz is wrong, please tell me how to correctly package the source code to generate the tar.xz so as to calculate this value

THX

@qwerttvv
Copy link
Author

Many methods have been tried, such as the following

After $SHA_smartdns has been obtained, the process is as follows, what's wrong...or what's the correct method?

      git clone https://www.github.com/pymumu/smartdns.git smartdns-$(date +1.%Y.%m.%d-%H)
      cd smartdns-$(date +1.%Y.%m.%d-%H)
      git checkout $SHA_smartdns
      git submodule update --init --recursive
      echo "TAR_TIMESTAMP=$(git log -1 --format='@%ct')" >> $GITHUB_ENV
      rm -rf .git

after that

      tar --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name $$$${TAR_TIMESTAMP:+--mtime="$$$$TAR_TIMESTAMP"} -c smartdns-$(date +1.%Y.%m.%d-%H) | xz -zc -7e > ../smartdns-$(date +1.%Y.%m.%d-%H).tar.xz
      echo "PKG_MIRROR_HASH=$(sha256sum ../smartdns-$(date +1.%Y.%m.%d-%H).tar.xz | cut -d ' ' -f1)" >> $GITHUB_ENV

After that change the Makefile ready to go to openwrt/gh-action-sdk@main to run

      sed -i "s/PKG_VERSION:=.*/PKG_VERSION:=$(date +1.%Y.%m.%d-%H)/" Makefile
      sed -i "s/PKG_SOURCE_VERSION:=.*/PKG_SOURCE_VERSION:=$SHA_smartdns/" Makefile
      sed -i "s/PKG_MIRROR_HASH:=.*/PKG_MIRROR_HASH:=$PKG_MIRROR_HASH/" Makefile

or one of and so on...

tar --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name ${TAR_TIMESTAMP:+--mtime="$TAR_TIMESTAMP"} -c smartdns-$(date +1.%Y.%m.%d-%H) | xz -zc -7e > ../smartdns-$(date +1.%Y.%m.%d-%H).tar.xz

It's all wrong.

azrdev added a commit to azrdev/snapos that referenced this issue Jun 19, 2024
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

No branches or pull requests

1 participant