www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Resurrecting a 2017 thread: dub and dmd as dub dependencies

reply FeepingCreature <feepingcreature gmail.com> writes:
On Tuesday, 8 August 2017 at 09:21:54 UTC, Moritz Maxeiner wrote:
 On Tuesday, 8 August 2017 at 09:17:02 UTC, data pulverizer 
 wrote:
 Hi,

 I would like to know how to specify dmd or ldc compiler and 
 version in a json dub file.

 Thanks in advance.
You can't [1]. You can specify the compiler to use only on the dub command line via `--compiler=`. [1] https://code.dlang.org/package-format?lang=json
Any reason you couldn't, say, specify the compiler version in the dub.sdl, and dub would build it (and use it) using the regular .dub/packages mechanism? Same should work for dub itself. Treat the current dub/dmd as a bootstrap compiler instead of the main compiler.
Aug 05
next sibling parent drug <drug2004 bk.ru> writes:
8/5/19 10:22 AM, FeepingCreature пишет:
 On Tuesday, 8 August 2017 at 09:21:54 UTC, Moritz Maxeiner wrote:
 On Tuesday, 8 August 2017 at 09:17:02 UTC, data pulverizer wrote:
 Hi,

 I would like to know how to specify dmd or ldc compiler and version 
 in a json dub file.

 Thanks in advance.
You can't [1]. You can specify the compiler to use only on the dub command line via `--compiler=`. [1] https://code.dlang.org/package-format?lang=json
Any reason you couldn't, say, specify the compiler version in the dub.sdl, and dub would build it (and use it) using the regular .dub/packages mechanism? Same should work for dub itself. Treat the current dub/dmd as a bootstrap compiler instead of the main compiler.
You can use Toolchain requirements (https://dub.pm/package-format-sdl.html#toolchain-requirements) to specify the compiler. But building the specific compiler version (bootstrapping) is not implemented I think.
Aug 05
prev sibling next sibling parent Andre Pany <andre s-e-a-p.de> writes:
On Monday, 5 August 2019 at 07:22:33 UTC, FeepingCreature wrote:
 On Tuesday, 8 August 2017 at 09:21:54 UTC, Moritz Maxeiner 
 wrote:
 On Tuesday, 8 August 2017 at 09:17:02 UTC, data pulverizer 
 wrote:
 Hi,

 I would like to know how to specify dmd or ldc compiler and 
 version in a json dub file.

 Thanks in advance.
You can't [1]. You can specify the compiler to use only on the dub command line via `--compiler=`. [1] https://code.dlang.org/package-format?lang=json
Any reason you couldn't, say, specify the compiler version in the dub.sdl, and dub would build it (and use it) using the regular .dub/packages mechanism? Same should work for dub itself. Treat the current dub/dmd as a bootstrap compiler instead of the main compiler.
Also the default compiler can be set in settings.json which can be located e.g. in the project folder(next version of dub). Kind regards Andre
Aug 05
prev sibling parent Seb <seb wilzba.ch> writes:
On Monday, 5 August 2019 at 07:22:33 UTC, FeepingCreature wrote:
 On Tuesday, 8 August 2017 at 09:21:54 UTC, Moritz Maxeiner 
 wrote:
 On Tuesday, 8 August 2017 at 09:17:02 UTC, data pulverizer 
 wrote:
 Hi,

 I would like to know how to specify dmd or ldc compiler and 
 version in a json dub file.

 Thanks in advance.
You can't [1]. You can specify the compiler to use only on the dub command line via `--compiler=`. [1] https://code.dlang.org/package-format?lang=json
Any reason you couldn't, say, specify the compiler version in the dub.sdl, and dub would build it (and use it) using the regular .dub/packages mechanism? Same should work for dub itself. Treat the current dub/dmd as a bootstrap compiler instead of the main compiler.
You could build a Makefile (or similar) around dub which ensures the exact compiler version gets downloaded. Here's a template I use for this purpose: https://github.com/wilzbach/d-bootstrap
Aug 05