-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Dne 10.10.2014 v 11:36 Johannes Meixner napsal(a):
Hello,
On Oct 10 09:34 Johannes Meixner wrote (excerpt):
I assume .pyc files are not architecture independent so that a package that contains .pyc files cannot be "noarch".
(...)
It seems .pyc files compliled on a 64-bit machine are readable on a 32-bit machine but large integer numbers may get changed which might result different behaviour of the program (e.g. different output format or even different results).
Short version: For all intents and purposes, the bytecode is platform-independent. Don't worry about it.
Long version:
On a 32bit machine, you won't detect any difference between a 32bit and a 64bit bytecode. A number that would be int and TYPE_INT64 on a 64bit will end up being long (TYPE_LONG) on 32bit, regardless of how it is saved. Furthermore, ints and longs work together transparently. If you run into an issue with int/long, your code is platform-dependent in source form as well, because ints are shorter on 32bit. In practice, when programming Python, you simply don't care about the distinction.
If you tried hard enough, you could detect a difference if you ran on a 64bit machine from a 32bit bytecode, but I'm reasonably confident that the only way to get this is to be actively trying to detect specifically this condition. In any case, AFAICT we compile noarchs on 64bits, so the point is moot.
IOW, you are technically right about the platform dependence, but in practice, we can (and do) safely ignore the difference and enjoy the benefits of noarch.
As for "compiled as needed on each end-user's system" -> please note that if the user doesn't have write permissions to the install locations, they have to recompile the sources every time. This is the main reason to ship compiled bytecode. Your package is apparently run as root, but that's an exceptional situation. I would actually recommend that you include .pycs and .pyos for hplip in the rpm, and simplify your %preun.
Rest assured that the "usual method" works just fine in SLE11 as well ;)
regards m.