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 · 8 comments · May be fixed by #40
Open

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

qwerttvv opened this issue Mar 8, 2024 · 8 comments · May be fixed by #40

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
@cmangla
Copy link
Contributor

cmangla commented Sep 3, 2024

@qwerttvv PR #40 might help. Once merged, try with 'FIXUP: 1'.

@qwerttvv
Copy link
Author

qwerttvv commented Sep 4, 2024

@qwerttvv PR #40 might help. Once merged, try with 'FIXUP: 1'.

Thank you. I'll try it later.

@cmangla
Copy link
Contributor

cmangla commented Sep 4, 2024

@qwerttvv PR #40 might help. Once merged, try with 'FIXUP: 1'.

Thank you. I'll try it later.

Great! Please do let us know of the result here. It will be a useful test.

@cmangla
Copy link
Contributor

cmangla commented Sep 4, 2024

@qwerttvv PR #40 might help. Once merged, try with 'FIXUP: 1'.

Thank you. I'll try it later.

If you want to test it sooner, you can use the action

cmangla/gh-action-sdk@pr-hash-fixup-option

It has the 'FIXUP' option, and also the 'IGNORE_PKG_HASH_ISSUE' option.

@qwerttvv
Copy link
Author

qwerttvv commented Sep 4, 2024

@qwerttvv PR #40 might help. Once merged, try with 'FIXUP: 1'.

Thank you. I'll try it later.

If you want to test it sooner, you can use the action

cmangla/gh-action-sdk@pr-hash-fixup-option

It has the 'FIXUP' option, and also the 'IGNORE_PKG_HASH_ISSUE' option.

The reply is a little late, sorry
I tested adding only FIXUP and it worked fine
Also I tested adding only IGNORE_PKG_HASH_ISSUE, no problem too

This PR worked perfect, THANKS!!!

@cmangla
Copy link
Contributor

cmangla commented Sep 4, 2024

This PR worked perfect, THANKS!!!

I am glad! Thanks for testing this and for your feedback.

@cmangla cmangla linked a pull request Oct 29, 2024 that will close this issue
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 a pull request may close this issue.

2 participants