Skip to content
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

Implicit python version dependency from ob_refcnt change? #22

Open
bktycrg opened this issue Aug 15, 2024 · 0 comments
Open

Implicit python version dependency from ob_refcnt change? #22

bktycrg opened this issue Aug 15, 2024 · 0 comments

Comments

@bktycrg
Copy link

bktycrg commented Aug 15, 2024

Replicating build with zig 0.10.0 at commit 9adce96 (e.g., your talk) on Windows, I experience the following issue when running via pip install:

× Building wheel for zaml (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_ext
      zig build-lib -O ReleaseFast -lc -target x86_64-windows-msvc -femit-bin=build\lib.win-amd64-cpython-312\zaml.cp312-win_amd64.pyd -fallow-shlib-undefined -dynamic -I%PYPATH%\Python312\include -I%PYPATH%\Python312\Include -L%PYPATH%\Python312\Libs -lpython3 zamlmodule.zig
      zamlmodule.zig:39:26: error: no field named 'ob_refcnt' in struct '%ZIGPATH%.zig.o.f50a540243561e8d55a8f2208b6843e4.cimport.struct__object'
                  .ob_refcnt = 1,
                               ^
      %ZIGPATH%\o\f50a540243561e8d55a8f2208b6843e4\cimport.zig:2324:35: note: struct declared here
      pub const struct__object = extern struct {
                                 ~~~~~~~^~~~~~
      referenced by:
          PyInit_zaml: zamlmodule.zig:57:29
          remaining reference traces hidden; use '-freference-trace' to see all reference traces

      error: command '%ZIGPATH%\\zig.EXE' failed with exit code 1
      [end of output]

My best guess is, the C API changed some time around 3.10/3.11 (I'm on 3.12): https://docs.python.org/3/c-api/refcounting.html

If you'd be so kind as to let me know what version of Python you were using, I can try to replicate and narrow this down to the point where I can take a stab at a fix and/or update.

Alternative explanations include specific zig cimport implementations (zigup applied v0.10.0 with f50a5402) but the issue seems consistent across zig versions so I suspect this is less likely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant