Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Mar 2017 19:38:27 +0100
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        Kyle Evans <bsdports@kyle-evans.net>, Mathieu Arnold <mat@freebsd.org>
Cc:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r435456 - in head: comms/wy60 deskutils/gbirthday devel/arduino-builder devel/cityhash devel/google-gdata devel/monodevelop emulators/citra games/openomf security/ssh-vault
Message-ID:  <ab65435b-c9ff-337a-c7f6-195b7cfb7913@FreeBSD.org>
In-Reply-To: <CACNAnaFc7=eLP266xNhDiKN_V_B3%2BnXN3BSmHPaxMA2EzUD%2BHQ@mail.gmail.com>
References:  <201703050813.v258DSQt052933@repo.freebsd.org> <CACNAnaFc7=eLP266xNhDiKN_V_B3%2BnXN3BSmHPaxMA2EzUD%2BHQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--LDvkh1Is4kRujqE4kiWpKvJlnNgxMxp7w
Content-Type: multipart/mixed; boundary="XoPUEoPM90h9kr5qFW7N9RvDvjWSNlV9x";
 protected-headers="v1"
From: Mathieu Arnold <mat@FreeBSD.org>
To: Kyle Evans <bsdports@kyle-evans.net>, Mathieu Arnold <mat@freebsd.org>
Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org,
 svn-ports-head@freebsd.org
Message-ID: <ab65435b-c9ff-337a-c7f6-195b7cfb7913@FreeBSD.org>
Subject: Re: svn commit: r435456 - in head: comms/wy60 deskutils/gbirthday
 devel/arduino-builder devel/cityhash devel/google-gdata devel/monodevelop
 emulators/citra games/openomf security/ssh-vault
References: <201703050813.v258DSQt052933@repo.freebsd.org>
 <CACNAnaFc7=eLP266xNhDiKN_V_B3+nXN3BSmHPaxMA2EzUD+HQ@mail.gmail.com>
In-Reply-To: <CACNAnaFc7=eLP266xNhDiKN_V_B3+nXN3BSmHPaxMA2EzUD+HQ@mail.gmail.com>

--XoPUEoPM90h9kr5qFW7N9RvDvjWSNlV9x
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Le 20/03/2017 =C3=A0 16:45, Kyle Evans a =C3=A9crit :
> On Sun, Mar 5, 2017 at 2:13 AM, Mathieu Arnold <mat@freebsd.org> wrote:=

>> Author: mat
>> Date: Sun Mar  5 08:13:28 2017
>> New Revision: 435456
>> URL: https://svnweb.freebsd.org/changeset/ports/435456
>>
>> Log:
>>   Cleanup USE_GITHUB with GH_TUPLE usage.
>>
>>   Do not use GH_TUPLE for the default distfile.
>>
>>   With hat:     portmgr
>>   Sponsored by: Absolight
>>
>> Modified:
>>   head/comms/wy60/Makefile   (contents, props changed)
>>   head/deskutils/gbirthday/Makefile   (contents, props changed)
>>   head/devel/arduino-builder/Makefile   (contents, props changed)
>>   head/devel/cityhash/Makefile   (contents, props changed)
>>   head/devel/google-gdata/Makefile   (contents, props changed)
>>   head/devel/monodevelop/Makefile   (contents, props changed)
>>   head/devel/monodevelop/distinfo   (contents, props changed)
>>   head/emulators/citra/Makefile   (contents, props changed)
>>   head/games/openomf/Makefile   (contents, props changed)
>>   head/security/ssh-vault/Makefile   (contents, props changed)
>>
>> [...]
>> Modified: head/devel/arduino-builder/Makefile
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/devel/arduino-builder/Makefile Sun Mar  5 08:09:35 2017      =
  (r435455)
>> +++ head/devel/arduino-builder/Makefile Sun Mar  5 08:13:28 2017      =
  (r435456)
>> @@ -15,7 +15,7 @@ BUILD_DEPENDS=3D        go:lang/go
>>
>>  USE_GITHUB=3D    yes
>>  GH_ACCOUNT=3D    arduino
>> -GH_SUBDIR=3D     src/github.com/${GH_ACCOUNT}/${PORTNAME}
>> +GH_SUBDIR=3D     src/github.com/${GH_ACCOUNT_DEFAULT}/${PORTNAME}
>>  GH_TUPLE=3D      go-errors:errors:a418503:goerrors/src/github.com/go-=
errors/errors \
>>                 stretchr:testify:v1.1.3:stretchr/src/github.com/stretc=
hr/testify \
>>                 jstemmer:go-junit-report:833f8ea:jstemmer/src/github.c=
om/jstemmer/go-junit-report
> Hi,
>
> With respect to the above change, may I ask where GH_ACCOUNT vs.
> GH_ACCOUNT_DEFAULT is most appropriately used?

TL:DR; You should never use GH_ACCOUNT/GH_PROJECT/GH_TAGNAME in
GH_SUBDIR because they get messed up with during processing.

When reading the following, you may want to read Mk/bsd.sites.mk,
starting around line 400.

The default values of the GH_(ACCOUNT|PROJECT|TAGNAME) variables have an
implied :DEFAULT group, which is the default group. So, when you write:

GH_ACCOUNT=3D foo

it ends up being:

GH_ACCOUNT=3D foo:DEFAULT

It is building on top of multiple distfiles feature explained here:
https://www.freebsd.org/doc/en/books/porters-handbook/makefile-distfiles.=
html#porting-master-sites-n

They can contain multiple values, and in fact, GH_TUPLE is only a
syntastic sugar on top of them, so, when GH_TUPLE is processed, its
content is hammered and sawed to fit into them.

Then, for each group variables get filled in, so, if you have

GH_ACCOUNT=3D foo bar:extra

it'll generate

GH_ACCOUNT_DEFAULT=3D foo
GH_ACCOUNT_extra=3D bar

and if you write:

GH_ACCOUNT=3D foo
GH_TUPLE=3D bar:bar:v1.0:extra/bar

At one point, GH_ACCOUNT will contain "foo bar:extra" and then the same
two variables describe above will be filled.

> I'm not finding any documentation for the latter, but is it safe to
> assume that if I think I need to use GH_ACCOUNT elsewhere in the
> Makefile I should likely be using GH_ACCOUNT_DEFAULT instead?

When you write:

GH_ACCOUNT=3D    arduino
GH_SUBDIR=3D     src/github.com/${GH_ACCOUNT}/${PORTNAME}

You might think that what make is going to do with it is obvious.  It is =
absolutely not.  make(1) defers variable expansion when it really needs i=
t, so what it does when you write that is store that GH_ACCOUNT=3Darduino=
, and GH_SUBDIR=3Dsrc/github.com/${GH_ACCOUNT}/${PORTNAME}.  Now, during =
the GH_TUPLE parsing, GH_ACCOUNT is *not* going to stay that way.

At one point, it'll have all the accounts present in GH_TUPLE, well, at l=
east, references to them

$ make -dv -V GH_ACCOUNT|&grep GH_ACCOUNT\ =3D
Global:GH_ACCOUNT =3D arduino
Global:GH_ACCOUNT =3D arduino ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:=
/]*)?)((/.*)?)@\1\4@}
Global:GH_ACCOUNT =3D arduino

And at the time GH_SUBDIR needs to be evaluated, GH_ACCOUNT will contain =
the second value in there, which will not be what you meant. Also, at the=
 point where GH_SUBDIR is evaluated, it will contain:

--=20
Mathieu Arnold



--XoPUEoPM90h9kr5qFW7N9RvDvjWSNlV9x--

--LDvkh1Is4kRujqE4kiWpKvJlnNgxMxp7w
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAEBCgBmBQJY0CGlXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzQUI2OTc4OUQyRUQxMjEwNjQ0MEJBNUIz
QTQ1MTZGMzUxODNDRTQ4AAoJEDpFFvNRg85IZ5kQAK96MK53eHdOLlw6bGtVzOcz
wOyGtIBVThwAH+aBa3Gafwz0Ex8wej8lFNotqOCQgT66K1GOqKCJaqIO6HnUQA6m
Pce1hnk3fgkXiYexqonp0+Gr8TB0VDcRM8/CLWes7zRZSWtvLfrEA++Gn61rfM+6
nmx6crk5Hm7MushqopNglKi9xYKH8P5U8ZoX7wLp1RiR7/YSfGA35KF7/9H2T7ji
6KDsclWDYju5fFWzG59sW6vMA7okw/4o7kpjCWmxjCCs211TfZY7EYJxINo9mVtF
BNMKrDlDCE41rvgpQDbdAJGh1Q0xYoOrZ4Rg6Wnr2n2egztkMWDl9U7LnhASuM7c
VlNQ1IA05KRVKbFeYCmYSHxAw0rVvn4/O7/STVcO+it7bW8unvVqPqqQoULL7q5t
u6/vv4yE0JH7XpX3IBuiVu0Z/UwVK8I4MjjScaH4FOMxWPIfmHhupw0fuSqPrD9C
HRFf2MjDt79pT0WkiRqiMgg9eTE/i6nWh8OS+ZlkKHkQNIByVtDHlaLJrgbhGtms
0I5yB1MHStrvE3q6yac9krBShJCJUZa7l4MJ1EqRwZFufXCEA48zdCEPbtm//3Ez
rufA53SBUTLT3j+ctx7ebUuULUeKDQdoZjB8pcKLkDoxZAMw76FF95PYvTWd9x8a
LPGyCzr1wP2Bq4VySXaW
=wwic
-----END PGP SIGNATURE-----

--LDvkh1Is4kRujqE4kiWpKvJlnNgxMxp7w--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ab65435b-c9ff-337a-c7f6-195b7cfb7913>