You are not logged in.

#1 2020-05-31 11:01:46

xilog
Member
Registered: 2020-05-31
Posts: 9

md5 hash on my package does not work

I tried to update my package on the AUR and did `makepkg -g >> PKGBUILD` along with `makepkg` which worked fine. Then I updated my .SRCINFO, committed and pushed all this to the git repo, but now when I try using `yay -Syu` it says

```
==> Making package: go-clock 1.0.1-1 (Sun 31 May 2020 02:55:35 PM +04)
==> Retrieving sources...
  -> Found go-clock-1.0.1.tar.gz
==> Validating source files with md5sums...
    go-clock-1.0.1.tar.gz ... FAILED
==> ERROR: One or more files did not pass the validity check!
```

I am not sure what to do, I tried remaking the md5 hash and some other stuff like 20 times. I did remove the old one from PKGBUILD.
Package is https://aur.archlinux.org/packages/go-clock

Offline

#2 2020-05-31 11:23:20

loqs
Member
Registered: 2014-03-06
Posts: 17,467

Re: md5 hash on my package does not work

==> Making package: go-clock 1.0.1-1 (Sun May 31 11:19:58 2020)
==> Retrieving sources...
  -> Found go-clock-1.0.1.tar.gz
==> Validating source files with md5sums...
    go-clock-1.0.1.tar.gz ... Passed
==> Making package: go-clock 1.0.1-1 (Sun 31 May 2020 11:20:01 AM UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found go-clock-1.0.1.tar.gz
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Extracting go-clock-1.0.1.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
/startdir/PKGBUILD: line 38: go: command not found
==> ERROR: A failure occurred in build().
    Aborting...

The md5sum passes here,  the build fails as go is not listed depends or makedepends.  The issue you encountering appears to be with the AUR helper yay.

Offline

#3 2020-05-31 11:24:20

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

loqs wrote:
==> Making package: go-clock 1.0.1-1 (Sun May 31 11:19:58 2020)
==> Retrieving sources...
  -> Found go-clock-1.0.1.tar.gz
==> Validating source files with md5sums...
    go-clock-1.0.1.tar.gz ... Passed
==> Making package: go-clock 1.0.1-1 (Sun 31 May 2020 11:20:01 AM UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found go-clock-1.0.1.tar.gz
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Extracting go-clock-1.0.1.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
/startdir/PKGBUILD: line 38: go: command not found
==> ERROR: A failure occurred in build().
    Aborting...

The md5sum passes here,  the build fails as go is not listed depends or makedepends.  The issue you encountering appears to be with the AUR helper yay.

Aha. Thank you! I will add go to the dependencies

Offline

#4 2020-05-31 11:26:38

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

loqs wrote:
==> Making package: go-clock 1.0.1-1 (Sun May 31 11:19:58 2020)
==> Retrieving sources...
  -> Found go-clock-1.0.1.tar.gz
==> Validating source files with md5sums...
    go-clock-1.0.1.tar.gz ... Passed
==> Making package: go-clock 1.0.1-1 (Sun 31 May 2020 11:20:01 AM UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found go-clock-1.0.1.tar.gz
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Extracting go-clock-1.0.1.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
/startdir/PKGBUILD: line 38: go: command not found
==> ERROR: A failure occurred in build().
    Aborting...

The md5sum passes here,  the build fails as go is not listed depends or makedepends.  The issue you encountering appears to be with the AUR helper yay.

By the way, do you know how to fix this yay issue? It doesn't happen to my other packages and worked before I updated my app

Offline

#5 2020-05-31 11:44:36

loqs
Member
Registered: 2014-03-06
Posts: 17,467

Re: md5 hash on my package does not work

I do not use yay.

After adding go to makedepends

...
==> Starting build()...
clock.go:13:2: cannot find package "github.com/JakeMakesStuff/color" in any of:
	/usr/lib/go/src/github.com/JakeMakesStuff/color (from $GOROOT)
	/build/go/src/github.com/JakeMakesStuff/color (from $GOPATH)
==> ERROR: A failure occurred in build().

Please see Go_package_guidelines

    sudo install -Dm755 build/$pkgname /usr/bin/$pkgname

The package function is run with fakeroot so their is no need for sudo and indeed it should never be used in a PKGBUILD.
The binary will be installed to /usr/bin/$pkgname of the build system and an empty package is produced.  Content to be packaged must be placed under "$pkgdir".

Offline

#6 2020-05-31 11:46:44

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

loqs wrote:

I do not use yay.

After adding go to makedepends

...
==> Starting build()...
clock.go:13:2: cannot find package "github.com/JakeMakesStuff/color" in any of:
	/usr/lib/go/src/github.com/JakeMakesStuff/color (from $GOROOT)
	/build/go/src/github.com/JakeMakesStuff/color (from $GOPATH)
==> ERROR: A failure occurred in build().

Please see Go_package_guidelines

    sudo install -Dm755 build/$pkgname /usr/bin/$pkgname

The package function is run with fakeroot so their is no need for sudo and indeed it should never be used in a PKGBUILD.
The binary will be installed to /usr/bin/$pkgname of the build system and an empty package is produced.  Con>>> `modified file' or `untracked file'tent to be packaged must be placed under "$pkgdir".

Sorry. I tried without sudo and it didn't work but with sudo worked fine. I think I fixed the color package issue

Last edited by xilog (2020-05-31 11:49:31)

Offline

#7 2020-05-31 11:52:01

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

This is what happens without sudo:

```
==> Starting check()...
?       github.com/XilogOfficial/go-clock       [no test files]
==> Entering fakeroot environment...
==> Starting package()...
install: cannot remove '/usr/bin/go-clock': Permission denied
==> ERROR: A failure occurred in package().
    Aborting...
```

Offline

#8 2020-05-31 12:03:02

loqs
Member
Registered: 2014-03-06
Posts: 17,467

Re: md5 hash on my package does not work

xilog wrote:

This is what happens without sudo:

loqs wrote:

The binary will be installed to /usr/bin/$pkgname of the build system and an empty package is produced.  Content to be packaged must be placed under "$pkgdir".

See also the build function of the sample PKGBUILD from the GO package guides link I provided in post #5.
The bbs uses bbcode not markdown.
Edit:
Color package issue is still present as of 733268a780792a0417124569e395d09e523e9277

Last edited by loqs (2020-05-31 12:05:51)

Offline

#9 2020-05-31 12:09:25

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

loqs wrote:
xilog wrote:

This is what happens without sudo:

loqs wrote:

The binary will be installed to /usr/bin/$pkgname of the build system and an empty package is produced.  Content to be packaged must be placed under "$pkgdir".

See also the build function of the sample PKGBUILD from the GO package guides link I provided in post #5.
The bbs uses bbcode not markdown.
Edit:
Color package issue is still present as of 733268a780792a0417124569e395d09e523e9277

loqs wrote:

The binary will be installed to /usr/bin/$pkgname of the build system and an empty package is produced.  Content to be packaged must be placed under "$pkgdir".

Sorry, I don't understand what you mean here.

loqs wrote:

Color package issue is still present as of 733268a780792a0417124569e395d09e523e9277

Weird...

loqs wrote:

See also the build function of the sample PKGBUILD from the GO package guides link I provided in post #5.

Have done so, sorry if I seem dumb I am new to this and it's a bit confusing.

Last edited by xilog (2020-05-31 12:20:52)

Offline

#10 2020-05-31 12:23:13

loqs
Member
Registered: 2014-03-06
Posts: 17,467

Re: md5 hash on my package does not work

pacman -Qlp go-clock-1.0.1-1-x86_64.pkg.tar.zst

Note there is no output as the package is empty

install -Dm755 build/$pkgname  /usr/bin/$pkgname
install -Dm755 build/$pkgname "$pkgdir"/usr/bin/$pkgname

The first install line without $pkgdir tries to install to /usr/bin of the system running makepkg,  as makepkg can not be run as root it can not install to /usr/bin of the system which is intended.
The second install line installs under $pkgdir so it is packaged.

Offline

#11 2020-05-31 12:26:05

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

loqs wrote:
pacman -Qlp go-clock-1.0.1-1-x86_64.pkg.tar.zst

Note there is no output as the package is empty

install -Dm755 build/$pkgname  /usr/bin/$pkgname
install -Dm755 build/$pkgname "$pkgdir"/usr/bin/$pkgname

The first install line without $pkgdir tries to install to /usr/bin of the system running makepkg,  as makepkg can not be run as root it can not install to /usr/bin of the system which is intended.
The second install line installs under $pkgdir so it is packaged.

Now that is strange, do you know why it's empty?

Also, if you include $pkgdir won't that mean it will not be installed to /usr/bin/go-clock but $pkgdir/usr/bin/go-clock wherever that is? Will it be the same location or does something move it there after or what?

Last edited by xilog (2020-05-31 12:26:59)

Offline

#12 2020-05-31 12:34:42

loqs
Member
Registered: 2014-03-06
Posts: 17,467

Re: md5 hash on my package does not work

makepkg produces the package.  pacman installs it.
makepkg does not know that installing to /usr/bin you actually meant it should be placed in the package archive under /usr/bin
makepkg only packages files under $pkgdir.  $pkgdir maps to / of the produced package archive.

man 5 PKGBUILD wrote:

       pkgdir
           This contains the directory where makepkg bundles the installed package. This directory will become the root directory of your built package. This variable should only be used in the package() function.

Offline

#13 2020-05-31 12:43:54

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

loqs wrote:

makepkg produces the package.  pacman installs it.
makepkg does not know that installing to /usr/bin you actually meant it should be placed in the package archive under /usr/bin
makepkg only packages files under $pkgdir.  $pkgdir maps to / of the produced package archive.

man 5 PKGBUILD wrote:

       pkgdir
           This contains the directory where makepkg bundles the installed package. This directory will become the root directory of your built package. This variable should only be used in the package() function.

Ah. Thanks!

Offline

#14 2020-05-31 12:53:31

loqs
Member
Registered: 2014-03-06
Posts: 17,467

Re: md5 hash on my package does not work

The md5sum array at the bottom of the PKGBUILD overrides the one at the top so you could move the one at bottom to replace the one at the top.

namcap go-clock-1.0.1-1-x86_64.pkg.tar.zst
go-clock E: Missing custom license directory (usr/share/licenses/go-clock)
go-clock W: Description should not contain the package name.
go-clock E: Dependency glibc detected and not included (libraries ['usr/lib/libc.so.6', 'usr/lib/libpthread.so.0'] needed in files ['usr/bin/go-clock'])

You could also clean up the PKGBUILD removing the comment that asks to be removed and the empty variables.

Offline

#15 2020-05-31 12:54:48

xilog
Member
Registered: 2020-05-31
Posts: 9

Re: md5 hash on my package does not work

loqs wrote:

The md5sum array at the bottom of the PKGBUILD overrides the one at the top so you could move the one at bottom to replace the one at the top.

namcap go-clock-1.0.1-1-x86_64.pkg.tar.zst
go-clock E: Missing custom license directory (usr/share/licenses/go-clock)
go-clock W: Description should not contain the package name.
go-clock E: Dependency glibc detected and not included (libraries ['usr/lib/libc.so.6', 'usr/lib/libpthread.so.0'] needed in files ['usr/bin/go-clock'])

You could also clean up the PKGBUILD removing the comment that asks to be removed and the empty variables.

You're right, thanks

Offline

Board footer

Powered by FluxBB