Fix Nim v1.0.x compilation problems (#47)
* Fix #46. * Bump version to 0.5.4. * Disable Travis cache. * Fix travis cache problems.
This commit is contained in:
parent
78b53fa70d
commit
a065c17418
54
.travis.yml
54
.travis.yml
|
@ -1,20 +1,44 @@
|
||||||
sudo: false
|
|
||||||
language: c
|
language: c
|
||||||
os:
|
cache:
|
||||||
- linux
|
ccache: true
|
||||||
- osx
|
directories:
|
||||||
dist: xenial
|
- NimV1
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- os: linux
|
||||||
|
arch: amd64
|
||||||
|
env:
|
||||||
|
- NPROC=2
|
||||||
|
- NIM_DIR=NimDev
|
||||||
|
- NIM_BRANCH=devel
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
arch: amd64
|
||||||
|
env:
|
||||||
|
- NPROC=2
|
||||||
|
- NIM_DIR=NimV1
|
||||||
|
- NIM_BRANCH=v1.0.8
|
||||||
|
dist: xenial
|
||||||
|
- os: osx
|
||||||
|
env:
|
||||||
|
- NPROC=2
|
||||||
|
- NIM_DIR=NimDev
|
||||||
|
- NIM_BRANCH=devel
|
||||||
|
before_install:
|
||||||
|
- HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install ccache
|
||||||
|
- os: osx
|
||||||
|
env:
|
||||||
|
- NPROC=2
|
||||||
|
- NIM_DIR=NimV1
|
||||||
|
- NIM_BRANCH=v1.0.8
|
||||||
|
before_install:
|
||||||
|
- HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install ccache
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- git clone https://github.com/nim-lang/Nim.git
|
- ./tests/bootstrap.sh
|
||||||
- cd Nim
|
- export PATH="$(pwd)/$NIM_DIR/bin:$PATH"
|
||||||
- git clone --depth 1 https://github.com/nim-lang/csources
|
|
||||||
- cd csources && sh build.sh
|
|
||||||
- cd ..
|
|
||||||
- bin/nim c koch
|
|
||||||
- ./koch boot -d:release
|
|
||||||
- ./koch nimble
|
|
||||||
- export PATH=$(pwd)/bin:$PATH
|
|
||||||
- cd ..
|
|
||||||
script:
|
script:
|
||||||
|
- echo $PATH
|
||||||
|
- nim --version
|
||||||
- nimble install -y --verbose
|
- nimble install -y --verbose
|
||||||
- nimble test
|
- nimble test
|
||||||
|
|
46
appveyor.yml
46
appveyor.yml
|
@ -3,8 +3,8 @@ version: '{build}'
|
||||||
cache:
|
cache:
|
||||||
- x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z
|
- x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z
|
||||||
- i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z
|
- i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z
|
||||||
- sqlite-dll-win64-x64-3310100.zip
|
- NimV1x64
|
||||||
- sqlite-dll-win32-x86-3290000.zip
|
- NimV1x32
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
|
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
|
||||||
|
@ -14,35 +14,39 @@ environment:
|
||||||
- MINGW_DIR: mingw64
|
- MINGW_DIR: mingw64
|
||||||
MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/seh/x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z/download
|
MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/seh/x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z/download
|
||||||
MINGW_ARCHIVE: x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z
|
MINGW_ARCHIVE: x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z
|
||||||
SQLITE_URL: https://www.sqlite.org/2020/sqlite-dll-win64-x64-3310100.zip
|
|
||||||
SQLITE_ARCHIVE: sqlite-dll-win64-x64-3310100.zip
|
|
||||||
SQLITE_NAME: sqlite3_64.dll
|
|
||||||
platform: x64
|
platform: x64
|
||||||
|
NIM_DIR: NimDev
|
||||||
|
NIM_BRANCH: devel
|
||||||
|
|
||||||
|
- MINGW_DIR: mingw64
|
||||||
|
MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/seh/x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z/download
|
||||||
|
MINGW_ARCHIVE: x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z
|
||||||
|
platform: x64
|
||||||
|
NIM_DIR: NimV1x64
|
||||||
|
NIM_BRANCH: v1.0.8
|
||||||
|
|
||||||
- MINGW_DIR: mingw32
|
- MINGW_DIR: mingw32
|
||||||
MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-win32/dwarf/i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z/download
|
MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-win32/dwarf/i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z/download
|
||||||
MINGW_ARCHIVE: i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z
|
MINGW_ARCHIVE: i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z
|
||||||
SQLITE_URL: https://www.sqlite.org/2020/sqlite-dll-win32-x86-3310100.zip
|
|
||||||
SQLITE_ARCHIVE: sqlite-dll-win32-x86-3310100.zip
|
|
||||||
SQLITE_NAME: sqlite3_32.dll
|
|
||||||
platform: x86
|
platform: x86
|
||||||
|
NIM_DIR: NimDev
|
||||||
|
NIM_BRANCH: devel
|
||||||
|
|
||||||
|
- MINGW_DIR: mingw32
|
||||||
|
MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-win32/dwarf/i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z/download
|
||||||
|
MINGW_ARCHIVE: i686-8.1.0-release-win32-dwarf-rt_v6-rev0.7z
|
||||||
|
platform: x86
|
||||||
|
NIM_DIR: NimV1x32
|
||||||
|
NIM_BRANCH: v1.0.8
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- IF not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%"
|
- IF not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%"
|
||||||
- IF not exist "%SQLITE_ARCHIVE%" appveyor DownloadFile "%SQLITE_URL%" -FileName "%SQLITE_ARCHIVE%"
|
|
||||||
- 7z x -y "%MINGW_ARCHIVE%" > nul
|
- 7z x -y "%MINGW_ARCHIVE%" > nul
|
||||||
- SET PATH=%CD%\%MINGW_DIR%\bin;%CD%\Nim\bin;%PATH%
|
- SET PATH=%CD%\%MINGW_DIR%\bin;%CD%\%NIM_DIR%\bin;%PATH%
|
||||||
- git clone https://github.com/nim-lang/Nim.git %CD%\Nim
|
- tests/bootstrap.bat
|
||||||
- 7z x -y "%SQLITE_ARCHIVE%" -o"%CD%\Nim\bin" > nul
|
|
||||||
- RENAME "%CD%\Nim\bin\sqlite3.dll" "%SQLITE_NAME%"
|
|
||||||
- cd %CD%\Nim
|
|
||||||
- git clone --depth 1 https://github.com/nim-lang/csources
|
|
||||||
- cd csources
|
|
||||||
- IF "%PLATFORM%" == "x64" ( build64.bat ) else ( build.bat )
|
|
||||||
- cd ..
|
|
||||||
- bin\nim c koch
|
|
||||||
- koch boot -d:release
|
|
||||||
- koch nimble
|
|
||||||
build_script:
|
build_script:
|
||||||
|
- echo %PATH%
|
||||||
|
- nim --version
|
||||||
- cd C:\projects\nimcrypto
|
- cd C:\projects\nimcrypto
|
||||||
- nimble install -y --verbose
|
- nimble install -y --verbose
|
||||||
test_script:
|
test_script:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
author = "Eugene Kabanov"
|
author = "Eugene Kabanov"
|
||||||
description = "Nim cryptographic library"
|
description = "Nim cryptographic library"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -188,7 +188,7 @@ func validateParam(N, r, p: int): bool =
|
||||||
maxIntd256 = maxInt div 256
|
maxIntd256 = maxInt div 256
|
||||||
|
|
||||||
let
|
let
|
||||||
badParam1 = uint64(r)*uint64(p) >= 1 shl 30
|
badParam1 = (uint64(r) * uint64(p)) >= uint64(1 shl 30)
|
||||||
badParam2 = r > maxIntd128 div p
|
badParam2 = r > maxIntd128 div p
|
||||||
badParam3 = r > maxIntd256
|
badParam3 = r > maxIntd256
|
||||||
badParam4 = N > maxIntd128 div r
|
badParam4 = N > maxIntd128 div r
|
||||||
|
|
|
@ -87,7 +87,7 @@ proc bytesToHex*(src: openarray[byte], dst: var openarray[char],
|
||||||
dst[k + 0] = hexDigit(x shr 4, lowercase)
|
dst[k + 0] = hexDigit(x shr 4, lowercase)
|
||||||
inc(k)
|
inc(k)
|
||||||
|
|
||||||
return k
|
k
|
||||||
|
|
||||||
proc hexToBytes*(src: openarray[char], dst: var openarray[byte],
|
proc hexToBytes*(src: openarray[char], dst: var openarray[byte],
|
||||||
flags: set[HexFlags]): int =
|
flags: set[HexFlags]): int =
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
@echo off
|
||||||
|
IF NOT EXIST "%CD%\%NIM_DIR%\bin\nim.exe" (
|
||||||
|
echo Building Nim [%NIM_BRANCH%] in %NIM_DIR%
|
||||||
|
git clone https://github.com/nim-lang/Nim.git "%CD%\%NIM_DIR%"
|
||||||
|
cd "%CD%\%NIM_DIR%"
|
||||||
|
IF NOT "%NIM_BRANCH%" == "devel" (
|
||||||
|
git checkout "tags/%NIM_BRANCH%" -b "%NIM_BRANCH%"
|
||||||
|
) ELSE (
|
||||||
|
git checkout devel
|
||||||
|
)
|
||||||
|
git clone --depth 1 https://github.com/nim-lang/csources
|
||||||
|
cd csources
|
||||||
|
IF "%PLATFORM%" == "x64" ( build64.bat ) else ( build.bat )
|
||||||
|
cd ..
|
||||||
|
bin\nim c -d:release koch
|
||||||
|
koch boot -d:release
|
||||||
|
koch nimble
|
||||||
|
cd ..
|
||||||
|
) ELSE (
|
||||||
|
cd "%CD%\%NIM_DIR%"
|
||||||
|
set GITBRANCH=
|
||||||
|
for /f %%I in ('git.exe rev-parse --abbrev-ref HEAD 2^> NUL') do set GITBRANCH=%%I
|
||||||
|
echo Using Nim [%GITBRANCH%] in %NIM_DIR%
|
||||||
|
cd ..
|
||||||
|
)
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ ! -e "$NIM_DIR/bin/nim" ]; then
|
||||||
|
echo "Building Nim [$NIM_BRANCH] in $NIM_DIR"
|
||||||
|
git clone https://github.com/nim-lang/Nim.git "$NIM_DIR"
|
||||||
|
cd "$NIM_DIR"
|
||||||
|
if [ "$NIM_BRANCH" = "devel" ]; then
|
||||||
|
git checkout devel
|
||||||
|
else
|
||||||
|
git checkout "tags/$NIM_BRANCH" -b "$NIM_BRANCH"
|
||||||
|
fi
|
||||||
|
git clone --depth 1 https://github.com/nim-lang/csources
|
||||||
|
cd csources && sh build.sh
|
||||||
|
cd ..
|
||||||
|
bin/nim c -d:release koch
|
||||||
|
./koch boot -d:release
|
||||||
|
./koch nimble -d:release
|
||||||
|
cd ..
|
||||||
|
else
|
||||||
|
GITBRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
|
||||||
|
echo "Using Nim [$GITBRANCH] in $NIM_DIR"
|
||||||
|
fi
|
Loading…
Reference in New Issue