Skip to content

Commit

Permalink
Fixed GCC preinclude always present in build
Browse files Browse the repository at this point in the history
fixes #1584

- I'd previously added the `gcc-preinclude.h` file into
  `deps/sqlite3.gyp`, which would include it for every build
- this was technically incorrect because we only want to use this in CI
  to build backwards compatible binaries
- I tried this before, but couldn't get the syntax right
- this commit switches to only including the preinclude in CI and
  removes it from every build, so FreeBSD etc can compile as per the
  issue
  • Loading branch information
daniellockyer committed Apr 21, 2022
1 parent a779446 commit 0e23302
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ jobs:
- name: Install dependencies
run: yarn install --ignore-scripts

- name: Add Linux env vars
if: contains(matrix.os, 'ubuntu')
run: |
echo "CFLAGS=${CFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
echo "CXXFLAGS=${CXXFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV
echo "V=1" >> $GITHUB_ENV
- name: Configure build
run: yarn node-pre-gyp configure

Expand Down
4 changes: 0 additions & 4 deletions deps/sqlite3.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@
'SQLITE_ENABLE_MATH_FUNCTIONS'
],
},
'cflags': [
'-include ../src/gcc-preinclude.h'
],
'cflags_cc': [
'-include ../src/gcc-preinclude.h',
'-Wno-unused-value'
],
'defines': [
Expand Down
2 changes: 2 additions & 0 deletions tools/BinaryBuilder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN cd node_modules/\@mapbox/node-pre-gyp \
&& npm install fs-extra@10.0.1 \
&& sed -i -e s/\'fs/\'fs-extra/ -e s/fs\.renameSync/fs.moveSync/ ./lib/util/napi.js

ENV CFLAGS="${CFLAGS:-} -include ../src/gcc-preinclude.h"
ENV CXXFLAGS="${CXXFLAGS:-} -include ../src/gcc-preinclude.h"
RUN npx node-pre-gyp configure
RUN npx node-pre-gyp build

Expand Down

0 comments on commit 0e23302

Please sign in to comment.