RejectedSoftware Forums

Sign up

Set dub to use gdc?

Hi,

How do I tell dub to use gdc? On Debian wheezy, the actual gdc bin is gdc-4.6. For any variation on:

$ dub --compiler=gdc-4.6

I keep getting the error message:


Error executing command run: Failed to invoke the compiler gdc-4.6 to determine the build platform: {
  "compiler": "gdc",
  "frontendVersion": 2055,
  "compilerVendor": "GDC",
  "platform": [
/tmp/dub_platform_probe.d:43: Error: function expected before (), not join(ret.data()) of type string
/tmp/dub_platform_probe.d:11: Error: cannot evaluate determinePlatform() at compile time
"    " ~ determinePlatform()
  ],
  "architecture": [
/tmp/dub_platform_probe.d:14: Error: cannot evaluate determineArchitecture() at compile time
"    " ~ determineArchitecture()
   ],
}

Thing is, unless I am really tired, It is nowhere to be found on how to tell dub to use a given compiler. I found the --compiler flag somewhere on the forum.

Thx,

Olivier

p.s: I post the same message on the vibe thread. Sorry...

Re: Set dub to use gdc?

On Sat, 11 Oct 2014 15:28:37 GMT, olivier henley wrote:

Hi,

How do I tell dub to use gdc? On Debian wheezy, the actual gdc bin is gdc-4.6. For any variation on:

$ dub --compiler=gdc-4.6

I keep getting the error message:


Error executing command run: Failed to invoke the compiler gdc-4.6 to determine the build platform: {
  "compiler": "gdc",
  "frontendVersion": 2055,
  "compilerVendor": "GDC",
  "platform": [
/tmp/dub_platform_probe.d:43: Error: function expected before (), not join(ret.data()) of type string
/tmp/dub_platform_probe.d:11: Error: cannot evaluate determinePlatform() at compile time
"    " ~ determinePlatform()
  ],
  "architecture": [
/tmp/dub_platform_probe.d:14: Error: cannot evaluate determineArchitecture() at compile time
"    " ~ determineArchitecture()
   ],
}

Thing is, unless I am really tired, It is nowhere to be found on how to tell dub to use a given compiler. I found the --compiler flag somewhere on the forum.

Thx,

Olivier

p.s: I post the same message on the vibe thread. Sorry...

The thing is, gdc-4.6 is awfully old, and so is the frontend it uses (2.055).
You will get A LOT of bugs with any modern codebase (including Vibe's) if you try to work with it. I strongly recommend that you go for gdc-4.9 (which is 2.065), or even switch to DMD unless there is a very good reason not too, and you know what you are doing.

If you do not wish to upgrade your version of gdc, you will have to go back to an earlier version of dub, too, as dub uses a method to determine the platform it is building for (by creating a probe file and compiling it), which is not supported by this old version.

Re: Set dub to use gdc?

On Sun, 12 Oct 2014 00:32:48 GMT, Geod24 wrote:

The thing is, gdc-4.6 is awfully old, and so is the frontend it uses (2.055).
You will get A LOT of bugs with any modern codebase (including Vibe's) if you try to work with it. I strongly recommend that you go for gdc-4.9 (which is 2.065), or even switch to DMD unless there is a very good reason not too, and you know what you are doing.

If you do not wish to upgrade your version of gdc, you will have to go back to an earlier version of dub, too, as dub uses a method to determine the platform it is building for (by creating a probe file and compiling it), which is not supported by this old version.

kk, now it makes sense. Packages on wheezy are always ... ok most of the time awfully old. I will update accordingly.

Actually I use dmd and my app hits a segfault with zero debug info when run through gdb. From what I read on dlang's forum, a gdc debug build of my app would probably give better insight. Is it right?

Thank you for the guidance!