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

Toolchain not detected in rules_foreign_cc #396

Open
mering opened this issue Oct 1, 2024 · 4 comments
Open

Toolchain not detected in rules_foreign_cc #396

mering opened this issue Oct 1, 2024 · 4 comments

Comments

@mering
Copy link
Contributor

mering commented Oct 1, 2024

When using the local toolchain, everything builds fine. When using the hermetic tool chain from this repo, some build systems fail to use the compiler for a simple test program.

Reproduction example in bazel-contrib/rules_foreign_cc#1295.

@fmeum
Copy link
Member

fmeum commented Oct 21, 2024

The linked thread has lots of useful information on how to get ffmpeg to build, thanks for linking it.

I'll close this issue since the problems are due to ffmpeg using an opinionated configure script rather than any issue we could fix in toolchains_llvm.

@fmeum fmeum closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2024
@mering
Copy link
Contributor Author

mering commented Oct 21, 2024

There are things which should be fixed on the toolchain side. For example the $AR and $STRIP environment variable are not populated.

Without them, one has to do hacky stuff like the following for meson builds like libdav1d:

    env = {
        "AR": "$$EXT_BUILD_ROOT/external/toolchains_llvm~~llvm~llvm_toolchain/bin/llvm-ar",
        "STRIP": "$$EXT_BUILD_ROOT/external/toolchains_llvm~~llvm~llvm_toolchain/bin/llvm-strip",
    }

or

    env = {
        "AR": "$$EXT_BUILD_ROOT/$$(dirname $(LD))/llvm-ar",
        "STRIP": "$$EXT_BUILD_ROOT/$$(dirname $(LD))/llvm-strip",
    }

@fmeum could you please reopen? Thanks!

@fmeum fmeum reopened this Oct 21, 2024
@fmeum
Copy link
Member

fmeum commented Oct 21, 2024

That's a good point. Are we not adding them to the tools dict or does rules_foreign_cc not read them from there? Either should be easy to fix.

@mering
Copy link
Contributor Author

mering commented Oct 21, 2024

That's a good point. Are we not adding them to the tools dict or does rules_foreign_cc not read them from there? Either should be easy to fix.

It's on my list to debug this further.

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

No branches or pull requests

2 participants