tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fix mk/fetch/github.mk



On Tuesday, February 13th, 2024 at 1:11 PM, Greg Troxel <gdt%lexort.com@localhost> wrote:

> > I've reverted your change locally in order to update my packages but,
> > this is not a viable permanent solution.
> 
> I am not following your logic. The question is how to get to a state
> where we can express what we need and everything makes sense.

We used to have a certain behavior where a git tag was a viable source.
This behavior has changed with the following change:

Index: pkgsrc/mk/fetch/github.mk
diff -u pkgsrc/mk/fetch/github.mk:1.17 pkgsrc/mk/fetch/github.mk:1.18
--- pkgsrc/mk/fetch/github.mk:1.17      Wed May 31 20:30:44 2023
+++ pkgsrc/mk/fetch/github.mk   Sun Feb 11 15:26:38 2024
@@ -1,4 +1,4 @@
-# $NetBSD: github.mk,v 1.17 2023/05/31 20:30:44 rillig Exp $
+# $NetBSD: github.mk,v 1.18 2024/02/11 15:26:38 adam Exp $
 #
 # github.com master site handling
 #
@@ -70,7 +70,7 @@ SITES.${_GITHUB_DEFAULT_DISTFILES}=   ${MA
 .  endif
 
 .  if !empty(GITHUB_TYPE:Mtag)
-SITES.${_GITHUB_DEFAULT_DISTFILES}=    -${MASTER_SITES:=${GITHUB_PROJECT}/archive/${GITHUB_TAG}${EXTRACT_SUFX}}
+SITES.${_GITHUB_DEFAULT_DISTFILES}=    -${MASTER_SITES:=${GITHUB_PROJECT}/archive/refs/tags/${GITHUB_TAG}${EXTRACT_SUFX}}
 .  endif
 
 .endif

I'm not saying we should revert it.
I simply need a fix to still be able to fetch sources from specific tags.

I will try adam@ patch later to see if this fixes the behavior.

> If it means basically
> 
> change
> GITHUB_TAG= refs/tags/v${PKGVERSION_NOREV}
> to
> GITHUB_TAG= v${PKGVERSION_NOREV}
> 
> then that seems an ok outcome.

That's fine and not the point of the discussion.
There were, though unexpected side effects.


> So to pin@:
> 
> If you drop refs/tags/ from all our GITHUB_TAG definitions, are things
> OK?

No, I don't have refs/tags/ the specific x11/alacritty example has been fixed now.
It simply slipped through on my last update.

Let me take one example to try to make it clear.
I have this in wip/elvish-dev:

DISTNAME=	elvish-0.21.0
CATEGORIES=	shells
MASTER_SITES=	${MASTER_SITE_GITHUB:=elves/}
GITHUB_TAG=	2c97aeff60656856d12af9e5ac0280b60a0781ab

Running make yields:

=> Bootstrap dependency digest>=20211023: found digest-20220214
=> Fetching elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
=> Total size: 861765 bytes
Requesting https://github.com/elves/elvish/archive/refs/tags/2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
Redirected to https://codeload.github.com/elves/elvish/tar.gz/refs/tags/2c97aeff60656856d12af9e5ac0280b60a0781ab
Requesting https://codeload.github.com/elves/elvish/tar.gz/refs/tags/2c97aeff60656856d12af9e5ac0280b60a0781ab
ftp: Error retrieving file `404 Not Found'
fetch: Unable to fetch expected file elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
Trying [2a04:4e42:14::262]:443 ...
ftp: Can't connect to `2a04:4e42:14::262:443': No route to host
Trying 151.101.85.6:443 ...
Requesting https://cdn.NetBSD.org/pub/pkgsrc/distfiles/elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
ftp: Error retrieving file `404 Not Found'
fetch: Unable to fetch expected file elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
Trying [2001:660:3302:282a:204:75ff:fe9f:9e11]:80 ...
ftp: Can't connect to `2001:660:3302:282a:204:75ff:fe9f:9e11:80': No route to host
Trying 132.227.74.11:80 ...
Requesting http://ftp.fr.NetBSD.org/pub/pkgsrc/distfiles/elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
ftp: Error retrieving file `404 Not Found'
fetch: Unable to fetch expected file elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
Trying [2001:470:a085:999::21]:443 ...
ftp: Can't connect to `2001:470:a085:999::21:443': No route to host
Trying 199.233.217.201:443 ...
Requesting https://ftp.NetBSD.org/pub/pkgsrc/distfiles/elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
ftp: Error retrieving file `404 Not Found'
fetch: Unable to fetch expected file elvish-0.21.0-2c97aeff60656856d12af9e5ac0280b60a0781ab.tar.gz
*** Error code 1

Stop.

The same happens to anything that has GITHUB_TAG= commit hash


> If not, what's wrong?

I hope it's clear now.

Regards,
Pedro


Home | Main Index | Thread Index | Old Index