update nimble build (#38)

* update nimble build

* remove arc tests

orc is default on devel
This commit is contained in:
Jacek Sieka 2022-11-21 11:07:33 +01:00 committed by GitHub
parent 9ee8b136e3
commit 5159f7e385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 21 deletions

View File

@ -158,4 +158,4 @@ jobs:
nim --version nim --version
nimble --version nimble --version
nimble install -y --depsOnly nimble install -y --depsOnly
env TEST_LANG="c" nimble test env NIMLANG="c" nimble test

4
.gitignore vendored
View File

@ -1,5 +1,7 @@
nimcache/ nimcache/
*.exe *.exe
gen
nimble.develop nimble.develop
nimble.paths nimble.paths
/build/
gen

View File

@ -1,27 +1,41 @@
import os, strutils mode = ScriptMode.Verbose
# Package packageName = "bearssl"
version = "0.1.5" version = "0.1.5"
author = "Status Research & Development GmbH" author = "Status Research & Development GmbH"
description = "BearSSL wrapper" description = "BearSSL wrapper"
license = "MIT or Apache License 2.0" license = "MIT or Apache License 2.0"
mode = ScriptMode.Verbose skipDirs = @["tests"]
# Dependencies
requires "nim >= 1.2.0", requires "nim >= 1.2.0",
"unittest2" "unittest2"
### Helper functions let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
proc test(env, path: string) = let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
# Compilation language is controlled by TEST_LANG let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & env & let verbose = getEnv("V", "") notin ["", "0"]
" -d:bearsslSplitAbi -rf --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error " & path
let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
let cfg =
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
(if verbose: "" else: " --verbosity:0 --hints:off") &
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f"
proc build(args, path: string) =
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
proc run(args, path: string) =
build args & " -r", path
import strutils
task test, "Run tests": task test, "Run tests":
for path in listFiles(thisDir() / "tests"): for path in listFiles("tests"):
if path.split(".")[^1] != "nim": if not path.endsWith ".nim": continue
continue
test "-d:debug", path for args in [
test "-d:release", path "-d:debug",
test "--gc:arc -d:release", path "-d:release",
rmFile(path[0..^5].toExe()) "-d:bearsslSplitAbi -d:debug",
"-d:bearsslSplitAbi -d:release",
]: run args, path

View File

@ -1132,11 +1132,11 @@ type
hashCV_len* {.importc: "hash_CV_len".}: uint hashCV_len* {.importc: "hash_CV_len".}: uint
hashCV_id* {.importc: "hash_CV_id".}: cint hashCV_id* {.importc: "hash_CV_id".}: cint
proc sslSessionCacheLruInit*(cc: var SslSessionCacheLru; store: ptr cuchar; proc sslSessionCacheLruInit*(cc: var SslSessionCacheLru; store: ptr byte;
storeLen: int) {.importcFunc, storeLen: int) {.importcFunc,
importc: "br_ssl_session_cache_lru_init", header: "bearssl_ssl.h".} importc: "br_ssl_session_cache_lru_init", header: "bearssl_ssl.h".}
proc sslSessionCacheLruForget*(cc: var SslSessionCacheLru; id: ptr cuchar) {.importcFunc, proc sslSessionCacheLruForget*(cc: var SslSessionCacheLru; id: ptr byte) {.importcFunc,
importc: "br_ssl_session_cache_lru_forget", header: "bearssl_ssl.h".} importc: "br_ssl_session_cache_lru_forget", header: "bearssl_ssl.h".}

0
regenerate.sh Normal file → Executable file
View File