From d9de45ac3fffd9affa059d7404234f79ba00dfae Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 19 Apr 2021 11:03:35 -0400 Subject: ext-dep: d2sqlite3 updated --- src/ext_depends/d2sqlite3.meta | 2 +- .../d2sqlite3/.github/workflows/documentation.yaml | 58 ++++++++++++++++++++ .../d2sqlite3/.github/workflows/main.yaml | 61 ++-------------------- .../d2sqlite3/source/d2sqlite3/internal/memory.d | 29 +++++----- 4 files changed, 74 insertions(+), 76 deletions(-) create mode 100644 src/ext_depends/d2sqlite3/.github/workflows/documentation.yaml (limited to 'src') diff --git a/src/ext_depends/d2sqlite3.meta b/src/ext_depends/d2sqlite3.meta index 9623dc7..2661c82 100644 --- a/src/ext_depends/d2sqlite3.meta +++ b/src/ext_depends/d2sqlite3.meta @@ -1,3 +1,3 @@ -d2sqlite3 36ed18ac +d2sqlite3 052bc41c https://github.com/dlang-community/d2sqlite3 Boost Software License 1.0 (BSL-1.0) diff --git a/src/ext_depends/d2sqlite3/.github/workflows/documentation.yaml b/src/ext_depends/d2sqlite3/.github/workflows/documentation.yaml new file mode 100644 index 0000000..97fa25e --- /dev/null +++ b/src/ext_depends/d2sqlite3/.github/workflows/documentation.yaml @@ -0,0 +1,58 @@ +# Documentation build: Only runs on Linux +# Still need to install dependencies and the compiler because DDOX +# does a full build +name: Documentation +on: [push, pull_request] + +jobs: + doc: + name: Build and upload documentation + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + + # Checkout this repository and its submodules + - name: Checkout repository + uses: actions/checkout@v2 + + # Install the D compiler + - name: Prepare compiler + uses: dlang-community/setup-dlang@v1 + with: + compiler: ldc-latest + + - name: 'Install dependencies & setup environment' + run: | + sudo apt-get update + sudo apt-get install libsqlite3-dev + + - name: Build documentation + run: | + dub build -b ddox + # Generate the HTML to docs + dub run ddox -- generate-html docs.json ./docs/ + + - name: Upload documentation artifact + uses: actions/upload-artifact@v2 + with: + name: documentation + path: docs/ + + - name: Deploy documentation + if: github.event_name == 'push' + run: | + # Remove gh-branch if it already exists, check it out + git branch -D gh-pages || true + git checkout --orphan gh-pages + # Remove all staged files - We only need the docs + git rm -rf $(git ls-files) + # We can have some leftover files (e.g. build) + # So add docs (which is only what we need), then `git mv` it. + git add docs/ + git mv -k docs/* ./ + # Configure user (because persist-credentials does not persist everything...) + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + # We're done + git commit -m "Documentation for commit ${{ github.sha }}" + git push -f ${{ github.event.repository.clone_url }} gh-pages:gh-pages diff --git a/src/ext_depends/d2sqlite3/.github/workflows/main.yaml b/src/ext_depends/d2sqlite3/.github/workflows/main.yaml index 103d945..28eaebe 100644 --- a/src/ext_depends/d2sqlite3/.github/workflows/main.yaml +++ b/src/ext_depends/d2sqlite3/.github/workflows/main.yaml @@ -15,8 +15,9 @@ jobs: # TODO: FIXME. Requires fixes to the dub.sdl to work on Windows # os: [ ubuntu-18.04, macOS-10.15, windows-2019 ] os: [ ubuntu-18.04, macOS-10.15 ] - # Oldest supported FE is 2.088.1 because older DMD don't work on macOS-10.15 - dc: [ ldc-master, ldc-latest, ldc-1.21.0, dmd-master, dmd-latest, dmd-2.088.1 ] + # Oldest supported FE is 2.090.1 because we need `GC.inFinalizer` + # https://dlang.org/changelog/2.090.0.html + dc: [ ldc-master, ldc-latest, ldc-1.21.0, dmd-master, dmd-latest, dmd-2.090.1 ] runs-on: ${{ matrix.os }} timeout-minutes: 30 @@ -69,59 +70,3 @@ jobs: run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" dub test -c ci - - # Documentation build: Only runs on Linux - # Still need to install dependencies and the compiler because DDOX - # does a full build - doc: - name: Build and upload documentation - needs: main - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - # Checkout this repository and its submodules - - name: Checkout repository - uses: actions/checkout@v2 - - # Install the D compiler - - name: Prepare compiler - uses: dlang-community/setup-dlang@v1 - with: - compiler: ldc-latest - - - name: 'Install dependencies & setup environment' - run: | - sudo apt-get update - sudo apt-get install libsqlite3-dev - - - name: Build documentation - run: | - dub build -b ddox - # Generate the HTML to docs - dub run ddox -- generate-html docs.json ./docs/ - - - name: Upload documentation artifact - uses: actions/upload-artifact@v2 - with: - name: documentation - path: docs/ - - - name: Deploy documentation - if: github.event_name == 'push' - run: | - # Remove gh-branch if it already exists, check it out - git branch -D gh-pages || true - git checkout --orphan gh-pages - # Remove all staged files - We only need the docs - git rm -rf $(git ls-files) - # We can have some leftover files (e.g. build) - # So add docs (which is only what we need), then `git mv` it. - git add docs/ - git mv -k docs/* ./ - # Configure user (because persist-credentials does not persist everything...) - git config --global user.name "${{ github.actor }}" - git config --global user.email "${{ github.actor }}@users.noreply.github.com" - # We're done - git commit -m "Documentation for commit ${{ github.sha }}" - git push -f ${{ github.event.repository.clone_url }} gh-pages:gh-pages diff --git a/src/ext_depends/d2sqlite3/source/d2sqlite3/internal/memory.d b/src/ext_depends/d2sqlite3/source/d2sqlite3/internal/memory.d index 664dbdd..afc3a4b 100644 --- a/src/ext_depends/d2sqlite3/source/d2sqlite3/internal/memory.d +++ b/src/ext_depends/d2sqlite3/source/d2sqlite3/internal/memory.d @@ -66,22 +66,17 @@ extern(C) void releaseMem(const void* ptr) // Adapted from https://p0nce.github.io/d-idioms/#GC-proof-resource-class void ensureNotInGC(T)(string info = null) nothrow { - import core.exception : InvalidMemoryOperationError; - try - { - import core.memory : GC; - cast(void) GC.malloc(1); + import core.memory : GC; + import core.stdc.stdio : fprintf, stderr; + import core.stdc.stdlib : exit; + + if (!GC.inFinalizer) return; - } - catch(InvalidMemoryOperationError e) - { - import core.stdc.stdio : fprintf, stderr; - import core.stdc.stdlib : exit; - fprintf(stderr, - "Error: clean-up of %s incorrectly depends on destructors called by the GC.\n", - T.stringof.ptr); - if (info) - fprintf(stderr, "Info: %s\n", info.ptr); - assert(false); - } + + fprintf(stderr, + "Error: clean-up of %s incorrectly depends on destructors called by the GC.\n", + T.stringof.ptr); + if (info) + fprintf(stderr, "Info: %s\n", info.ptr); + assert(false); } -- cgit v1.2.3