-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix extensions building #411
Conversation
0754abc
to
4003ded
Compare
I think something like: #412 ontop of it some testing should be added to make sure. |
9a8b4dd
to
4ac9bf0
Compare
Thanks, I have cherry-picked it. |
f578fb0
to
0c39303
Compare
14368c1
to
a3202b0
Compare
Great! |
a25ed92
to
f7cf0f3
Compare
Still working on it, but we are going to be there very soon. |
54e809c
to
94d267e
Compare
5bc8b19
to
ef74fac
Compare
PyEval_InitThreads is depricated, since 3.7 it is not necessary to call it. On python 3.12 it is not present anymore, which cases build to fail. Ref: https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
Otherwise it fails to convert unicode to 'str': ``` Error compiling Cython file: ------------------------------------------------------------ ... if metadata_request_timeout is None: return stmt ms = int(metadata_request_timeout / datetime.timedelta(milliseconds=1)) if ms == 0: return stmt return f"{stmt} USING TIMEOUT {ms}ms" ^ ------------------------------------------------------------ cassandra/util.py:1813:11: Cannot convert Unicode string to 'str' implicitly. This is not portable and requires explicit encoding. ```
We need to see when extension is failed to build on CICD. Let's introduce CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST that is False by default. When it is set, setup.py fails when building of any extension is failed.
There is a bug in distutils that does not allow it to pick up cython for python 3.12 and later.
move to pyproject.toml that supports PEP517/518 this would help us use isolated build env, and avoid all the fragile situation we have with Cython installation dependcy missing in some CI variation
By default docker/setup-qemu-action uses `binmt:master`, which leads to unstable cicd that hard to debug, randm crashes, bogus errors. It fixes one of the issue with aarch64 builds.
We use old 20.04, it is time to update it.
Runner os should match cibuildwheels `MACOSX_DEPLOYMENT_TARGET`, otherwise brew pulls wrong packages that not supported by runner OS.
VSCode cl.exe fails to recognize some of the syntax: ``` cassandra\c_shard_info.c(3083): error C2065: '__uint128_t': undeclared identifier cassandra\c_shard_info.c(3083): error C2146: syntax error: missing ')' before identifier '__pyx_v_biased_token' cassandra\c_shard_info.c(3083): error C2059: syntax error: ')' cassandra\c_shard_info.c(3083): error C2059: syntax error: ')' cassandra\c_shard_info.c(3083): error C2059: syntax error: ')' ``` Let's switch to clang.
ef74fac
to
3a4601a
Compare
I have fixed all of it, running last lap to make sure it is all ok. |
@fruch , @Lorak-mmk , pipeline is finally green, please take a look, we need to merge it in ASAP. |
LGTM, but let's let @fruch who is the matter expert to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -100,6 +100,7 @@ jobs: | |||
if: runner.os == 'Windows' && matrix.platform == 'win64' | |||
run: | | |||
echo "CIBW_BUILD=cp*win_amd64" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |||
echo "CIBW_ENVIRONMENT_WINDOWS= CC=clang CXX=clang++" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document the clang as the preferred compiler on windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its awesome that you introduced pyproject.toml!
Thanks to @fruch |
Please emit a new release with Python 3.13 support |
Can you please confirm it works for you. |
I don't know how to test it. My test involves cqlsh, and I don't know how to tell cqlsh to use a locally compiled driver. |
cqlsh would use the driver installed into scylla-python3, which in turn take it from what installed in dbuild (if it was built with that) |
I don't know how to do any of that. |
Don't mind, I have tested it on fedora:41, it works just fine |
Thanks. |
By accident @avikivity has found that
cassandra.io.libevwrapper
is not built properly forfedora:41
.Later @fruch has discovered that on other systems we have similar problems that we failed to spot becasuse
setup.py
ignores when extension building fails.To address that this PR introduces
CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST
which isFalse
by default.When it is set,
setup.py
fails when extension build is failed.CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST=yes
is added to the CICD, to make it fail, so that we see problem right away.This PR also addresses all the problems that
CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST
uncovered with failed extensions.pyproject.toml
is also introduced to fix building foraarch64
andpython 3.13
, by some reasoncibuildwheel
fails to pull all the dependancies in such case.Fixes following problems:
PyEval_InitThreads
got depricated and does not exists in python 3.13:aarch64
buildsFixes: #409
Tested
Localy on
fedora:41
imagePre-review checklist
I added relevant tests for new features and bug fixes.All commits compile, pass static checks and pass test.I have provided docstrings for the public items that I want to introduce.I have adjusted the documentation in./docs/source/
.Fixes:
annotations to PR description.