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

Update to fc39 #1419

Merged
merged 5 commits into from Jan 23, 2024
Merged

Update to fc39 #1419

merged 5 commits into from Jan 23, 2024

Conversation

EdwardSro
Copy link
Contributor

Prepare rdma-core for FC39

@EdwardSro EdwardSro mentioned this pull request Jan 14, 2024
@@ -8,7 +8,7 @@ function(build_module_from_cfiles PY_MODULE MODULE_NAME ALL_CFILES LINKER_FLAGS)
string(REGEX REPLACE "\\.so$" "" SONAME "${MODULE_NAME}${CMAKE_PYTHON_SO_SUFFIX}")
add_library(${SONAME} SHARED ${ALL_CFILES})
set_target_properties(${SONAME} PROPERTIES
COMPILE_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-strict-aliasing -Wno-unused-function -Wno-redundant-decls -Wno-shadow -Wno-cast-function-type -Wno-implicit-fallthrough -Wno-unknown-warning -Wno-unknown-warning-option -Wno-deprecated-declarations ${NO_VAR_TRACKING_FLAGS}"
COMPILE_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-strict-aliasing -Wno-unused-function -Wno-redundant-decls -Wno-shadow -Wno-cast-function-type -Wno-implicit-fallthrough -Wno-deprecated-declarations ${NO_VAR_TRACKING_FLAGS}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably going to break something else.. I guess you need to test the flags for compatability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the mentioned c11 warnings/notes now.
Anyway, I understand that it's not related to FC39 specifically, so I'm removing this commit from this PR.

@jgunthorpe
Copy link
Member

The fedora image the cbuild creates has only cython 3.0.6, that needs to be fixed too
Also you need to address:

CMake Warning (dev) at CMakeLists.txt:218 (FIND_PACKAGE):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

@EdwardSro
Copy link
Contributor Author

EdwardSro commented Jan 16, 2024

The fedora image the cbuild creates has only cython 3.0.6, that needs to be fixed too

What should be "fixed" here? Currently, cython 3 has a (bug) that prevents us from compiling pyverbs. That's why I disabled pyverbs on any cython3 < 3.0.9 (next release)
Edit: I see the issue in the packaging... - I think I found a workaround for the cython bug - will update

CMake Warning (dev) at CMakeLists.txt:218 (FIND_PACKAGE): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

I'll address that. FindPythonInterp and FindPythonLibs are replaced with FindPython since cmake 3.12 - should we support backward compatibility with older cmake?

@jgunthorpe
Copy link
Member

You have to make the CI pass, so either cbuild has to install a fixed cython somehow, or the rpm build should not fail when it reaches the missing pyverbs.

rleon and others added 3 commits January 21, 2024 20:56
Error compiling Cython file:
------------------------------------------------------------
...
        """
        super().__init__()
        self.pd = pd
        self.init_attr.pd = <v.ibv_pd*>pd.pd
        if pd_context:
            self.init_attr.alloc = pd_alloc
                                   ^
------------------------------------------------------------

/home/leonro/src/rdma-core/pyverbs/pd.pyx:230:35: Cannot assign type 'void *(ibv_pd *, void *, size_t,
size_t, uint64_t) except? NULL' to 'void *(*)(ibv_pd *, void *, size_t, size_t, uint64_t) noexcept'.
Exception values are incompatible. Suggest adding 'noexcept' to type 'void *(ibv_pd *, void *, size_t,
size_t, uint64_t) except? NULL'.

Error compiling Cython file:
------------------------------------------------------------
...
        super().__init__()
        self.pd = pd
        self.init_attr.pd = <v.ibv_pd*>pd.pd
        if pd_context:
            self.init_attr.alloc = pd_alloc
            self.init_attr.free = pd_free
                                  ^
------------------------------------------------------------

Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Edward Srouji <[email protected]>
Adapt to Cython 3 to get rid of such warnings:
"<frozen importlib._bootstrap>:241: UserWarning: enum class
rdma_port_space not importable from pyverbs.librdmacm_enums. You are
probably using a cpdef enum declared in a .pxd file that does not have a
.py  or .pyx file.
<frozen importlib._bootstrap>:241: UserWarning: enum class
ibv_send_flags not importable from pyverbs.libibverbs. You are probably
using a cpdef enum declared in a .pxd file that does not have a .py  or
.pyx file."

By adding empty .pyx files with the same name as current .pxd, or by
renaming relevant .pxd files where it's possible.

Signed-off-by: Edward Srouji <[email protected]>
Replace Cython includes with cimports to work around a Cython 3 bug
(#5860 on the Cython GitHub) that causes the following compilation
errors:

build/pyverbs/device.c:14743:18: error: redefinition of ‘__Pyx_Enum_enum__space_ibv_event_type_to_py’
14743 | static PyObject *__Pyx_Enum_enum__space_ibv_event_type_to_py(enum ibv_event_type __pyx_v_c_val) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
build/pyverbs/device.c:10914:18: note: previous definition of ‘__Pyx_Enum_enum__space_ibv_event_type_to_py’ with
type ‘PyObject *(enum ibv_event_type)’ {aka ‘struct _object *(enum ibv_event_type)’}
10914 | static PyObject *__Pyx_Enum_enum__space_ibv_event_type_to_py(enum ibv_event_type __pyx_v_c_val) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Edward Srouji <[email protected]>
@EdwardSro EdwardSro marked this pull request as draft January 21, 2024 20:11
EdwardSro and others added 2 commits January 22, 2024 15:56
Fix the following CMake warning in recent versions:

"CMake Warning (dev) at CMakeLists.txt:231 (FIND_PACKAGE):
 Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
 are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
 the cmake_policy command to set the policy and suppress this warning.

 This warning is for project developers.  Use -Wno-dev to suppress it."

Signed-off-by: Edward Srouji <[email protected]>
Use latest Fedora release

Signed-off-by: Leon Romanovsky <[email protected]>
@EdwardSro
Copy link
Contributor Author

Updated PR to:

  • Work-around cython3 bug (pyverbs should work now on any supported cython version)
  • Address cmake warnings
  • Build FC39 package successfully

@EdwardSro EdwardSro marked this pull request as ready for review January 22, 2024 14:51
@jgunthorpe jgunthorpe merged commit bc6b4bc into linux-rdma:master Jan 23, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants