waliwali / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

setup.py relies on non-standard environment variables #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run setup.py

What is the expected output? What do you see instead?

The setup script returns an error unless extra environment variables are 
set. Unfortunately, the error message doesn't explicitly state what 
variables are to be set - it simply refers the user to the README file. In 
the case of an egg installation (which appears to be the recommended 
method), many users won't know how to extract the README from the egg. 
Assuming they do, the README also has a minor issue: "path_to_sqllib" does 
not clearly describe (in the case of Linux/UNIX) whether the path to the 
installation, or the instance is required.

Overall, it would simply be better if the script relied solely on the 
"standard" environment, as set by the db2profile script on Linux/UNIX, or 
the db2cmd process on Windows. 

What version of the product are you using? On what operating system?

0.2.9 and 0.3.0 on Linux

Please provide any additional information below.

The attached patch uses the DB2INSTANCE environment variable (as set by 
db2profile) on Linux/UNIX, and a simple PATH search for the CLP on 
Windows, to set up the build environment. The messages used in the case of 
errors or warnings are concise, but reasonably clear. If a DB2 
installation is located and the build can proceed, the script outputs all 
the paths it will be using (include, library, etc). The script includes a 
well commented, simple means for advanced users to override the paths used 
(set the PATH variables at the top of the script), which could easily be 
extended if an interactive version were required.

Original issue reported on code.google.com by wavefor...@gmail.com on 27 Sep 2008 at 11:41

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by abhigyan...@in.ibm.com on 29 Sep 2008 at 3:58

GoogleCodeExporter commented 9 years ago
I am still to fully go through this one. My concern is that if one is using IBM 
DS 
driver for odbc, cli and .net (or thinCLI), these env variables would not be 
available. 
eggs are recommended way if you are installing this on 32 bit Windows or 32 bit 
Linux machines. (In these cases, no dependencies on these env variables).
Otherwise, building from source will be helpful. I have updated error message 
in 
setup.py.
Your thoughts are welcome.    

Original comment by abhigyan...@in.ibm.com on 8 Oct 2008 at 6:31

GoogleCodeExporter commented 9 years ago
Hmmm... it's a valid point that people using the lightweight client would need 
to 
set some environment variables, one way or another, and in fact my patch above 
won't 
be sufficient for such people (at least on Windows the PATH search for db2.exe 
will 
fail).

However, I don't see the point of inventing new environment variables that 
no-one's 
familiar with. If the setup.py script sticks with the environment set up by the 
"full" client (however weird and non-cross-platform it may be :-) we get the 
best 
scenario all round:

* People using the full client wouldn't need to do anything beyond run setup.py 
as 
they would any other Python package.

* People using the lightweight client would need to set up some environment 
variables, but they'd be familiar changes to those experienced in using the 
full 
client, and for those not experienced, the changes would be of the same order 
of 
complexity as the current instructions.

Anyway, as mentioned above the current patch isn't sufficient because it'll 
fail at 
least one of the scenarios. I'll try and have a look at the lightweight client 
later 
this week and see if I can figure out some sort of automated search if possible 
or 
failing that a set of instructions on the necessary environment changes, then 
tweak 
the patch accordingly.

Original comment by wavefor...@gmail.com on 14 Oct 2008 at 3:16

GoogleCodeExporter commented 9 years ago
Thanks Dave.

Original comment by abhigyan...@in.ibm.com on 14 Oct 2008 at 5:56

GoogleCodeExporter commented 9 years ago

Original comment by abhigyan...@in.ibm.com on 2 Mar 2009 at 9:56