compiler-research / CppInterOp

A Clang-based C++ Interoperability Library
Other
38 stars 20 forks source link

Fix cppyy-backend installation with ubuntu 24 #290

Open maximusron opened 1 month ago

maximusron commented 1 month ago

Meant to fix #265

The CI seems to be picking up cppyy-cling from master when the backend install fails and uses an include RTypes.h used for ROOT. Specifically strlcpy.h which was copied to fix issues with Clang parsing gcc headers. These are BSD only string functions and not part of any standard, and declared in cling/src/core/clib:

#ifndef ROOT_strlcpy
#define ROOT_strlcpy

#include <ROOT/RConfig.hxx>
#ifdef __cplusplus
extern "C" {
#endif

size_t strlcpy(char *dst, const char *src, size_t siz);
size_t strlcat(char *dst, const char *src, size_t siz);

#ifdef __cplusplus
}

Ideally we should update the header guards for ubuntu 24 but in our case we don't use cppyy-cling, nor does our fork have those files. pip defaults to downloading and using the tarball for upstream cppyy-backend which causes this mess. Defaulting to cmake could fix this

mcbarton commented 1 month ago

@maximusron If this works you'll want to wipe the cache the cache this PR made before merging, and delete the Ubuntu cache on the main too.

mcbarton commented 1 month ago

@maximusron can you link this PR to https://github.com/compiler-research/CppInterOp/issues/265 ?

maximusron commented 1 month ago

@maximusron can you link this PR to #265 ?

Yeah sure, this PR was meant to just fix the cppyy-backend issue but if this works then maybe we can just upgrade the ubuntu versions with this. Ideally we shouldn't have to change anything on the cppyy-backend side but I am still investigating that

mcbarton commented 1 month ago

@maximusron Is the commit where you removed -DLLVM_ENABLE_WERROR=On temporary while you debug this PR?

maximusron commented 1 month ago

@mcbarton yep its temporary, but we have another set of warnings that emerge on ubuntu 24 that we need to fix. On this PR, I removed it since we would error out on the build CppInterOp step. This may happen everytime we change the os/platform/gcc/clang

vgvassilev commented 1 month ago

@mcbarton yep its temporary, but we have another set of warnings that emerge on ubuntu 24 that we need to fix. On this PR, I removed it since we would error out on the build CppInterOp step. This may happen everytime we change the os/platform/gcc/clang

Yes, and as part of this change we will fix them. Otherwise people commit stuff with warnings which are actually real issues...

maximusron commented 1 month ago

@vgvassilev yes I have only removed it fix the pypi issue, theres something in the pyproject.toml file that needs to be changed for no-pep to work. Once that worked I thought we can fix the new warnings before merging

mcbarton commented 1 month ago

@maximusron The ci won't run on this PR until you have resolve the merge conflicts