Bump the minimal version required to compile DMD to 2.076.1

Joakim dlang at joakim.fea.st
Wed Jan 17 06:58:56 UTC 2018


On Wednesday, 17 January 2018 at 05:50:12 UTC, Jonathan M Davis 
wrote:
> On Wednesday, January 17, 2018 05:39:31 Joakim via 
> Digitalmars-d wrote:
>> On Tuesday, 16 January 2018 at 22:11:46 UTC, H. S. Teoh wrote:
>> > On Tue, Jan 16, 2018 at 10:13:31PM +0000, Johan Engelen via 
>> > Digitalmars-d wrote: [...]
>> >
>> >> We shouldn't bump the required dlang version while knowing 
>> >> that it will break current distribution packaging. Before 
>> >> bumping the dlang version to something that would require 
>> >> more than one bootstrap step from C++, let's make sure that 
>> >> the distributions that we care about have something set up 
>> >> _already_ that meets the new dlang version requirement.
>> >
>> > [...]
>> >
>> > Is there currently a viable cross-compiler for D?  That 
>> > would solve, in theory anyway, the bootstrapping problem.  I 
>> > suppose to be truly viable, we'd need dmd to be able to 
>> > cross-compile, which AFAIK it can't just yet.
>>
>> Ldc has proven to be very viable.  kinke has demonstrated 
>> using it on linux/x64 to cross-compile for Windows:
>>
>> https://github.com/ldc-developers/ldc/releases/tag/v1.3.0
>>
>> The ldc package for Android/ARM in the Termux app is 
>> cross-compiled from linux/x64:
>>
>> https://github.com/termux/termux-packages/blob/master/packages/ldc/build.s h
>>
>> However, while this makes it easier to do the initial port to 
>> a new platform, you still come up against the bootstrapping 
>> from source requirements of source package repositories, as I 
>> pointed out above.
>
> _Most_ languages have a compiler written in their own language 
> rather than C/C++, and I cannot imagine that it's common 
> practice for any of them to go back to a version that was built 
> using C/C++ and bootstrap from there.
>
> Honestly, I don't see how this could possibly be an issue. This 
> is something that is already dealt with all the time by folks 
> packaging stuff - whether you're talking ports for BSD or 
> packages for whatever Linux distro you want - this is something 
> that they're already dealing with without requiring that 
> everything be built starting with a C/C++ compiler.
>
> I fully expect that in the long-term, folks porting to new 
> platforms will use a cross-compiler, and anyone building 
> packages for whatever OS they're dealing with is just going to 
> use the existing compiler. That's what folks do even when 
> they're building the entire distro from source. They use 
> existing compilers to do it. They may not then package the 
> existing compilers, but they're going to use ones that they 
> already have - either on a host system or that they pull them 
> in from elsewhere.
>
> Honestly, I think that this whole conversation is worrying 
> about a whole lot of nothing. We're dealing with a problem that 
> has already been solved by many other languages, and I don't 
> think that you're going to find any of them claiming that you 
> need to use a compiler from several years ago to compile the 
> current compiler, let alone claiming that you need to compile a 
> C/C++ version of their compiler so that you can build the 
> current compiler.

You're right, I should have checked before saying I didn't think 
any OS used binary packages to build their source packages.  
Looking it up now, this is exactly what FreeBSD ports and NetBSD 
pkgsrc do, using pre-built bootstrap compiler binaries of ghc to 
build the latest ghc:

https://svnweb.freebsd.org/ports/head/lang/ghc/Makefile?revision=457355&view=markup
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/ghc/Makefile?rev=1.56&content-type=text/x-cvsweb-markup

Even the aforementioned NixOS seems to do the same for ghc, so I 
guess Thomas Mader was wrong earlier?

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/ghc/8.2.1-binary.nix

Since this was the only objection I had to bumping the required D 
bootstrap compiler version, I don't have any objection anymore, 
as long as it's prominently documented that we expect new OS 
ports to be cross-compiled initially.

Also, I was looking at tying Iain's C++ 2.076 frontend to the dmd 
backend because I thought we needed a dmd-cxx branch for porters 
to use as a bootstrap compiler on their platforms.  If we're 
going to bump the required version and make porters cross-compile 
initially, I suppose there's no reason to waste any more time on 
such a dmd-cxx branch.


More information about the Digitalmars-d mailing list