Compare commits

..

No commits in common. "master" and "v0.16.0-beta.3" have entirely different histories.

10 changed files with 35 additions and 84 deletions

View File

@ -5,8 +5,3 @@ indent_size = 4
tab_width = 4
trim_trailing_whitespace = true
indent_style = tab
[.github/workflows/*.yml]
indent_size = 2
tab_width = 2
indent_style = space

View File

@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
# use older ubuntu / linux version for glibc compatibility
os: [ubuntu-22.04, windows-latest]
os: [ubuntu-20.04, windows-latest, macos-latest]
dc:
- ldc-latest
- dmd-latest
@ -27,48 +27,20 @@ jobs:
dc: ldc-latest
build: debug
libdparse-version: min
# macos only with LDC
- { os: macos-latest, dc: ldc-latest, libdparse-version: min, build: debug, arch: x86_64 }
- { os: macos-latest, dc: ldc-latest, libdparse-version: min, build: release, arch: x86_64 }
- { os: macos-latest, dc: ldc-latest, libdparse-version: max, build: debug, arch: x86_64 }
- { os: macos-latest, dc: ldc-latest, libdparse-version: max, build: release, arch: x86_64 }
- { os: macos-latest, dc: ldc-latest, libdparse-version: min, build: debug, arch: aarch64 }
- { os: macos-latest, dc: ldc-latest, libdparse-version: min, build: release, arch: aarch64 }
- { os: macos-latest, dc: ldc-latest, libdparse-version: max, build: debug, arch: aarch64 }
- { os: macos-latest, dc: ldc-latest, libdparse-version: max, build: release, arch: aarch64 }
# old compiler tests
- { os: ubuntu-22.04, dc: dmd-2.095.1, libdparse-version: min, build: debug, arch: x86_64 }
- { os: ubuntu-22.04, dc: ldc-1.25.0, libdparse-version: min, build: debug, arch: x86_64 }
# gdc
- { os: ubuntu-24.04, dc: gdc-14, libdparse-version: min, build: debug, arch: x86_64 }
- { os: ubuntu-24.04, dc: gdc-14, libdparse-version: max, build: debug, arch: x86_64 }
- { os: ubuntu-20.04, dc: dmd-2.095.1, libdparse-version: min, build: debug, arch: x86_64 }
- { os: ubuntu-20.04, dc: ldc-1.25.0, libdparse-version: min, build: debug, arch: x86_64 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup D tools (gdc only)
if: ${{ startsWith(matrix.dc, 'gdc') }}
uses: dlang-community/setup-dlang@v2
- name: Setup D
uses: dlang-community/setup-dlang@v2
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}
- name: Set gdc specific environment variables
if: ${{ startsWith(matrix.dc, 'gdc') }}
run: |
tee -a ${GITHUB_ENV} <<<"DC=${DMD}" # need gdmd for -run
# Linking errors without -allinst
# No other easy way to pass this to dub, using DFLAGS in the
# environment disables unittests
cat <<-EOF | sudo tee -a /etc/dmd.conf
[Environment]
DFLAGS=-allinst
EOF
# Build
- name: Build
@ -80,6 +52,7 @@ jobs:
- name: Build DSymbol
env:
DC: ${{matrix.dc}}
LIBDPARSE_VERSION: ${{ matrix.libdparse-version }}
run: |
cd dsymbol
@ -87,6 +60,7 @@ jobs:
- name: Test DSymbol
env:
DC: ${{matrix.dc}}
LIBDPARSE_VERSION: ${{ matrix.libdparse-version }}
run: |
cd dsymbol

View File

@ -10,7 +10,7 @@ on:
jobs:
intro_comment:
name: Make intro comment
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: 'Prepare sticky comment'
# commit of v2.5.0

View File

@ -9,22 +9,24 @@ on:
jobs:
comment:
name: PR Info
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
# from https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
- name: 'Download artifact'
uses: actions/github-script@v8
uses: actions/github-script@v3.1.0
with:
script: |
var { data: artifacts } = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.artifacts.filter((artifact) => artifact.name === "pr")[0];
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,

View File

@ -18,12 +18,12 @@ jobs:
# Compiler to test with
- name: Prepare compiler
uses: dlang-community/setup-dlang@v2
uses: dlang-community/setup-dlang@v1
with:
compiler: dmd-latest
- name: Prepare compiler
uses: dlang-community/setup-dlang@v2
uses: dlang-community/setup-dlang@v1
with:
compiler: ldc-latest

View File

@ -9,14 +9,11 @@ jobs:
fail-fast: false
matrix:
# use older ubuntu / linux version for glibc compatibility
os: [ubuntu-22.04, windows-latest]
os: [ubuntu-20.04, windows-latest, macos-latest]
dc:
- ldc-latest
arch:
- x86_64
include:
- os: macos-latest
arch: aarch64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
@ -24,7 +21,7 @@ jobs:
submodules: recursive
- name: Setup D
uses: dlang-community/setup-dlang@v2
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}

2
.gitignore vendored
View File

@ -31,8 +31,6 @@ stdout.txt
# script-generated expected with absolute file paths
tests/tc_locate_ufcs_function/expected.txt
tests/tc_recursive_public_import/expected.txt
# other script-generated files
tests/extra/tc_ufcs_all_kinds/generate_tests
# Dub files
.dub

View File

@ -576,7 +576,7 @@ version (linux) unittest
}
const rssAfter = getRSS();
// check the process memory increase with some eyeballed threshold
assert(rssAfter - rssBefore < 6_000);
assert(rssAfter - rssBefore < 5000);
}
// this is for testing that internString data is always on the same address

View File

@ -129,27 +129,29 @@ int main(string[] args)
fs.write("proc_test.d", code);
auto output = executeShell("$DC -verrors=0 $ERROR_STYLE -c proc_test.d").output;
auto output = executeShell("$DC -verrors=0 -c proc_test.d").output;
size_t numErrors = 0;
string[][string] variableIncompatibilities;
// Example of a line we want to match: `proc_test.d:2568:22: error: [...]'
auto errRegex = regex(`proc_test\.d:([0-9]*):[0-9]*: error`, "i");
foreach (err; output.lineSplitter)
{
if (auto m = matchFirst(err, errRegex)) {
auto lineNo = to!int(m[1]);
string line = lines[lineNo - 1];
enforce(line.endsWith("();"), "Unexpected error in line " ~ lineNo.to!string);
line = line[0 .. $ - 3];
string varName = line.findSplit(".")[0];
string funcName = line.findSplit(".")[2];
// writeln("variable type ", varLookup[varName], " can't call ", funcLookup[funcName]);
variableIncompatibilities[varName] ~= funcName;
numErrors++;
}
if (!err.startsWith("proc_test.d("))
continue;
err = err["proc_test.d(".length .. $];
auto lineNo = err.parse!int;
if (!err.startsWith("): Error: "))
continue;
err = err["): Error: ".length .. $];
string line = lines[lineNo - 1];
enforce(line.endsWith("();"), "Unexpected error in line " ~ lineNo.to!string);
line = line[0 .. $ - 3];
string varName = line.findSplit(".")[0];
string funcName = line.findSplit(".")[2];
// writeln("variable type ", varLookup[varName], " can't call ", funcLookup[funcName]);
variableIncompatibilities[varName] ~= funcName;
numErrors++;
}
enforce(numErrors > 1_000, "compiler didn't error as expected, need to adjust tests!");

View File

@ -4,21 +4,4 @@ if [ -z "${DC:-}" ]; then
DC=dmd
fi
DCBASE=$(basename "${DC}")
# Set up ERROR_STYLE to make all compilers output errors in the same
# format to make matching easier in generate_tests.d.
if [[ ${DCBASE} =~ gdmd ]]; then
ERROR_STYLE=
elif [[ ${DCBASE} =~ dmd|ldc ]]; then
ERROR_STYLE='-verror-style=gnu -vcolumns'
else
echo "unknonwn compiler ${DC}"
exit 1
fi
export DC ERROR_STYLE
# gdc uses language specific error message
export LC_ALL=${LC_ALL:-"C.UTF-8"}
${DC} -run generate_tests.d "${1}"
DC="$DC" "$DC" -run generate_tests.d "$1"