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

Unable to use gcc-toolchain with configure_make #168

Closed
TimotheusBachinger opened this issue Apr 15, 2024 · 1 comment
Closed

Unable to use gcc-toolchain with configure_make #168

TimotheusBachinger opened this issue Apr 15, 2024 · 1 comment
Labels
untriaged Requires traige

Comments

@TimotheusBachinger
Copy link

First of all: Thanks for the great work of enabling an hermetic gcc toolchain in Bazel! It helped us already a lot for our understanding.

Description

At the moment we're trying to integrate your toolchain (with a bumped gcc version) in our build but I am already failing to compile a third party project (which we're bundling/shipping/linking against).

The configure_make step is failing during configure with a lot of errors, where some of them seem to be toolchain related. e.g.:

configure:3724: /home/timotheus/.cache/bazel/_bazel_timotheus/17bdf0994d16870d211e03bc3a9d26dd/sandbox/linux-sandbox/21/execroot/_main/external/gcc_toolchain_x86_64/bin/gcc  -c -Dredacted="redacted"  conftest.c >&5
conftest.c:10:10: fatal error: stdio.h: No such file or directory
   10 | #include <stdio.h>
      |          ^~~~~~~~~
compilation terminated.

This looks to me as configure is expecting gcc to find the system include paths by its own.
But those paths are explicitly registered (as I assume the pre-compiled/relocated gcc won't be able to do that on his own)

        gcc_toolchain_workspace_name = rctx.attr.gcc_toolchain_workspace_name,
        target_compatible_with = str(target_compatible_with),
        toolchain_files_repository_name = rctx.attr.toolchain_files_repository_name,

        # Sysroot
        sysroot = sysroot,

        # Includes
        cxx_builtin_include_directories = str(cxx_builtin_include_directories),

This may all be an issue of the external rrdtool project but you guys may have more insights / tips regarding that?

Repro

The issue should be fully reproducible with: Checkmk@3be3a14

bazel build --sandbox_add_mount_pair=/tmp  --sandbox_debug --verbose_failures --platforms=//platforms:x86_64_linux //examples/rrdtool:rrdtool
@github-actions github-actions bot added the untriaged Requires traige label Apr 15, 2024
@TimotheusBachinger
Copy link
Author

Ok - found the issue. One should not overwrite CFLAGS - sorry for the interruption.
Checkmk@3be3a14#diff-a6681743cb45c373cc4ca9f6dfec3a42706c06f3174471bc8e6c6ac7c51aecd3R27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Requires traige
Projects
None yet
Development

No branches or pull requests

1 participant