Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds support for pre-compiled binaries #392

Closed
wants to merge 22 commits into from

Conversation

bchr02
Copy link

@bchr02 bchr02 commented Mar 28, 2016

_sorry had to re-add this pull request to address an issue with my fork which was preventing me from submitting additional pull requests_

Using node-pre-gyp and a new bin folder, this pull request adds:

  1. The ability for node-oracledb developers to package binaries, or automate the process of packaging binaries, by performing (or scripting) the following tasks in the following order.
    1. Install C++ build environment as outlined in INSTALL.md
    2. Install Node.js as outlined in INSTALL.md
    3. Install Python 2.7 as outlined in INSTALL.md
    4. Install the free Oracle Instant Client ZIPs as outlined in INSTALL.md
    5. set ORACLE_HOME=C:\oracle\instantclient for Linux use export instead of set
    6. set PATH=%ORACLE_HOME%;%PATH% for Linux use export instead of set
    7. set OCI_LIB_DIR=%ORACLE_HOME%\sdk\lib\msvc for Linux use export instead of set
    8. set OCI_INC_DIR=%ORACLE_HOME%\sdk\include for Linux use export instead of set
    9. git clone https://github.com/bchr02/node-oracledb then git checkout prebuild_support.git clone https://github.com/oracle/node-oracledb (or while testing with my repo use git clone https://github.com/bchr02/node-oracledb then git checkout prebuild_support.)
    10. cd node-oracledb
    11. npm install nan
    12. npm install node-gyp -g
    13. npm install node-pre-gyp -g
    14. node-pre-gyp clean
    15. node-pre-gyp configure
    16. node-pre-gyp build
    17. node-pre-gyp package --toolset=oci12.1-msvs2015
    18. xcopy build\stage\*.* bin /C /Y or for Linux: cp -f build/stage/* bin
    19. git add -A
    20. git commit
    21. git push -u origin master
  2. The ability for node-oracledb to be installed without the need for a build environment. The following would be a revised list of steps to install node-oracledb once we start including the binaries in the bin folder and a compatible system is used.
    1. Install Node.js as outlined in INSTALL.md
    2. Install the free Oracle Instant Client ZIPs as outlined in INSTALL.md
    3. set ORACLE_HOME=C:\oracle\instantclient for Linux use export instead of set
    4. set PATH=%ORACLE_HOME%;%PATH% for Linux use export instead of set
    5. set OCI_LIB_DIR=%ORACLE_HOME%\sdk\lib\msvc for Linux use export instead of set
    6. set OCI_INC_DIR=%ORACLE_HOME%\sdk\include for Linux use export instead of set
  3. The ability for a node-oracledb install to fall back to building when a binary is not found.
    1. A build environment would be needed otherwise the install would fail.

IMPORTANT TO UNDERSTAND: The bin folder is an online only folder. When npm installing node-oracledb the bin folder will not downloaded. Instead, node-pre-gyp will check the online github folder for a suitable file. _Therefore, while testing and locally compiling be sure to remember this and not try to install from a git cloned copy of node-oracledb that you have compiled for._

By the way, you're going to want to reject any of the files within the bin folder. Also, within package.json change the binary.host path so bchr02 is changed to oracle and prebuild_support is changes to master

cc: #18

Signed-off-by: Bill Christo [email protected]

@bchr02 bchr02 mentioned this pull request Apr 11, 2016
@pvenkatraman
Copy link

I tried on 2 different windows machines with node 4.4.3 & 5.1.0 and in both I get build errors:

gyp info spawn args '-Goutput_dir=.' ]
gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs510\node_modules\npm\node_modules\node-gyp\lib
gure.js:355:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs510\node.exe" "C:\Program Files\nodejs510\node_modules\npm\node_mo
\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! cwd C:\WORK\github\160419\node-oracledb
gyp ERR! node -v v5.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

I tried this on Linux and following the steps able to compile.

Also does node-pre-gyp support node 0.10.x?

@pvenkatraman
Copy link

gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp

This seem to be error.

@bchr02
Copy link
Author

bchr02 commented Apr 19, 2016

Hi @pvenkatraman, Using my ordered list as a guide, do you get this error at item 1 sub section xvi? Also, are you doing a git clone https://github.com/bchr02/node-oracledb and are you following the instructions as outlined?

In regards to, does node-pre-gyp support node 0.10.x? I believe it does, but since I have not tested it and since node-pre-gyp's README is not clear I created an issue to confirm. See mapbox/node-pre-gyp#203

@bchr02
Copy link
Author

bchr02 commented Apr 19, 2016

I just looked at appveyor.yml with node-pre-gyp and I see testing for nodejs_version: 0.10.36, so it looks like node-pre-gyp does in fact support 0.10.x

@bchr02
Copy link
Author

bchr02 commented Apr 20, 2016

@springmeyer just confirmed that node-pre-gyp supports node v0.10.x and greater via mapbox/node-pre-gyp#203 (comment)

@bchr02
Copy link
Author

bchr02 commented Apr 20, 2016

gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp

This seem to be error.

@pvenkatraman I just updated step 1 sub section ix within the instructions so that it is more clear. I crossed out the old wording. I think this is what was causing you the problem. Let me know. Thanks.

@BuBuaBu
Copy link

BuBuaBu commented Jul 31, 2016

Is there any chance to get node-pre-gyp and official pre built binarieis?

@cjbj
Copy link
Member

cjbj commented Nov 21, 2017

For anyone following this PR, we are looking at a lighter weight solution that doesn't have the automatic fallback to compilation if the binary install fails. See #18 (comment) and the dev-2.0 branch package/README.md and the dev-2.0 branch INSTALL.md.

If (as I expect) the light weight solution is practical, I'll close out this PR.

@cjbj
Copy link
Member

cjbj commented Dec 14, 2017

@bchr02 I'll close this now we have the lightweight 2.0 binary installer. Couldn't have done it without you. Many thanks.

@cjbj cjbj closed this Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants