www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Dub Error Message "Invalid variable: DUB"

reply Russel Winder <russel winder.org.uk> writes:
Hi,

Why on earth is Dub sending out this error message (Invalid variable: DUB) =
on
GitLab but not on Travis-CI or locally?

OK, that was slightly rhetorical, more reasonably, why is dub sending out t=
his
message at all?

--=20
Russel.
=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
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk
Jun 07 2020
parent reply Jacob Carlborg <doob me.com> writes:
On 2020-06-07 11:24, Russel Winder wrote:
 Hi,
 
 Why on earth is Dub sending out this error message (Invalid variable: DUB) on
 GitLab but not on Travis-CI or locally?
 
 OK, that was slightly rhetorical, more reasonably, why is dub sending out this
 message at all?
Dub is supposed to make an environment variable named "DUB" available to the build script. It should contain the path to the Dub executable. I guess that somehow fails. Might be some unexpected character in the path? -- /Jacob Carlborg
Jun 07 2020
next sibling parent Russel Winder <russel winder.org.uk> writes:
On Sun, 2020-06-07 at 13:21 +0200, Jacob Carlborg via Digitalmars-d-learn
wrote:
 On 2020-06-07 11:24, Russel Winder wrote:
 Hi,
=20
 Why on earth is Dub sending out this error message (Invalid variable: D=
UB)
 on
 GitLab but not on Travis-CI or locally?
=20
 OK, that was slightly rhetorical, more reasonably, why is dub sending o=
ut
 this
 message at all?
=20 Dub is supposed to make an environment variable named "DUB" available to=
=20
 the build script. It should contain the path to the Dub executable. I=20
 guess that somehow fails. Might be some unexpected character in the path?
I guess dub 1.19 is just too old. I have to manually set "export DUB=3D/usr/bin/dub". --=20 Russel. =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 Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Jun 07 2020
prev sibling parent reply Andre Pany <andre s-e-a-p.de> writes:
On Sunday, 7 June 2020 at 11:21:03 UTC, Jacob Carlborg wrote:
 On 2020-06-07 11:24, Russel Winder wrote:
 Hi,
 
 Why on earth is Dub sending out this error message (Invalid 
 variable: DUB) on
 GitLab but not on Travis-CI or locally?
 
 OK, that was slightly rhetorical, more reasonably, why is dub 
 sending out this
 message at all?
Dub is supposed to make an environment variable named "DUB" available to the build script. It should contain the path to the Dub executable. I guess that somehow fails. Might be some unexpected character in the path?
I am not sure but $DUB is a variable which could be used in dub descriptor file but it isn't an environment variable. $DUB_EXE is an environment variable. Kind regards Andre
Jun 07 2020
parent reply Paul Backus <snarwin gmail.com> writes:
On Sunday, 7 June 2020 at 12:52:12 UTC, Andre Pany wrote:
 I am not sure but $DUB is a variable which could be used in dub 
 descriptor file but it isn't an environment variable.

 $DUB_EXE is an environment variable.

 Kind regards
 Andre
If what you say is true, the Dub documentation needs to be updated: https://dub.pm/package-format-json.html#environment-variables
Jun 07 2020
parent reply Andre Pany <andre s-e-a-p.de> writes:
On Sunday, 7 June 2020 at 15:37:27 UTC, Paul Backus wrote:
 On Sunday, 7 June 2020 at 12:52:12 UTC, Andre Pany wrote:
 I am not sure but $DUB is a variable which could be used in 
 dub descriptor file but it isn't an environment variable.

 $DUB_EXE is an environment variable.

 Kind regards
 Andre
If what you say is true, the Dub documentation needs to be updated: https://dub.pm/package-format-json.html#environment-variables
Each of the table has an explanation section were they can be used. $DUB can only be used within the dub descriptor but not within scripts called from the hooks. From the hooks you can use these environment variables: https://github.com/andre2007/dub/blob/376ff5854dcd7bbc6116f72001c8c6d13eb3cbf0/source/dub/generators/generator.d#L763 Kind regards Andre
Jun 07 2020
parent reply Paul Backus <snarwin gmail.com> writes:
On Sunday, 7 June 2020 at 16:26:17 UTC, Andre Pany wrote:
 On Sunday, 7 June 2020 at 15:37:27 UTC, Paul Backus wrote:
 On Sunday, 7 June 2020 at 12:52:12 UTC, Andre Pany wrote:
 I am not sure but $DUB is a variable which could be used in 
 dub descriptor file but it isn't an environment variable.

 $DUB_EXE is an environment variable.

 Kind regards
 Andre
If what you say is true, the Dub documentation needs to be updated: https://dub.pm/package-format-json.html#environment-variables
Each of the table has an explanation section were they can be used. $DUB can only be used within the dub descriptor but not within scripts called from the hooks. From the hooks you can use these environment variables: https://github.com/andre2007/dub/blob/376ff5854dcd7bbc6116f72001c8c6d13eb3cbf0/source/dub/generators/generator.d#L763 Kind regards Andre
The documentations says:
 Inside of custom commands directives a number of additional 
 variables is available:
...and then lists the variables from the function you linked to. "Additional" implies that they are not the only variables that can be used in hooks, and that the variables listed previously (such as $DUB) can also be used. If this is not the case, then the documentation is inaccurate and should be updated. I would also add: if you feel the need to link to the source code to explain to use a feature, rather than referring to the documentation, that is a good sign that the documentation is inadequate.
Jun 07 2020
parent reply Andre Pany <andre s-e-a-p.de> writes:
On Sunday, 7 June 2020 at 16:54:48 UTC, Paul Backus wrote:
 On Sunday, 7 June 2020 at 16:26:17 UTC, Andre Pany wrote:
 On Sunday, 7 June 2020 at 15:37:27 UTC, Paul Backus wrote:
 On Sunday, 7 June 2020 at 12:52:12 UTC, Andre Pany wrote:
 I am not sure but $DUB is a variable which could be used in 
 dub descriptor file but it isn't an environment variable.

 $DUB_EXE is an environment variable.

 Kind regards
 Andre
If what you say is true, the Dub documentation needs to be updated: https://dub.pm/package-format-json.html#environment-variables
Each of the table has an explanation section were they can be used. $DUB can only be used within the dub descriptor but not within scripts called from the hooks. From the hooks you can use these environment variables: https://github.com/andre2007/dub/blob/376ff5854dcd7bbc6116f72001c8c6d13eb3cbf0/source/dub/generators/generator.d#L763 Kind regards Andre
The documentations says:
 Inside of custom commands directives a number of additional 
 variables is available:
...and then lists the variables from the function you linked to. "Additional" implies that they are not the only variables that can be used in hooks, and that the variables listed previously (such as $DUB) can also be used. If this is not the case, then the documentation is inaccurate and should be updated. I would also add: if you feel the need to link to the source code to explain to use a feature, rather than referring to the documentation, that is a good sign that the documentation is inadequate.
I had a second look on the descriptions and from a non native speaker view it sounds correct. But you are right from a native speaker view the wording might be incorrect. If you have time, could you check the wording and make a proposal? https://github.com/dlang/dub-docs/blob/master/views/inc.package_format.envvars.dt Kind regards Andre
Jun 08 2020
parent reply Paul Backus <snarwin gmail.com> writes:
On Monday, 8 June 2020 at 17:55:24 UTC, Andre Pany wrote:
 I had a second look on the descriptions and from a non native 
 speaker view it sounds correct.
 But you are right from a native speaker view the wording might 
 be incorrect.

 If you have time, could you check the wording and make a 
 proposal?

 https://github.com/dlang/dub-docs/blob/master/views/inc.package_format.envvars.dt

 Kind regards
 Andre
https://github.com/dlang/dub-docs/pull/26
Jun 08 2020
parent Andre Pany <andre s-e-a-p.de> writes:
On Monday, 8 June 2020 at 18:38:17 UTC, Paul Backus wrote:
 On Monday, 8 June 2020 at 17:55:24 UTC, Andre Pany wrote:
 I had a second look on the descriptions and from a non native 
 speaker view it sounds correct.
 But you are right from a native speaker view the wording might 
 be incorrect.

 If you have time, could you check the wording and make a 
 proposal?

 https://github.com/dlang/dub-docs/blob/master/views/inc.package_format.envvars.dt

 Kind regards
 Andre
https://github.com/dlang/dub-docs/pull/26
Thanks a lot. Kind regards Andre
Jun 08 2020