use D tool to copy imports instead of explicit list of rules#3026
use D tool to copy imports instead of explicit list of rules#3026thewilsonator merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @rainers! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#3026" |
aa7e9a7 to
405cdc7
Compare
I faced with this error when forgot to implement creation of ./import/ directory |
The main problem is to find a host dmd, as the CI scripts are either in a different repo (for azure-pipelines) or virtually immutable (auto-tester). |
|
auto-tester stalled? |
Not sure what happened, the test have passed successfully. I amended a couple of comments to restart the build. |
Geod24
left a comment
There was a problem hiding this comment.
Looks okay, but why not go all the way and copy things using a recursive descent instead of relying on mak/WINDOWS ?
| args = args[1..$]; | ||
|
|
||
| string importPath = absolutePath("import"); | ||
| string srcPath = absolutePath("src"); |
There was a problem hiding this comment.
This assumes that the script is run from the root project, right ?
Wouldn't the following at the module level be more robust:
immutable RootPath = __FILE_FULL_PATH__.dirName();
immutable ImportPath = RootPath.buildPath("import");
immutable SourceTarget = RootPath.buildPath("src");?
There was a problem hiding this comment.
My initial version allowed the import and src path to be configured via getopt, allowing it to be used in similar situations The current version assumes a bit more about files being passed on the command line, while your proposed change fixes it to the current single use.
It seems a bit strange to pass relative paths on the command line, but then assume other src/import paths internally. I'm not too opinionated, though.
dependency is on mak/COPY and mak/IMPORTS. There are currently a number of exceptions, namely files in core/sync, that are treated differently (i.e. are processed to di file). No idea why that is the case, though. Walter has objected the wildcard approach to avoid processing stale or temporary files for dmd, so I didn't try to change it here. |
Could we then move those files into the tool itself, like it has been done for |
I think that belongs into a separate PR as it should happen for all platforms. Otherwise we have new duplications in the build tool and mak/*. |
|
Is there anyone actually using these 'elaborately' copied imports on Windows? The DMD 2.091 package contains the full druntime and Phobos src trees, the .7z archive and the installer package too AFAICT, so at least the official Windows packages seem not to need any of this. Edit: Ah, I hadn't realized the druntime src dir contains an additional Edit2: This will also add 3 currently missing files ( |
mak/copyimports.d
Outdated
| /** | ||
| * Helper script to copy source files to the `import` directory | ||
| * | ||
| * When building druntime, files in `src` are copied to the `import` directory, excluding modules from the `rt` package. |
There was a problem hiding this comment.
Nit: 3 things are excluded, rt.*, gc.* and test_runner.d. And the .d -> .di conversions in core.sync.* as you've mentioned (LDC doesn't do that).
There was a problem hiding this comment.
Slightly adapted the comment, but left out the di-conversion as I plan to copy these files, too.
Yeah, the distribution is a bit of a mess. I think it should look more like LDC, not distributing sources of the compiler and the runtime, only "public" imports. For example, adding |
|
buildkite/druntime also failed |
Looks pretty unrelated, too, as this only changes the Windows build. |
- fixup for dlang#3026 - fixes 32-bit builds with ldc (vcvars x86, but x64 default target of ldc)
- fixup for dlang#3026 - fixes 32-bit release builds with ldc (vcvars x86, but x64 default target of ldc)
|
This of course broke the release builder. Weird cause I thought we had at least the Windows part covered by now.
Btw, would be nice if the next build system changes didn't land just before the scheduled beta ;). |
Sorry for the breakage.
The installer CI doesn't automatically run for changes in other repos. Maybe we can make it part of the nightly builds?
With the latest LDC, setting LDC_VSDIR_FORCE=1 avoids this trouble as it auto-detects the appropriate environment unconditionally.
AFAICT that variable is also deprecated for DMD, see https://github.com/dlang/dmd/blob/05ad63263925b7b2730660f90361b650a3ace8e6/src/posix.mak#L75 |
|
This also broke Digger. |
|
Another problem with this change is that it reports success despite that this step fails. This causes an error much later, when trying to build Phobos, manifesting as not finding |
as an alternative to #3024
This adds a host dmd as an additional dependency, but it's usually available as dmd needs one to build anyway. It might also pave the way for using D to replace other makefile functionality.
In addition, it builds the tool into generated/windows hoping to move other build artifacts there, too.