Thread overview
GDC on Travis-CI
Jun 02, 2018
crimaniak
Jun 02, 2018
rjframe
Jun 02, 2018
Johan Engelen
Jun 02, 2018
Matthias Klumpp
Jun 02, 2018
Seb
Jun 02, 2018
Matthias Klumpp
Jun 02, 2018
crimaniak
June 02, 2018
I started to work with Travis-CI, building packages using all three main compilers, and noticed that I have problems with gdc every time and need to tweak code because of many things missing. For example: https://travis-ci.org/crimaniak/json-patch/jobs/386963340
Why this situation with gdc and how best to deal with it?
June 02, 2018
On Sat, 02 Jun 2018 03:15:56 +0000, crimaniak wrote:

> I started to work with Travis-CI, building packages using all three main
> compilers, and noticed that I have problems with gdc every time and need
> to tweak code because of many things missing.
> For example: https://travis-ci.org/crimaniak/json-patch/jobs/386963340
> Why this situation with gdc and how best to deal with it?

GDC is on the 2.068 frontend, so you can't use any symbols introduced since then.

There is documentation for older Phobos versions online, but I don't remember the link and haven't found it by searching.
June 02, 2018
On Saturday, 2 June 2018 at 10:49:30 UTC, rjframe wrote:
> 
> There is documentation for older Phobos versions online, but I don't remember the link and haven't found it by searching.

https://docarchives.dlang.io/
June 02, 2018
On Saturday, 2 June 2018 at 03:15:56 UTC, crimaniak wrote:
> I started to work with Travis-CI, building packages using all three main compilers, and noticed that I have problems with gdc every time and need to tweak code because of many things missing. For example: https://travis-ci.org/crimaniak/json-patch/jobs/386963340
> Why this situation with gdc and how best to deal with it?

The build log seems to indicate it uses gdc 4.8, while the current version of GDC is 8.1 which is based on the 2.076 frontend.

Maybe just updating GDC on Travis will fix this.
June 02, 2018
On Saturday, 2 June 2018 at 16:04:09 UTC, Matthias Klumpp wrote:
> On Saturday, 2 June 2018 at 03:15:56 UTC, crimaniak wrote:
>> I started to work with Travis-CI, building packages using all three main compilers, and noticed that I have problems with gdc every time and need to tweak code because of many things missing. For example: https://travis-ci.org/crimaniak/json-patch/jobs/386963340
>> Why this situation with gdc and how best to deal with it?
>
> The build log seems to indicate it uses gdc 4.8, while the current version of GDC is 8.1 which is based on the 2.076 frontend.
>
> Maybe just updating GDC on Travis will fix this.

Sadly that's not so easy as

1) the GDC download path changed and we are still waiting on feedback from Ian on this (since more than, see https://github.com/dlang/installer/pull/251)

2) AFAICT there are no public binaries that use anything later than 2.068.2 could be used (see https://gdcproject.org/downloads)
June 02, 2018
On Saturday, 2 June 2018 at 16:27:38 UTC, Seb wrote:
> On Saturday, 2 June 2018 at 16:04:09 UTC, Matthias Klumpp wrote:
>> On Saturday, 2 June 2018 at 03:15:56 UTC, crimaniak wrote:
>>> I started to work with Travis-CI, building packages using all three main compilers, and noticed that I have problems with gdc every time and need to tweak code because of many things missing. For example: https://travis-ci.org/crimaniak/json-patch/jobs/386963340
>>> Why this situation with gdc and how best to deal with it?
>>
>> The build log seems to indicate it uses gdc 4.8, while the current version of GDC is 8.1 which is based on the 2.076 frontend.
>>
>> Maybe just updating GDC on Travis will fix this.
>
> Sadly that's not so easy as
>
> 1) the GDC download path changed and we are still waiting on feedback from Ian on this (since more than, see https://github.com/dlang/installer/pull/251)
>
> 2) AFAICT there are no public binaries that use anything later than 2.068.2 could be used (see https://gdcproject.org/downloads)

That's unfortunate. I hope Iain comments on this soon, because it means GDC will receive much less testing by other projects. For getting up-to-date binaries, in theory those could be extracted from GDC's Debian packages, which are usually very up-to-date (even Git snapshots are occasionally packaged) - problem there is that I am not sure whether they will work standalone and with the older GLibc on Travis.

@crimaniak: If you really want to build with all compilers, there is a workaround for this issue that does not involve you supporting ancient D versions, and that is to actually use Debian's GDC on Travis. I use this excessively for my own projects, mostly though because I need newer system libraries and because I explicitly want to build with the packaged compilers as well.
You can use a similar approach and limit it to GDC only, I created a PR for that: https://github.com/crimaniak/json-patch/pull/1
As you can see on https://travis-ci.org/crimaniak/json-patch/jobs/387197216 , your code builds fine with the latest GDC.
So, if you want that workaround, please take it, if not it may serve as a reference for others facing the same problem.

June 02, 2018
On Saturday, 2 June 2018 at 19:48:36 UTC, Matthias Klumpp wrote:
....
> @crimaniak: If you really want to build with all compilers, there is a workaround for this issue that does not involve you supporting ancient D versions, and that is to actually use Debian's GDC on Travis. I use this excessively for my own projects, mostly though because I need newer system libraries and because I explicitly want to build with the packaged compilers as well.
> You can use a similar approach and limit it to GDC only, I created a PR for that: https://github.com/crimaniak/json-patch/pull/1
> As you can see on https://travis-ci.org/crimaniak/json-patch/jobs/387197216 , your code builds fine with the latest GDC.
 Wow! It works! Thanks!

> So, if you want that workaround, please take it, if not it may serve as a reference for others facing the same problem.
 Yes, pull request is approved. This is exactly what I was hoping to find. I also recommend this to others who have this problem. It takes some time to install required packages so build was much longer than dmd and lcd builds but I think it's not a problem for most cases.

Thanks to everyone who answered!