Skip to content

Commit

Permalink
Fix broken CI (#35)
Browse files Browse the repository at this point in the history
* Remove appveyor and travis scripts

* Fix broken CI

* Fix set pointer field to nil with typed nil

* Add liblz4 in CI deps of linux i386
  • Loading branch information
jangko authored Feb 13, 2024
1 parent 724b72f commit 5e2b026
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 108 deletions.
50 changes: 0 additions & 50 deletions .appveyor.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
cpu: amd64
#- os: windows
#cpu: i386
branch: [version-1-2, version-1-4, version-1-6, devel]
branch: [version-1-6, version-2-0, devel]
include:
- target:
os: linux
builder: ubuntu-18.04
builder: ubuntu-20.04
shell: bash
- target:
os: macos
builder: macos-10.15
builder: macos-11
shell: bash
- target:
os: windows
Expand All @@ -43,10 +43,10 @@ jobs:

name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})'
runs-on: ${{ matrix.builder }}
continue-on-error: ${{ matrix.branch == 'version-1-6' || matrix.branch == 'devel' }}
#continue-on-error: ${{ matrix.branch == 'version-1-6' || matrix.branch == 'devel' }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -57,7 +57,7 @@ jobs:
sudo apt-fast update -qq
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
--no-install-recommends -yq gcc-multilib g++-multilib \
libz-dev:i386 libbz2-dev:i386 libssl-dev:i386
libz-dev:i386 libbz2-dev:i386 libssl-dev:i386 liblz4-dev:i386
mkdir -p external/bin
cat << EOF > external/bin/gcc
#!/bin/bash
Expand All @@ -73,7 +73,7 @@ jobs:
- name: Restore rocksdb from cache (Linux + macOS)
if: runner.os != 'Windows'
id: rocksdb-cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: rocks-db-cache-${{ matrix.target.cpu }}
key: 'rocksdb-v1-${{ matrix.target.os }}-${{ matrix.target.cpu }}'
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- name: Restore Nim DLLs dependencies (Windows) from cache
if: runner.os == 'Windows'
id: windows-dlls-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: external/dlls-${{ matrix.target.cpu }}
key: 'dlls-${{ matrix.target.cpu }}'
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
nimcache/

# Executables shall be put in an ignored build/ directory
build/
build/

nimble.paths
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# nim-rocksdb
# Copyright (c) 2019-2023 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
# at your option.
# This file may not be copied, modified, or distributed except according to
# those terms.

# begin Nimble config (version 1)
when fileExists("nimble.paths"):
include "nimble.paths"
# end Nimble config
13 changes: 9 additions & 4 deletions rocksdb.nim
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,23 @@ proc backup*(db: RocksDBInstance): RocksDBResult[void] =
# https://github.com/nim-lang/Nim/issues/8112
# proc `=destroy`*(db: var RocksDBInstance) =
proc close*(db: var RocksDBInstance) =
template freeField(name) =
template freeField(name) =
type FieldType = typeof db.`name`
if db.`name`.isNil:
`rocksdb name destroy`(db.`name`)
db.`name` = nil
db.`name` = FieldType(nil)
template setFieldToNil(name) =
type FieldType = typeof db.`name`
db.`name` = FieldType(nil)

freeField(writeOptions)
freeField(readOptions)
freeField(options)

if not db.backupEngine.isNil:
rocksdb_backup_engine_close(db.backupEngine)
db.backupEngine = nil
setFieldToNil(backupEngine)

if not db.db.isNil:
rocksdb_close(db.db)
db.db = nil
setFieldToNil(db)

0 comments on commit 5e2b026

Please sign in to comment.