-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Precompiled node-oracle #18
Comments
+1 |
that would be inconsistent with any other node module i saw which has c code in it. agree its a pain to set everything up in windows, but its a one time thing and you have all tools provided by Microsoft free. The only issue is the 64bit support, meaning, to 64 bit compiler from microsoft is not free so you will have to use 32bit node.js exe to run those modules, otherwise you won't be able to load those 32bit compiled libs. |
Hi @sagiegurari, That's true, when you talk about node module - but I have seen some modules which use phanton in the test cases and when it fails to compile, it downloads the precompiled But here we are talking about an Oracle Client. All oracle clients provided by oracle are distributed compiled. And this one is a wrapper to a compiled one (OCI). So, I cannot see a point in providing one client half compiled and half to be compiled. It would be better if Oracle could compile it and distribute it together with the instant client itself or in a separated |
@sagiegurari regarding 64 bit, is this usable?: http://www.visualstudio.com/products/visual-studio-community-vs (Can you tell I rarely use Windows?) |
After doing some research, there appears to be a lot of node community support for pre-compiled modules: see npm/npm#1891 and nodejs/node-v0.x-archive#4398 Based on what I'm reading, it seems there are at least two possible solutions:
@cjbj What do you think? Can we implement any one of these two options? node-pre-gyp appears to be the easiest to implement. What are your thoughts? |
Great to see the enthusiasm. Keep the ideas and references coming. To be realistic, we have a lot of base things to do first, before branching out to building binaries. |
Hi @cjbj as for the community edition, I see no where any statement on what is actually supports and I have never tried it. |
Module foundry looks good. |
@cjbj any update on this getting done before node-oracle is out of beta? |
Not even on the radar, sorry. Priorities change dynamically, so once we have LOBs etc we will revisit it. |
@bchr02 on a related topic, do you have any fresh comments for the Windows installation section of INSTALL.md https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instwin |
@cjbj Sorry for taking so long to respond. I have been busy. Overall the updated Windows installation section is excellent. It has a lot of helpful information and, for the most part, contains all the information one would need for a successful installation. I think you have done a good job. I do have a few comments though: Under section 6.1 you write:
It would be helpful to the reader if they knew that, at least with Visual Studios 2013, and I believe with older versions as well, that the Visual C++ Redistributable is automatically installed with it. However this is probably a moot point though because I realized that you could safely uninstall Visual C++ Redistributable, reboot your system to make sure it's fully uninstalled and you could still compile and use the oracedb module. Perhaps we should eliminate the comment of needing the redistributable altogether. I have tested and verified this to be true with a test system running Windows 7 x64 and Visual Studio 2013. Under section 6.3 where you write:
I like this naming convention but why not be consistent with the directories under section 6.4 where you write:
I would rename these to:
Under section 6.4The first paragraph discusses the need to use a Visual Studio command prompt or running certain batch files. I never had to do either of those things. Maybe it would be good to add a comment as to when this would be needed. I have installed oracledb on many different type of windows systems with various versions of Visual Studios and have never needed to do this. So if I were seeing this trying to do an install for the first time, it would slow me down. When I install the oracledb, I have had success by either opening a regular command prompt via Start, Run, cmd or by opening the node.js command prompt via Start, All Programs, Node.js, Node.js command prompt. |
@cjbj By the way, I noticed that there have been some requests for a video demonstrating the installation of oracledb on Windows, so I created one. Please check it out and let me know what you think: Video - install of oracledb on Windows 7 x64 |
@bchr02 great job on the video, which I'm watching at the moment. I'll address your earlier comments too in a while. The install guide has already greatly improved with your input and this should make it better. (In the video at about the 4 minute mark you mentioned the OCCI interface. node-oracledb uses OCI not OCCI). |
One good reason to distribute binaries of some form is gyp's dependency on Python 2.7, which will become more and more a liability in future as platforms start to ship Python 3 by default. Reference: nodejs/node-gyp#193 |
Oops, good catch! I will splice the video to fix this. :-) No worries. Let me know if there is anything else you find. |
@cjbj If the community were to create a pull request that utilized node-pre-gyp to conditionally use pre-built binaries based on processor architecture and platform (and would fall back on compiling), would you accept it? |
@cjbj Okay, in that case we will start working on something. @Bigous how to you want to proceed? I know from your pull requests that you have more experience than me with node-gyp. Therefore, do you prefer to take the lead on this and we can use your own fork? If not, for whatever reason, maybe you have a busy schedule, I could take the lead and we could use my fork here: bchr02/node-oracledb. I do not have a lot of experience with node-gyp let alone node-pre-gyp, so I may not be the best person to take the lead. Nevertheless, I don't think I would have a problem figuring things out. Lastly, if there is anyone else in the community who has experience with node-pre-gyp and is interested to help, please let us know. Thanks. |
I think this is the best way, It will be my first time doing this too. I think you could lead us on that Bill. I started reading about node-pre-gyp and it requires (obviously) a host to store the tar with the binary distributions. It recommends S3 from Amazon. I need a little bit more research to understand it correctly, but It can be an start. |
@cjbj please don't forget to let me know your thoughts on #18 (comment) Thanks. |
@bchr02 thanks for the URL. I was looking for your comments yesterday but my search foo & time available time let me down. |
It's been a while, but along with the technical improvements to building brought by using ODPI-C in node-oracledb 2, there has been some progress on 'official' binaries. My current thoughts are:
Oracle client libraries would still need to be installed separately, since that needs a click through. Unlike the node-gyp solution @bchr02 has been using in oracledb-pb the proposed idea does not fallback to compile from source when no binary is found. This make the installer & install footprint much smaller, faster, less error prone, and not rely on a bunch of 3rd party libraries. We may/should be able to build binaries for some Node.js versions on Linux OL6, Windows and probably macOS. This would cater for most users, so not many people would have to install from GitHub. Comments welcome. I had a working installer script, that was waiting some time from @dmcghan et al to review. However in discussions with the powers-that-be, we need to change it a bit. If anyone has a simple pure-JS unzip implementation (with no 3rd party licenses) they want to contribute under the OCA ... send it through. We need to bundle the LICENSE with the oracledb.node binary. At the simplest we could not use ZIP format, but could concatenate the LICENSE and binary into one single file (for each architecture), and upload that to GitHub. Our install script would request the concatenated file and split it back into LICENSE and binary. However we need to make sure that GitHub would serve it with the correct MIME type. Using a ZIP would be cleaner than this simple solution. |
@cjbj I'm glad progress is being made with this. I think your approach makes sense. Hopefully the last bits of this could get sorted out so you could go live with it. Please keep the momentum going! |
@bchr02 thank you - and thanks for all the work and ideas that have got us this far with node-oracledb. |
Pre-built node-oracledb binaries are getting closer. I just pushed v2.0.14-dev with the proposed binary install scripts. Please code review and hammer on them to report issues and create pull requests. Before releasing any actual binaries we need to complete the formalization of infrastructure & release processes, plus triple check the corporate gatekeepers don't have any last minute concerns, and do some testing - of course. The package/README.md shows how you can create and host your own binaries if you want. You just create a generic install package, a binary package (one for each platform/Node version), and a SHA file. My thoughts are to release binaries for macOS, Windows and Linux, for Node 4,6,8 & maybe 9. Comments are welcome. |
I assume Linux binaries will work on RHEL. Will they work on Ubuntu, CentOS or a micro Linux like Alpine which I think is CentOS derived. |
@lakamsani I'm expecting they'll work on anything with the right glibc, which means not on Alpine Linux and not on RHEL5 or OL5 or things of that era. We're not planning on testing non Oracle Linux at the moment. Building from source will still work where it currently does. |
Check out the pre-built binaries.
This is a development release. See #716 for known issues and more information. Yes, you still need Oracle client libraries installed separately. |
It's probably better to keep pre-built binaries discussion here instead of #716 (which is locked!), so here it is:
Node-oracledb v2 user documentation is still on the dev-2.0 branch If binaries are not available for your platform, the INSTALL doc shows the syntax to compile from source code: Warning: there will be further changes to node-oracledb before a production 2.0 release is made, see #716. |
I've made the 2.0.14 dev package installable via npm. Install with:
|
@bchr02 is it working for you? Is the new approach to not fallback to compilation looking OK? |
@cjbj Yes, it's looking great. I just tested it on Windows 10 Pro x64 and it worked flawlessly! I still needed to Are you planning on building this in? |
@bchr02 excellent. I wasn't thinking of auto detecting an instant client on Windows. But suggestions and MRs are welcome. |
I've started the process of releasing node-oracledb 2.0.15. Binaries are on GitHub now. Please test as below, so I know the version is OK to publish to npm. I plan to publish it tomorrow. To try the 'binary installer':
These two commands will download and compile source code:
|
Node-oracledb v2 is out on npm: https://blogs.oracle.com/opal/node-oracledb-20-with-pre-built-binaries-is-on-npm I'll close this issue out. Thanks @bchr02 ! |
If you are having issues installing node-oracledb or if you don't have a build environment and are looking to install a pre-compiled version of node-oracledb then check out my new npm module oracledb-pb, which can be installed like so:
npm install oracledb-pb
Then, within your app, instead of:
var oracledb = require('oracledb');
use:
var oracledb = require('oracledb-pb');
oracledb-pb is an unofficial oracledb module which I have published to npm for the benefit of allowing the community to get up and running with oracledb quickly. It's only dependency is the Microsoft Visual C++ Runtime. The module even downloads and installs the necessary Oracle Instant Client Packages for you and adds the folder to your PATH environment variable.
oracledb-pb is based on the work outlined below and you could optionally follow the below instructions instead which outlines how to install oracledb directly from my fork instead. For small projects I recommend oracledb-pb but for anything large scale or something that you will be publishing to npm I don't recommend it. The main reason is because it is not officially supported by Oracle and another reason is because I can't make any guarantees as to how frequently or how long term I can maintain it.
Fork with a working setup here.
Install instructions:
The following instructions allows one to install oracledb (from my fork) without needing a build environment.
Requirements: One must have an environment for which a binary has been built for. The table below under the section "List of available binaries" contains the binaries that I have compiled thus far. The list is limited because an automated build system is not yet utilized and I am manually needing to create these for each environment.
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
--toolset
option, change the oci version and msvs version so they match your environment. For example,--toolset=oci12.1-msvs2015
means you have the 12.1 version of the Oracle Client library and 2015 version of Visual Studio's C++ Redistributable. UPDATE: actually I made a mistake. With OCI 12.1 it's the 2010 Redistribuatable that is needed not the 2015. I will be correcting this but in the meantime you will need to use ...msvs2015 option when installing while making sure you have the 2010 Redistributable installed. Sorry for the confusion.PATH
. The version must match a version listed in the above table. Currently only 12.1 have prebuilts***List of available binaries as of Jan 9th 2017
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2015
npm install https://github.com/bchr02/node-oracledb#prebuild_support --toolset=oci12.1-msvs2012
Instructions to build and package can be found here: #392
The text was updated successfully, but these errors were encountered: