OCI to sysroot utility #623
Replies: 2 comments
-
|
OK, I haven't figured out a workaround yet, but I know why it's failing (and this behavior is documented, not a bug): If sysroot is given a label instead of an absolute path, it's translated into the package path. The problem is that's not the path to the extracted sysroot, but the location of |
Beta Was this translation helpful? Give feedback.
-
|
I figured this out -- I had to create a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am most of the way in getting a way to convert lightweight images created with apko into sysroots for use in cross-compilation, which lets me create them on-the-fly using the same base image as the one I plan to use for deployment. Unfortunately the way sysroots fit into
toolchains_llvmis a bit opaque to me. I created a genrule that emits a depset with the extracted files and it correctly creates the sysroot in the directory structure, but then what gets passed to the compiler is wrong.What is the label below expected to point to? What I'm getting passed to clang is
--sysroot=build-support/sysrootrather than--sysroot=build-support/sysroot/sysroot_amd64as expected, so I am guessing thedepset()being passed back with the extracted files is the wrong thing to provide.This is sysroot rule definition; all it does is run a Python script that takes the OCI image and unpacks it:
build-support/sysroot/defs.bzl
build-support/sysroot/BUILD.bazel
If I can get it working and cleaned up I'm happy to put it on GitHub, and then it might be helpful to add to the examples.
Beta Was this translation helpful? Give feedback.
All reactions