Unverified Commit 1e273583 by Kewde

Merge remote-tracking branch 'refs/remotes/mapbox/master'

Conflicts:
	.travis.yml
	appveyor.yml
parents 5a79cad5 e06c977b
......@@ -20,3 +20,8 @@ test/tmp
test/nw/app.nw
.DS_Store
.idea
.dtps
local.env
.mason
.eslintrc.js
setup.sh
\ No newline at end of file
......@@ -10,3 +10,8 @@ Makefile
scripts
.travis.yml
examples
.dtps
local.env
.mason
.eslintrc.js
setup.sh
......@@ -2,6 +2,8 @@ sudo: false
language: generic
dist: precise
git:
depth: 10
......@@ -13,53 +15,47 @@ addons:
packages:
- clang-3.5
# don't re-build for tags so that [publish binary] is not re-run
# https://github.com/travis-ci/travis-ci/issues/1532
branches:
except:
- /^v[0-9]/
matrix:
include:
# Linux
- os: linux
compiler: clang
env: NODE_VERSION="7"
env: NODE_VERSION="9"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="6"
env: NODE_VERSION="8"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="5"
env: NODE_VERSION="7"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="4"
env: NODE_VERSION="6"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="0.12"
env: NODE_VERSION="5"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
packages: [ 'clang-3.5']
- os: linux
compiler: clang
env: NODE_VERSION="0.10"
env: NODE_VERSION="4"
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
......@@ -67,7 +63,7 @@ matrix:
# test building against external sqlite
- os: linux
compiler: clang
env: NODE_VERSION="0.10" EXTERNAL_SQLITE=true PUBLISHABLE=false
env: NODE_VERSION="8" EXTERNAL_SQLITE=true PUBLISHABLE=false
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]
......@@ -78,22 +74,22 @@ matrix:
env: NODE_VERSION="5" COVERAGE=true PUBLISHABLE=false # node abi 47
- os: osx
compiler: clang
env: NODE_VERSION="7" # node abi 51
env: NODE_VERSION="9" # node abi 58
- os: osx
compiler: clang
env: NODE_VERSION="6" # node abi 48
env: NODE_VERSION="8" # node abi 57
- os: osx
compiler: clang
env: NODE_VERSION="5" # node abi 47
env: NODE_VERSION="7" # node abi 51
- os: osx
compiler: clang
env: NODE_VERSION="4" # node abi 46
env: NODE_VERSION="6" # node abi 48
- os: osx
compiler: clang
env: NODE_VERSION="0.12" # node abi 14
env: NODE_VERSION="5" # node abi 47
- os: osx
compiler: clang
env: NODE_VERSION="0.10" # node abi 11
env: NODE_VERSION="4" # node abi 46
# electron Linux
- os: linux
compiler: clang
......
# Changelog
## 4.0.0
- Drop support for Node v0.10 and v.12
- Upgrade to node-pre-gyp@0.9.0
- Upgrade to nan@2.9.2
## 3.1.13
- Attempt to fix regression of #866
## 3.1.12
- Fixed to ensure the binaries do not rely on `GLIBC_2.14` and only `GLIBC_2.2.5`. This regressed in v3.1.11.
## 3.1.11
- Fixed building from source on alpine linux
## 3.1.10
- Removed `npm ls` from `prepublish` hook per mapbox/node-pre-gyp#291
- Upgraded node-pre-gyp to v0.6.37
- Removed accidentally committed large file
## 3.1.9
- Added support for node v8 and upgraded `nan`, `node-pre-gyp` deps.
## 3.1.8
- Added support for node v7 (pre-compiled binaries available)
......
......@@ -51,7 +51,7 @@ Note: NEVER republish binaries for an existing released version.
An official release requires:
- Updating the CHANGELOG.md
- Create and push github tag like `git tag v3.1.1` -m "v3.1.1" && git push --tags`
- Create and push github tag like `git tag v3.1.1 -m "v3.1.1" && git push --tags`
- Ensure you have a clean checkout (no extra files in your check that are not known by git). You need to be careful, for instance, to avoid a large accidental file being packaged by npm. You can get a view of what npm will publish by running `make testpack`
- Fully rebuild and ensure install from binary works: `make clean && npm install --fallback-to-build=false`
- Then publish the module to npm repositories by running `npm publish`
......@@ -33,13 +33,8 @@ rebuild:
@make clean
@make
ifndef only
test:
@PATH="./node_modules/mocha/bin:${PATH}" && NODE_PATH="./lib:$(NODE_PATH)" mocha -R spec
else
test:
@PATH="./node_modules/mocha/bin:${PATH}" && NODE_PATH="./lib:$(NODE_PATH)" mocha -R spec test/${only}.test.js
endif
npm test
check: test
......
......@@ -9,7 +9,7 @@ Asynchronous, non-blocking [SQLite3](http://sqlite.org/) bindings for [Node.js](
## Supported platforms
The `sqlite3` module works with Node.js v0.10.x, v0.12.x, v4.x, v5.x, v6.x and v7.x.
The `sqlite3` module works with Node.js v4.x, v5.x, v6.x and v7.x.
Binaries for most Node versions and platforms are provided by default via [node-pre-gyp](https://github.com/mapbox/node-pre-gyp).
......@@ -156,6 +156,16 @@ Set the location where `make` installed it:
node -e 'require("sqlite3")'
### Custom builds and Electron
Running sqlite3 through [electron-rebuild](https://github.com/electron/electron-rebuild) does not preserve the sqlcipher extension, so some additional flags are needed to make this build Electron compatible. Your `npm install sqlite3 --build-from-source` command needs these additional flags (be sure to replace the target version with the current Electron version you are working with):
--runtime=electron --target=1.7.6 --dist-url=https://atom.io/download/electron
In the case of MacOS with Homebrew, the command should look like the following:
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=1.7.6 --dist-url=https://atom.io/download/electron
# Testing
[mocha](https://github.com/visionmedia/mocha) is required to run unit tests.
......
......@@ -4,59 +4,30 @@ environment:
node_pre_gyp_secretAccessKey:
secure: 1amwJJw9fu0j6dXnc5KsAQbSYf7Cjw/dapT6OZWABa6nc52grkKeLQ+DGaOfQz8i
matrix:
- nodejs_version: 0.10
platform: x86
msvs_toolset: 12
- nodejs_version: 0.10
platform: x64
msvs_toolset: 12
- nodejs_version: 0.12
platform: x86
msvs_toolset: 12
- nodejs_version: 0.12
platform: x64
msvs_toolset: 12
- nodejs_version: 4
platform: x64
msvs_toolset: 12
- nodejs_version: 4
platform: x86
msvs_toolset: 12
- nodejs_version: 5
platform: x64
msvs_toolset: 12
- nodejs_version: 5
platform: x86
msvs_toolset: 12
- nodejs_version: 6
platform: x64
msvs_toolset: 12
- nodejs_version: 6
platform: x86
msvs_toolset: 12
- nodejs_version: 7
platform: x64
msvs_toolset: 12
- nodejs_version: 7
platform: x86
msvs_toolset: 12
# custom visual studio 2015 builds
- nodejs_version: 0.10.40
platform: x86
msvs_toolset: 14
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- nodejs_version: 0.10.40
- nodejs_version: 8
platform: x64
msvs_toolset: 14
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- nodejs_version: 0.12.7
- nodejs_version: 8
platform: x86
msvs_toolset: 14
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- nodejs_version: 0.12.7
- nodejs_version: 9
platform: x64
msvs_toolset: 14
TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140
- nodejs_version: 9
platform: x86
# electron
- nodejs_version: 6
platform: x64
......
......@@ -31,7 +31,6 @@
}
]
],
"cflags": [ "-include ../src/gcc-preinclude.h" ],
"sources": [
"src/database.cc",
"src/node_sqlite3.cc",
......
......@@ -71,7 +71,6 @@
'dependencies': [
'action_before_build'
],
'cflags': [ '-include ../src/gcc-preinclude.h' ],
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
],
......@@ -87,8 +86,7 @@
],
},
'cflags_cc': [
'-Wno-unused-value',
'-include ../src/gcc-preinclude.h'
'-Wno-unused-value'
],
'defines': [
'_REENTRANT=1',
......
{
"name": "sqlite3",
"description": "Asynchronous, non-blocking SQLite3 bindings",
"version": "3.1.8",
"version": "4.0.0",
"homepage": "http://github.com/mapbox/node-sqlite3",
"author": {
"name": "MapBox",
......@@ -37,8 +37,8 @@
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"nan": "~2.4.0",
"node-pre-gyp": "~0.6.32"
"nan": "~2.9.2",
"node-pre-gyp": "~0.9.0"
},
"bundledDependencies": [
"node-pre-gyp"
......@@ -49,7 +49,7 @@
"mocha": "3.x"
},
"scripts": {
"prepublish": "npm ls",
"prepublishOnly": "npm ls",
"install": "node-pre-gyp install --fallback-to-build",
"pretest": "node test/support/createdb.js",
"test": "mocha -R spec --timeout 480000"
......
......@@ -4,12 +4,17 @@ SET EL=0
ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF /I "%msvs_toolset%"=="" ECHO msvs_toolset unset, defaulting to 12 && SET msvs_toolset=12
SET NODE_MAJOR=%nodejs_version:~0,1%
IF %NODE_MAJOR% GTR 4 ECHO detected node v5, forcing msvs_toolset 14 && SET msvs_toolset=14
SET PATH=%CD%;%PATH%
SET msvs_version=2013
IF "%msvs_toolset%"=="14" SET msvs_version=2015
IF NOT "%NODE_RUNTIME%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --runtime=%NODE_RUNTIME%"
IF NOT "%NODE_RUNTIME_VERSION%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --target=%NODE_RUNTIME_VERSION%"
ECHO APPVEYOR^: %APPVEYOR%
ECHO nodejs_version^: %nodejs_version%
ECHO platform^: %platform%
......@@ -44,22 +49,15 @@ IF /I "%platform%"=="x64" powershell Install-Product node $env:nodejs_version x6
IF /I "%platform%"=="x86" powershell Install-Product node $env:nodejs_version x86
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
SET NODE_MAJOR=%nodejs_version:~0,1%
ECHO node major version^: %NODE_MAJOR%
IF %NODE_MAJOR% GTR 0 ECHO node version greater than zero, not updating npm && GOTO SKIP_APPVEYOR_INSTALL
powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL npm install --global --production npm-windows-upgrade
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
REM https://ci.appveyor.com/project/Mapbox/node-sqlite3/build/1.0.500/job/n2y9fo4eg316db56#L289
REM error C2373: '__pfnDliNotifyHook2': redefinition; different type modifiers
REM at least 2.15.9 is needed: https://github.com/nodejs/node-gyp/issues/972#issuecomment-231055109
CALL npm-windows-upgrade --npm-version 2.15.9 --no-dns-check --no-prompt
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
:SKIP_APPVEYOR_INSTALL
IF /I "%msvs_toolset%"=="12" GOTO NODE_INSTALLED
IF %NODE_MAJOR% GTR 4 GOTO NODE_INSTALLED
::custom node for VS2015
......@@ -119,8 +117,11 @@ IF /I "%NPM_BIN_DIR%"=="%CD%" ECHO ERROR npm bin -g equals local directory && SE
ECHO ===== where npm puts stuff END ============
ECHO installing node-gyp
CALL npm install -g node-gyp
IF "%nodejs_version:~0,1%"=="0" CALL npm install https://github.com/springmeyer/node-gyp/tarball/v3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF "%nodejs_version:~0,1%"=="4" CALL npm install node-gyp@3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF "%nodejs_version:~0,1%"=="5" CALL npm install node-gyp@3.x
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http
......
......@@ -10,9 +10,9 @@ NPM_BIN_DIR="$(npm bin -g 2>/dev/null)"
function publish() {
if [[ ${PUBLISHABLE:-false} == true ]] && [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then
node-pre-gyp package
node-pre-gyp publish
node-pre-gyp info
node-pre-gyp package $GYP_ARGS
node-pre-gyp publish $GYP_ARGS
node-pre-gyp info $GYP_ARGS
fi
}
......
......@@ -19,7 +19,10 @@ if [[ ${COVERAGE} == true ]]; then
npm test
./py-local/bin/cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude docs --exclude build/Release/obj/gen --exclude deps > /dev/null
else
npm install --build-from-source --clang=1
echo "building binaries for publishing"
CFLAGS="${CFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" CXXFLAGS="${CXXFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" V=1 npm install --build-from-source --clang=1
nm lib/binding/*/node_sqlite3.node | grep "GLIBCXX_" | c++filt || true
nm lib/binding/*/node_sqlite3.node | grep "GLIBC_" | c++filt || true
npm test
fi
......@@ -27,6 +30,7 @@ fi
publish
# now test building against shared sqlite
echo "building from source to test against external libsqlite3"
export NODE_SQLITE3_JSON1=no
if [[ $(uname -s) == 'Darwin' ]]; then
brew install sqlite
......
......@@ -130,8 +130,8 @@ NAN_METHOD(Database::New) {
Database* db = new Database();
db->Wrap(info.This());
info.This()->ForceSet(Nan::New("filename").ToLocalChecked(), info[0].As<String>(), ReadOnly);
info.This()->ForceSet(Nan::New("mode").ToLocalChecked(), Nan::New(mode), ReadOnly);
Nan::ForceSet(info.This(), Nan::New("filename").ToLocalChecked(), info[0].As<String>(), ReadOnly);
Nan::ForceSet(info.This(), Nan::New("mode").ToLocalChecked(), Nan::New(mode), ReadOnly);
// Start opening the database.
OpenBaton* baton = new OpenBaton(db, callback, *filename, mode);
......
// https://rjpower9000.wordpress.com/2012/04/09/fun-with-shared-libraries-version-glibc_2-14-not-found/
// http://web.archive.org/web/20140401031018/http://rjpower9000.wordpress.com:80/2012/04/09/fun-with-shared-libraries-version-glibc_2-14-not-found/
#if defined(__linux__) && defined(__x86_64__)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
......
......@@ -100,7 +100,7 @@ NAN_METHOD(Statement::New) {
Database* db = Nan::ObjectWrap::Unwrap<Database>(info[0].As<Object>());
Local<String> sql = Local<String>::Cast(info[1]);
info.This()->ForceSet(Nan::New("sql").ToLocalChecked(), sql, ReadOnly);
Nan::ForceSet(info.This(),Nan::New("sql").ToLocalChecked(), sql, ReadOnly);
Statement* stmt = new Statement(db);
stmt->Wrap(info.This());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment