From b7bcc8ac280ea7058be78d19d03344b712337b21 Mon Sep 17 00:00:00 2001 From: Andrei Horodniceanu Date: Sun, 6 Jul 2025 17:24:17 +0300 Subject: [PATCH 1/3] dscanner/analysis/mismatched_args.d: Replace deprecated DSymbol.argNames Replace deprecated member with functionParametes.map!`a.name` Signed-off-by: Andrei Horodniceanu --- src/dscanner/analysis/mismatched_args.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dscanner/analysis/mismatched_args.d b/src/dscanner/analysis/mismatched_args.d index db75eb4..a1f88df 100644 --- a/src/dscanner/analysis/mismatched_args.d +++ b/src/dscanner/analysis/mismatched_args.d @@ -53,7 +53,7 @@ final class MismatchedArgumentCheck : BaseAnalyzer { // The cast is a hack because .array() confuses the compiler's overload // resolution code. - const(istring)[] params = sym is null ? [] : sym.argNames[].map!(a => cast() a).array(); + const(istring)[] params = sym is null ? [] : sym.functionParameters.map!(a => a.name).array(); const ArgMismatch[] mismatches = compareArgsToParams(params, args); if (mismatches.length == 0) matched = true; From b9510f2f96d96e6db67d37ccc1e1eb5e84f964ed Mon Sep 17 00:00:00 2001 From: Andrei Horodniceanu Date: Sun, 6 Jul 2025 17:33:06 +0300 Subject: [PATCH 2/3] makefile: Support absolute paths for dmd With gdc and ldc2, DC=/usr/bin/ldc2 or other paths are correctly handled. With dmd, ldmd2, or gdmd, this is not the case because the makefile requires that DC must be exactly dmd, or ldmd2, or gdmd, absolute paths or versioned exes (dmd-2.111) not being supported. Signed-off-by: Andrei Horodniceanu --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 4d6dced..3eab028 100644 --- a/makefile +++ b/makefile @@ -66,7 +66,7 @@ override DMD_TEST_FLAGS += -w DC_DEBUG_FLAGS := -g -Jbin -ifeq ($(DC), $(filter $(DC), dmd ldmd2 gdmd)) +ifneq (,$(findstring dmd, $(DC))) VERSIONS := $(DMD_VERSIONS) DEBUG_VERSIONS := $(DMD_DEBUG_VERSIONS) DC_FLAGS += $(DMD_FLAGS) From 5efaf4faec6244e12fcb0fdddd226fe9369913b8 Mon Sep 17 00:00:00 2001 From: Andrei Horodniceanu Date: Sun, 6 Jul 2025 17:27:13 +0300 Subject: [PATCH 3/3] CI: bump setup-dlang to v2 Signed-off-by: Andrei Horodniceanu --- .github/workflows/default.yml | 90 +++++++++++++---------------------- 1 file changed, 33 insertions(+), 57 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 3061cd9..1d731ca 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -7,6 +7,11 @@ on: branches: - master + +defaults: + run: + shell: bash + jobs: main: name: Run all tests @@ -19,24 +24,14 @@ jobs: fail-fast: false matrix: compiler: [ - { - version: dmd-latest, - dmd: dmd - }, - { - version: ldc-latest, - dmd: ldmd2 - }, - { - # Install dmd for the associated tools (dub/rdmd) - version: dmd-latest, - dmd: gdc-12 - } + dmd-latest, + ldc-latest, + gdc-12, ] host: [ ubuntu-22.04, macos-latest, - windows-latest + windows-latest, ] build: [ { type: make }, @@ -50,32 +45,13 @@ jobs: exclude: # Restrict GDC to Ubuntu - - compiler: - dmd: gdc-12 + - compiler: gdc-12 host: windows-latest - - compiler: - dmd: gdc-12 + - compiler: gdc-12 host: macos-latest - # Restrict DMD to macOS latest - - compiler: - dmd: dmd - host: macos-latest - - # Omit dub builds for GDC because dub rejects the old fronted revision - - compiler: - dmd: gdc-12 - build: - type: dub include: - - { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: { version: dmd-latest, dmd: dmd } } - - - compiler: - dmd: dmd - host: macos-13 - build: - type: 'dub' - version: 'current' + - { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: dmd-latest } runs-on: ${{ matrix.host }} @@ -87,27 +63,30 @@ jobs: submodules: 'recursive' fetch-depth: 0 - # Install the host compiler (DMD or LDC) - # Also grabs DMD for GDC to include dub + rdmd - - name: Install ${{ matrix.compiler.version }} - if: ${{ matrix.compiler.dmd != 'gdc-12' || matrix.build.type == 'dub' }} # Fetch required tools for GDC - uses: dlang-community/setup-dlang@v1 - with: - compiler: ${{ matrix.compiler.version }} + - name: Install Dlang tools (for gdc) + if: ${{ startsWith(matrix.compiler, 'gdc') }} + uses: dlang-community/setup-dlang@v2 - # GDC not yet supported by setup-dlang - - name: Install GDC via apt-get - if: ${{ matrix.compiler.dmd == 'gdc-12' }} + # Install the host compiler + - name: Install ${{ matrix.compiler }} + uses: dlang-community/setup-dlang@v2 + with: + compiler: ${{ matrix.compiler }} + + - name: Setup DFLAGS for gdc + if: ${{ startsWith(matrix.compiler, 'gdc') }} + # Need to pass -allinst otherwise the build fails + # We can't simply use `DFLAGS=-allinst dub` since that + # disables unittests. run: | - sudo apt-get install gdc-12 -y - gdc-12 --version + cat <