Thread overview
Include D standard library source with packaged releases?
Dec 27, 2017
Jon Degenhardt
Dec 27, 2017
kinke
Dec 27, 2017
kinke
Dec 27, 2017
Jon Degenhardt
December 27, 2017
I'm wondering if LDC packaged releases should include source for D standard libraries (druntime, phobos). This would enable the ldc-build-runtime tool to operate without downloading the library source for the release as a separate step.

A specific rationale for doing this would be to be friendlier to package mangers like HomeBrew that have an aversion to downloads during the build process. I don't know if other package managers have similar constraints, but it seems a reasonable restriction.

For the apps I tested, building with LTO against druntime/phobos proved so valuable that it is desirable to build with these settings. If other apps show similar results there will be increased value in enabling these build steps in package mangers.

--Jon
December 27, 2017
On Wednesday, 27 December 2017 at 01:11:03 UTC, Jon Degenhardt wrote:
> I'm wondering if LDC packaged releases should include source for D standard libraries (druntime, phobos). This would enable the ldc-build-runtime tool to operate without downloading the library source for the release as a separate step.

Hey Jon, the main reasons are:

- The runtime libraries also include profile-rt and jit-rt, which are part of the main LDC repo.
- The essential runtimes CMake script is part of the main LDC repo since it covers all runtime libraries.

An LDC distribution comes with _nearly_ all of the druntime/Phobos source already (the imports) - druntime's `rt` directory is missing for example (not meant to be imported from user code, but compiled-in).

So adding more source files just to please alternative packaging systems is not really something I'd be fond of.
December 27, 2017
I've just had a quick look at the HomeBrew formula. [1] It's pulling down the full source archive as expected. So providing the extracted dir as `--ldcSrcDir` to ldc-build-runtime should work just fine without downloading anything.

[1] https://github.com/Homebrew/homebrew-core/blob/master/Formula/ldc.rb
December 27, 2017
On Wednesday, 27 December 2017 at 13:43:28 UTC, kinke wrote:
> I've just had a quick look at the HomeBrew formula. [1] It's pulling down the full source archive as expected. So providing the extracted dir as `--ldcSrcDir` to ldc-build-runtime should work just fine without downloading anything.
>
> [1] https://github.com/Homebrew/homebrew-core/blob/master/Formula/ldc.rb

Oh, I thought it was necessary to provide the source directory path with `--ldcSrcDir`. In any case, if the source is already there, a download can be avoided. I'll check this out.