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

0.15.2 release misses lib/pthread_mutex.c #303

Open
madebr opened this issue Sep 19, 2020 · 1 comment
Open

0.15.2 release misses lib/pthread_mutex.c #303

madebr opened this issue Sep 19, 2020 · 1 comment
Assignees
Labels

Comments

@madebr
Copy link

madebr commented Sep 19, 2020

While creating a build recipe for conan, a c/c++ package manager,
I noticed that lib/pthread_mutex.c is not part of the 0.15.2 source release.

This causes a Visual Studio build to fail with the following error:

CMake Error at source_subfolder/lib/CMakeLists.txt:76 (add_library):
  Cannot find source file:

    pthread_mutex.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

CMake Error at source_subfolder/src/CMakeLists.txt:54 (add_library):

Patching in lib/pthread_mutex.c from current master fixes the error.

@micahsnyder
Copy link

I ran into this as well. Fortunately, unlike with autotools where you need to make a dist tarball to pre-generate the autojunk (configure and the .in files), there's really no need for that step with CMake. In the meantime, you can use the "Source code (tar.gz)" link on the github release page: https://github.com/libcheck/check/releases/tag/0.15.2 to build the 0.15.2 release with CMake.

@jflopezfernandez jflopezfernandez self-assigned this Nov 2, 2020
arnout pushed a commit to buildroot/buildroot that referenced this issue Aug 7, 2023
The release tarball of check 0.15.2 lacks a source file, causing a
build failure, as reported at
libcheck/check#303. This failures happens
when thread support is not available, as the file missing is getting
compiled in when thread support is not there:

if(NOT HAVE_PTHREAD)
  target_sources(check PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../lib/pthread_mutex.c)
  target_sources(checkShared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../lib/pthread_mutex.c)
endif()

This issue started appearing when we moved from the autotools build
system to the CMake build system in commit
6dfc789. One might wonder why
changing the build system can cause this kind of issue: the file was
in fact already missing. Turns out that the missing file is never used
with the autotools build system: this file provides some Win32
compatibility layer for pthread functions, so the autotools build
system never compiled this file as the autotools build system was only
used on Unix platforms. With CMake it now gets compiled to support
Windows platform. But on Linux, the entire contents of the file is
ignored as it is within a HAVE_WIN32_INIT_ONCE ifdef...endif. Still,
with the file missing, the build fails.

Until upstream publishes a new release with a complete tarball, switch
to fetching the Github-generated tarball, which does contain the
missing file.

Fixes:

  http://autobuild.buildroot.net/results/b1087e9a67ff0382632b73f280fabe92cd863593/

Signed-off-by: Waldemar Brodkorb <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
citral23 pushed a commit to citral23/buildroot that referenced this issue Sep 18, 2023
The release tarball of check 0.15.2 lacks a source file, causing a
build failure, as reported at
libcheck/check#303. This failures happens
when thread support is not available, as the file missing is getting
compiled in when thread support is not there:

if(NOT HAVE_PTHREAD)
  target_sources(check PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../lib/pthread_mutex.c)
  target_sources(checkShared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../lib/pthread_mutex.c)
endif()

This issue started appearing when we moved from the autotools build
system to the CMake build system in commit
6dfc789. One might wonder why
changing the build system can cause this kind of issue: the file was
in fact already missing. Turns out that the missing file is never used
with the autotools build system: this file provides some Win32
compatibility layer for pthread functions, so the autotools build
system never compiled this file as the autotools build system was only
used on Unix platforms. With CMake it now gets compiled to support
Windows platform. But on Linux, the entire contents of the file is
ignored as it is within a HAVE_WIN32_INIT_ONCE ifdef...endif. Still,
with the file missing, the build fails.

Until upstream publishes a new release with a complete tarball, switch
to fetching the Github-generated tarball, which does contain the
missing file.

Fixes:

  http://autobuild.buildroot.net/results/b1087e9a67ff0382632b73f280fabe92cd863593/

Signed-off-by: Waldemar Brodkorb <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants