Dub Error Message "Invalid variable: DUB"

Basile B. b2.temp at gmx.com
Sun Jun 7 10:30:41 UTC 2020


On Sunday, 7 June 2020 at 10:06:14 UTC, Russel Winder wrote:
> On Sun, 2020-06-07 at 10:24 +0100, 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?
>
> I am assuming that the error comes from the line:
>
> preBuildCommands "$DUB run --compiler=$$DC unit-threaded -c 
> gen_ut_main -- -f generated/ut_dub_main.d -d $DUB"
>
> in the unittest configuration as suggested for using 
> unit-threaded. The question is why does the symbol DUB not need 
> to be defined locally or on Travis-CI, but only on GitLab?
>
> |> printenv | grep -i dub
> |>
>
> On Travis-CI and locally Dub find where it is, why does it not 
> do this on GitLab? It is at /usr/bin/dub in all cases.

What is the docker image that you use ?  If it is an older 
version maybe that the $DUB env variable is not yet supported by 
the dub version that's installed (it exists since 2.084.0 
according to [1]).

In my .gitalab-ci.yml I use 'dlang2/ldc-ubuntu' [2] or 
'dlang2/dmd-ubuntu' [3] which give always recent versions of D.

[1] https://dlang.org/changelog/2.084.0.html
[2] https://hub.docker.com/r/dlang2/ldc-ubuntu
[3] https://hub.docker.com/r/dlang2/dmd-ubuntu


More information about the Digitalmars-d-learn mailing list