From c7aa29e35d7bc480fda62da80813c56e6b842511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Stein?= Date: Tue, 2 Jul 2024 09:39:13 +0200 Subject: [PATCH 1/8] Update dependencies and fix compiler errors with recent DMD (v2.109.9) --- dub.sdl | 2 +- dub.selections.json | 2 +- src/d_tree_sitter/libc.dpp | 3 +++ src/d_tree_sitter/node.d | 2 +- src/d_tree_sitter/parser.d | 6 +++--- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dub.sdl b/dub.sdl index eec9903..017a9c9 100644 --- a/dub.sdl +++ b/dub.sdl @@ -16,7 +16,7 @@ sourceFiles "./src/d_tree_sitter/libc.d" // gen by dpp extraDependencyFiles "./src/tree-sitter-version.txt" "./package.json" "./src/meson.build" lflags "$PACKAGE_DIR/src/d_tree_sitter/build/libtree_sitter.a" -dependency "bc-string" version="1.2.2" +dependency "bc-string" version="1.4.0" // -------- Build Options and configurations -------- diff --git a/dub.selections.json b/dub.selections.json index 19a65e9..55bf261 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -1,6 +1,6 @@ { "fileVersion": 1, "versions": { - "bc-string": "1.2.2" + "bc-string": "1.4.0" } } diff --git a/src/d_tree_sitter/libc.dpp b/src/d_tree_sitter/libc.dpp index e61fa67..21ea240 100644 --- a/src/d_tree_sitter/libc.dpp +++ b/src/d_tree_sitter/libc.dpp @@ -1,3 +1,6 @@ module libc; +import core.stdc.stdint; + + #include "./gen/tree-sitter/lib/include/tree_sitter/api.h" diff --git a/src/d_tree_sitter/node.d b/src/d_tree_sitter/node.d index d0e62d0..cfed0c6 100644 --- a/src/d_tree_sitter/node.d +++ b/src/d_tree_sitter/node.d @@ -365,7 +365,7 @@ struct Node A node. If the given node doesn't have a parent, it returns the node itself. Note: the nth might not be reached if there are no more parents. */ - auto nth_parent(in uint max_nth = 2) @nogc nothrow @trusted const + auto nth_parent(uint max_nth = 2) @nogc nothrow @trusted const { auto maybeFirstParent = this.parent(); if (maybeFirstParent.isNull()) diff --git a/src/d_tree_sitter/parser.d b/src/d_tree_sitter/parser.d index 433a291..ef709c8 100644 --- a/src/d_tree_sitter/parser.d +++ b/src/d_tree_sitter/parser.d @@ -29,7 +29,7 @@ struct Parser Params: language = the language you want to create a parser for */ - this(in Language language) nothrow @nogc + this(Language language) nothrow @nogc { // Create a parser. this.tsparser = ts_parser_new(); @@ -54,7 +54,7 @@ struct Parser * NOTE it assumes that the language is compatible. Returns a boolean indicating whether or not the language was successfully * assigned. */ - auto set_language_nothrow(in Language language) nothrow + auto set_language_nothrow(Language language) nothrow { return ts_parser_set_language(tsparser, language.tslanguage); } @@ -69,7 +69,7 @@ struct Parser * and compare it to this library's `TREE_SITTER_LANGUAGE_VERSION` and * `TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION` constants. */ - auto set_language(in Language language) + auto set_language(Language language) { // TODO make set_language private? enforce_compatible_language(language); From af39103d008f14a793096e2fb3e3ad9820cb8a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Stein?= Date: Wed, 3 Jul 2024 14:22:51 +0200 Subject: [PATCH 2/8] ci: update to a more recent toolchain --- .github/workflows/CI.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d0e8672..a05deb2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,18 +13,18 @@ jobs: fail-fast: false matrix: os: - - ubuntu-20.04 + - ubuntu-24.04 - windows-2022 - - macos-11.0 + - macos-13.0 d: - - "ldc-1.28.1" - - "dmd-2.098.1" + - "ldc-1.38.0" + - "dmd-2.109.1" clang: - - 13.0.0 + - 18.0.0 cmake: - - 3.22.2 + - 3.28.3 ninja: - - 1.10.2 + - 1.11.1 exclude: # TODO ci job fails with object.Error@(0): Access Violation error - os: windows-2022 From 26b38dd423bb5df11ca787d947f0b0b188396d4b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 3 Jul 2024 15:21:08 -0700 Subject: [PATCH 3/8] build: remove dip flags --- dub.sdl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dub.sdl b/dub.sdl index 017a9c9..ecd7394 100644 --- a/dub.sdl +++ b/dub.sdl @@ -20,11 +20,6 @@ dependency "bc-string" version="1.4.0" // -------- Build Options and configurations -------- -// enables most of the dips -dflags "-preview=dip25" "-preview=dip1000" "-preview=dip1008" "-preview=fieldwise" "-preview=fixAliasThis" "-preview=intpromote" "-preview=rvaluerefparam" "-preview=in" -/* dflags "-preview=dip1021" */ // causes random crashes -/* dflags "-preview=inclusiveincontracts" platform="dmd" // only on dmd */ - buildType "release" { dflags "-vgc" "--flto=full" "--ffast-math" "--linkonce-templates" platform="ldc" buildOptions "releaseMode" "optimize" "inline" From 01b3e97a969507233168e8014efa6f12597f76ef Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 3 Jul 2024 15:27:32 -0700 Subject: [PATCH 4/8] ci: use the default setup-cpp version for LLVM --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a05deb2..2a5ee0f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,7 +20,8 @@ jobs: - "ldc-1.38.0" - "dmd-2.109.1" clang: - - 18.0.0 + # default setup-cpp version + - true cmake: - 3.28.3 ninja: From e8ac69bc6e1fc7aaaf2ef8b2935cdebcd0cf7688 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 4 Jul 2024 13:17:16 -0700 Subject: [PATCH 5/8] ci: use ubuntu 22.04 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2a5ee0f..a930333 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-24.04 + - ubuntu-22.04 - windows-2022 - macos-13.0 d: From b499e831d77bb26c9c790316a4508e86ad6f1327 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 10 Jul 2024 11:50:11 -0700 Subject: [PATCH 6/8] ci: use release build type for dub lint --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a930333..e02004a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -77,3 +77,5 @@ jobs: - name: Lint run: dub lint + env: + DUB_BUILD_TYPE: release From 71cd5b66b0dbf0994cd9c3b977d482b13e5f8092 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 10 Jul 2024 12:00:18 -0700 Subject: [PATCH 7/8] ci: disable dub lint due to crashes --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e02004a..9244c15 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -75,7 +75,7 @@ jobs: env: DUB_BUILD_TYPE: debug - - name: Lint - run: dub lint - env: - DUB_BUILD_TYPE: release + # - name: Lint + # run: dub lint + # env: + # DUB_BUILD_TYPE: release From 319e77a787f9c97acd4768ec699db1ef62d45bcd Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 10 Jul 2024 22:00:32 -0700 Subject: [PATCH 8/8] ci: use macos 13 instead of 13.0 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9244c15..6afd012 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,7 +15,7 @@ jobs: os: - ubuntu-22.04 - windows-2022 - - macos-13.0 + - macos-13 d: - "ldc-1.38.0" - "dmd-2.109.1"