Here's an article, where the author explains his experience with Windows and Linux over the years. It's a bit dated, I gather about 2010'ish. Even though things have improved at MS, I think the underlying theme about the shenanigans with MS still rings true. And yes, it does talk about backwards compatibility and dependencies and all the other topics we have been debating.
And?? We're talking about the system libraries, here. Of course they're reusable, they're the system libraries. Sorry, I don't understand where you're going. Please state your argument explicitly. |
As explained earlier:
TheIdeasMan wrote: |
---|
The RedHat PM appears to give the exact opposite advice: Don't provide 1 pkg for your program, provide pkgs for the reusable components of your program; Don't combine your packages with what others have already packaged; Don't re-package what is already packaged. |
So software pkgs and the library files they install are supposed to be small and highly reusable as well. Rather than bundle library files into a relatively big pkg, have lots of small reusable library files. Over time, this results in less library files being needed. Linux puts these library files in one place so all the software can use them.
Linux doesn't need a complex linking procedure because, except maybe for RH, none of the distributions care at all about backwards compatibility. |
What makes you say this? In my experience, it's been more like they don't
worry about backwards compatibility because they know there will
nearly always be compatibility.
If you're constantly breaking binaries anyway, there's no point in providing a way to ensure that old binaries continue to link dynamically in the future. |
And what do you mean by "breaking binaries" ? Is it that a library dependency is missing? If so, that's not true - as I have said several times, the installation makes sure all the dependencies are there, they don't disappear.
Nice double standard, there. A feature works exactly the same in two systems, but it's a hack in one but not in the other? |
As already explained, Linux doesn't need a huge list in the PATH variable, because all the executables (or links to them) are in one directory. So needing to have lots of things in a PATH variable, in the right order could be construed as being a hack. Well it's certainly a lot more complex anyway. So this goes back to the Windows philosophy again: We will put our software under this folder, and add another entry into the PATH. Sounds easy enough to start with but gets out of hand quickly.
We're complaining about PATH itself and the way it's used by the system and abused by developers. The complaint would be equally valid if PATH was stored in a text file. |
This whole discussion started with complaints about the Linux directory structure, I have explained several times about the simplicity of the Linux PATH and the directory structure, but now I am confused: are you talking about Windows PATH now? If you are talking about Linux, then I don't see why you have a problem with something so simple.
Yes, let's ignore the several times I've said other Unices such as FreeBSD and MacOS are better.
|
And we have managed to disagree for the best part of a week?
LB wrote: |
---|
There is neither a need for binary files nor a need for GUI applications. In my ideal system, managing these things would be done through system API calls. Then you can use whatever program or code you want. The underlying representation of them is an implementation detail that may change between versions of the system. |
So in your
ideal system, there are no binary files, so there must be ASCII files somewhere - I wonder if they are human readable/editable? If so, then that is what Linux does now. If not, and considering one must use API functions, then that is 1 skerrick away from what Windows does now - A GUI program that deals with the registry. I say this because no user or administrator is going to want to write code in order to configure something. Why bother with code when one can just edit a text file? Sure if someone provides a GUI to help modify that file, then that's nice, but it's not absolutely required for everything. The Windows / Linux philosophy again.
LB wrote: |
---|
These 'standard locations' you talk about are exactly what started this whole discussion, remember? I don't like mixing everything together like that. The ideal way to delect the default version of Python is to make sure it comes first in PATH, but when you mix everything together you make it much more difficult. |
No, you have your Windows hat on still :+) See above for the explanation about directory structure and the PATH environment variable. It's not difficult, it's actually easy. The whole point of having all the small executables or link to executables in /usr/bin , is so that any user can run programs they are entitled to run, without having untold entries in the PATH variable.
With python:
My /usr/bin has these versions of python : python, python2, python2.7, python3.0, python3.2 and there are configuration files for them. There is also a version in the crunch-bang line, all scripts should have this, so then the system will use the correct version, no user intervention required. The crunch-bang line uses whatever file is specified, just like a shell script. So
#!/usr/bin/python
as in the example by
ne555 much earlier, would use that file.
python2.7-conf:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/usr/bin/python2.7
import sys
import os
import getopt
from distutils import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'extension-suffix', 'help']
def exit_with_usage(code=1):
print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
'|'.join('--'+opt for opt in valid_opts))
sys.exit(code)
try:
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
except getopt.error:
exit_with_usage()
if not opts:
exit_with_usage()
pyver = sysconfig.get_config_var('VERSION')
getvar = sysconfig.get_config_var
opt_flags = [flag for (flag, val) in opts]
if '--help' in opt_flags:
exit_with_usage(code=0)
for opt in opt_flags:
if opt == '--prefix':
print sysconfig.PREFIX
elif opt == '--exec-prefix':
print sysconfig.EXEC_PREFIX
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print ' '.join(flags)
elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
libs.append('-lpython' + pyver + (sys.pydebug and "_d" or ""))
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags':
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
libs.extend(getvar('LINKFORSHARED').split())
print ' '.join(libs)
elif opt == '--extension-suffix':
print (sys.pydebug and "_d" or "") + sysconfig.get_config_var('SO')
|