Skip to content

Building liblsl-rust in github actions #15

Description

@LangArthur

Hi!

I tried to build a projetc with the liblsl inside a github action, but it fails to build liblsl with the following error :

 In file included from /usr/include/pthread.h:33,
                   from /usr/include/x86_64-linux-gnu/c++/13/bits/gthr-default.h:35,
                   from /usr/include/x86_64-linux-gnu/c++/13/bits/gthr.h:148,
                   from /usr/include/c++/13/ext/atomicity.h:35,
                   from /usr/include/c++/13/bits/ios_base.h:39,
                   from /usr/include/c++/13/ios:44,
                   from /usr/include/c++/13/ostream:40,
                   from /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lsl-sys-0.1.1/liblsl/lslboost/boost/system/error_code.hpp:17,
                   from /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lsl-sys-0.1.1/liblsl/lslboost/boost/system/system_error.hpp:11,
                   from /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/exceptions.hpp:22,
                   from /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/pthread/thread_data.hpp:10,
                   from /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/thread_only.hpp:17,
                   from /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lsl-sys-0.1.1/liblsl/lslboost/libs/thread/src/pthread/thread.cpp:11:
  /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lsl-sys-0.1.1/liblsl/lslboost/boost/thread/pthread/thread_data.hpp:60:5: error: missing binary operator before token "("
     60 | #if PTHREAD_STACK_MIN > 0
        |     ^~~~~~~~~~~~~~~~~

I fond an issue on boost, which seems to be my problem
boostorg/thread#364

However it should have been fixed several years ago, and it seems you are using boost 1.78, which sould be patched.

I also found somewhere else that adding this cmake flags can solve the problem (CFLAGS="-D_GNU_SOURCE", CXXFLAGS="-D_GNU_SOURCE") but exporting them before cargo build does not solved it (it might be override at some point in the build ?)

I do not have any more ideas at the moment, here is my action, nothing too fancy :

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - name: Build
        run: |
          cargo build
      - name: Run tests
        run: cargo test

Do you have any idea ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions