different c files on ubuntu vs alpine

15 views
Skip to first unread message

Peter Schay

unread,
Apr 19, 2024, 3:21:14 PMApr 19
to cython...@googlegroups.com
Hi,
It *seems* that Cython 3.0.10 on alpine and musl will generate different C code from the same pyx with the same version of Python.
Is that expected? 
If not, I will spend some more time to verify it and boil it down to a small test case and post the info here in case it's worthy of a bug report.
It seems reasonable to me, since the alpine musl platform is so different than ubuntu, but my understanding was that the c output of cython is supposed to be somewhat portable.
In any case, I would like to learn more about what to expect regarding the generated c code.

Thank you!
Pete

da-woods

unread,
Apr 19, 2024, 3:35:38 PMApr 19
to cython...@googlegroups.com
It depends how different.

It's intended that code produced one one machine will work on another (unless you use something like the `IF/DEF` mechanism to deliberately make something specific). That should be generally true - we try not to make the output depend on the Python version you run it with for example.

We know that absolute paths sometimes get into files (but mostly shouldn't affect the behaviour).
There's at least one known bug with Python sets and order of iteration giving different results (although that isn't machine dependent, just arbitrary).

Personally, I'd quite like to aim for reproducible output, but I don't think any serious effort has been made to achieve that (recently).

It's probably worth reporting unless it's something really trivial like paths in comments.
--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cython-users/CALKyFjaBzN%3DPKqb4Qjs7cnU4_WzZjupTn-s6uOurxL30dF_Fxg%40mail.gmail.com.


Stefan Behnel

unread,
Apr 21, 2024, 1:22:50 AMApr 21
to cython...@googlegroups.com
Deterministic, reproducible output is definitely a goal. The C code should not depend on the machine where it's being produced. We've always tried to assure that.

Peter Schay

unread,
Apr 21, 2024, 11:49:23 AMApr 21
to cython...@googlegroups.com
Thank you for the clarifications, David and Stefan.  Very helpful.
My bug went away; so there is (and likely was) no Cython code generation discrepancy.
Please forgive the false alarm :-) 


On Sat, Apr 20, 2024 at 10:22 PM Stefan Behnel <stef...@behnel.de> wrote:
Deterministic, reproducible output is definitely a goal. The C code should not depend on the machine where it's being produced. We've always tried to assure that.

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages