mirror of
https://github.com/dlang/tools.git
synced 2025-05-03 08:30:35 +03:00
Merge remote-tracking branch 'upstream/master' into stable
This commit is contained in:
commit
967b52f734
7 changed files with 30 additions and 79 deletions
26
.travis.yml
26
.travis.yml
|
@ -1,26 +0,0 @@
|
||||||
language: d
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- d: dmd
|
|
||||||
env: MODEL=64
|
|
||||||
- d: dmd-nightly
|
|
||||||
env: MODEL=64
|
|
||||||
- d: dmd
|
|
||||||
env: MODEL=32
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- libcurl4-openssl-dev:i386
|
|
||||||
- d: dmd-nightly
|
|
||||||
env: MODEL=32
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- libcurl4-openssl-dev:i386
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./travis.sh
|
|
|
@ -3,7 +3,6 @@ D tools
|
||||||
|
|
||||||
[](https://github.com/dlang/tools/releases)
|
[](https://github.com/dlang/tools/releases)
|
||||||
[](https://issues.dlang.org/buglist.cgi?component=tools&list_id=220149&product=D&resolution=---)
|
[](https://issues.dlang.org/buglist.cgi?component=tools&list_id=220149&product=D&resolution=---)
|
||||||
[](https://travis-ci.org/dlang/tools)
|
|
||||||
[](https://buildkite.com/dlang/tools)
|
[](https://buildkite.com/dlang/tools)
|
||||||
[](https://github.com/dlang/tools/blob/master/LICENSE.txt)
|
[](https://github.com/dlang/tools/blob/master/LICENSE.txt)
|
||||||
|
|
||||||
|
|
3
changelog/rdmd-environment-args.dd
Normal file
3
changelog/rdmd-environment-args.dd
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
rdmd now supports specifying the D compiler using the `RDMD_DMD` environment variable
|
||||||
|
|
||||||
|
rdmd now uses the `RDMD_DMD` environment variable, if it is present in the environment, to choose the D compiler to use. As with the `--compiler` option, the variable's value must specify the name or path of a compiler with a DMD-like command line syntax, such as `gdmd` or `ldmd2`. The variable overrides the default (which is decided at the time `rdmd` was built), but can still be overridden by the `--compiler` option.
|
|
@ -89,6 +89,12 @@ of the options.
|
||||||
Specify directory to store cached program and other
|
Specify directory to store cached program and other
|
||||||
temporaries [default = as per \fIhttp://dlang.org/phobos/std_file.html#.tempDir\fR]
|
temporaries [default = as per \fIhttp://dlang.org/phobos/std_file.html#.tempDir\fR]
|
||||||
|
|
||||||
|
.SH ENVIRONMENT
|
||||||
|
.TP
|
||||||
|
.B RDMD_DMD
|
||||||
|
Specifies the D compiler to use, in the same way as \fB--compiler\fR, when \fB--compiler\fR is not specified.
|
||||||
|
.PP
|
||||||
|
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
.B dmd
|
.B dmd
|
||||||
or
|
or
|
||||||
|
|
28
rdmd.d
28
rdmd.d
|
@ -64,18 +64,11 @@ else version (LDC)
|
||||||
private enum defaultCompiler = "ldmd2";
|
private enum defaultCompiler = "ldmd2";
|
||||||
else
|
else
|
||||||
static assert(false, "Unknown compiler");
|
static assert(false, "Unknown compiler");
|
||||||
|
private string compiler = null;
|
||||||
private string compiler = defaultCompiler;
|
|
||||||
|
|
||||||
version(unittest) {} else
|
version(unittest) {} else
|
||||||
int main(string[] args)
|
int main(string[] args)
|
||||||
{
|
{
|
||||||
// Look for the D compiler rdmd invokes automatically in the same directory as rdmd
|
|
||||||
// and fall back to using the one in your path otherwise.
|
|
||||||
string compilerPath = buildPath(dirName(thisExePath()), defaultCompiler ~ binExt);
|
|
||||||
if (Filesystem.existsAsFile(compilerPath))
|
|
||||||
compiler = compilerPath;
|
|
||||||
|
|
||||||
if (args.length > 1 && args[1].startsWith("--shebang ", "--shebang="))
|
if (args.length > 1 && args[1].startsWith("--shebang ", "--shebang="))
|
||||||
{
|
{
|
||||||
// multiple options wrapped in one
|
// multiple options wrapped in one
|
||||||
|
@ -142,6 +135,7 @@ int main(string[] args)
|
||||||
string[] eval; // set by --eval
|
string[] eval; // set by --eval
|
||||||
bool makeDepend;
|
bool makeDepend;
|
||||||
string makeDepFile;
|
string makeDepFile;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
getopt(argsBeforeProgram,
|
getopt(argsBeforeProgram,
|
||||||
|
@ -173,6 +167,24 @@ int main(string[] args)
|
||||||
if (bailout) return 0;
|
if (bailout) return 0;
|
||||||
if (dryRun) chatty = true; // dry-run implies chatty
|
if (dryRun) chatty = true; // dry-run implies chatty
|
||||||
|
|
||||||
|
// If we don't have a known compiler specified by the user,
|
||||||
|
// then we need to look to see if it was specified via an environmental argument.
|
||||||
|
// We need to do this due to rdmd being used as the execution engine for shebang files.
|
||||||
|
// This was originally tested with both $DMD, and $DC variable support.
|
||||||
|
// It was removed due to the current test suites being fragile enough that it broke them.
|
||||||
|
if (!compiler)
|
||||||
|
compiler = environment.get("RDMD_DMD", null);
|
||||||
|
if (!compiler)
|
||||||
|
{
|
||||||
|
compiler = defaultCompiler;
|
||||||
|
|
||||||
|
// Look for the D compiler rdmd invokes automatically in the same directory as rdmd
|
||||||
|
// and fall back to using the one in your path otherwise.
|
||||||
|
string compilerPath = buildPath(dirName(thisExePath()), compiler ~ binExt);
|
||||||
|
if (Filesystem.existsAsFile(compilerPath))
|
||||||
|
compiler = compilerPath;
|
||||||
|
}
|
||||||
|
|
||||||
/* Only -of is supported because Make is very susceptible to file names, and
|
/* Only -of is supported because Make is very susceptible to file names, and
|
||||||
* it doesn't do a good job resolving them. One option would be to use
|
* it doesn't do a good job resolving them. One option would be to use
|
||||||
* std.path.buildNormalizedPath(), but some corner cases will break, so it
|
* std.path.buildNormalizedPath(), but some corner cases will break, so it
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env dub
|
#!/usr/bin/env dub
|
||||||
/++dub.sdl:
|
/++dub.sdl:
|
||||||
name "tests_extractor"
|
name "tests_extractor"
|
||||||
dependency "libdparse" version="~>0.15.1"
|
dependency "libdparse" version="~>0.19.0"
|
||||||
+/
|
+/
|
||||||
/*
|
/*
|
||||||
* Parses all public unittests that are visible on dlang.org
|
* Parses all public unittests that are visible on dlang.org
|
||||||
|
|
43
travis.sh
43
travis.sh
|
@ -1,43 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -uexo pipefail
|
|
||||||
|
|
||||||
~/dlang/install.sh install gdc
|
|
||||||
~/dlang/install.sh install ldc
|
|
||||||
|
|
||||||
~/dlang/install.sh list
|
|
||||||
|
|
||||||
GDMD=$(find ~/dlang -type f -name "gdmd")
|
|
||||||
LDMD2=$(find ~/dlang -type f -name "ldmd2")
|
|
||||||
|
|
||||||
make -f posix.mak all DMD="$(which dmd)"
|
|
||||||
make -f posix.mak test DMD="$(which dmd)" \
|
|
||||||
RDMD_TEST_COMPILERS=dmd,"$GDMD","$LDMD2" \
|
|
||||||
VERBOSE_RDMD_TEST=1
|
|
||||||
|
|
||||||
# Test setup.sh
|
|
||||||
shellcheck setup.sh
|
|
||||||
|
|
||||||
dmd=dmd/generated/linux/release/64/dmd
|
|
||||||
dir=generated/setup.sh-test
|
|
||||||
cwd="$(pwd)"
|
|
||||||
|
|
||||||
# check initial checkout
|
|
||||||
rm -rf "$dir" && mkdir "$dir" && pushd "$dir"
|
|
||||||
echo "y" | "$cwd"/setup.sh
|
|
||||||
echo 'void main(){ import std.stdio; "Hello World".writeln;}' | "./${dmd}" -run - | grep -q "Hello World"
|
|
||||||
|
|
||||||
# test updates
|
|
||||||
echo "y" | "$cwd"/setup.sh
|
|
||||||
echo 'void main(){ import std.stdio; "Hello World".writeln;}' | "./${dmd}" -run - | grep -q "Hello World"
|
|
||||||
popd && rm -rf "$dir" && mkdir "$dir" && pushd "$dir"
|
|
||||||
|
|
||||||
# test checking out tags
|
|
||||||
# requires an older host compiler too, see also: https://github.com/dlang/tools/pull/324
|
|
||||||
. $(~/dlang/install.sh install dmd-2.078.1 -a)
|
|
||||||
echo "y" | "$cwd"/setup.sh --tag=2.078.1
|
|
||||||
echo 'void main(){ import std.stdio; __VERSION__.writeln;}' | "./2.078.1/${dmd}" -run - | grep -q "2078"
|
|
||||||
popd
|
|
||||||
|
|
||||||
# test building the DUB packages
|
|
||||||
./test/test_dub.sh
|
|
Loading…
Add table
Add a link
Reference in a new issue