-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Make system module map generation faster and fully hermetic #280
Conversation
3b4d52b
to
f2ee72f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please land whenever you are ready. Let's make a release when this lands.
f2ee72f
to
1a11e9f
Compare
…azel-contrib#280)" This reverts commit 81f85c0.
@@ -586,3 +593,9 @@ native_binary( | |||
llvm_dist_label_prefix = llvm_dist_label_prefix, | |||
host_dl_ext = host_dl_ext, | |||
) | |||
|
|||
def _is_hermetic_or_exists(rctx, path, sysroot_prefix): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please help me understand how to make RBE work in this case? For example when running bazel from macOS and executing in a remote Linux executor, /usr/include
does not exist on macOS but exists on Linux, this filter will remove /usr/include
from cxx_builtin_include_directories
and that could result in bazel validation failure ...includes the following non-builtin files with absolute paths (if these are builtin files, make sure these paths are in your toolchain)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have this scenario in mind when I wrote this, my assumption being that you would only use this toolchain for RBE together with a hermetic sysroot.
This function only makes sense if you are actually targetting the host, so we should probably disable it when cross compiling and just use all directories unfiltered. If you want to give that a try, I can help you implement and test this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I'm not sure of a reasonable implementation. What would you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was looking at those, but not sure that is reliable. For RBE, exec_os
could be the same as target_os
, right? For example I can define a toolchain like the following and while produce target for linux
as well.
llvm.toolchain(
name = "llvm_toolchain_linux_exec",
exec_arch = "amd64",
exec_os = "linux",
llvm_version = LLVM_VERSION,
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are completely right, I guess we need to match the host OS (obtained e.g. from repository_ctx.os
) against the target OS (this determines the shape of the sysroot).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me give that a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rctx.os.name
for mac is like mac os x
, which is not the same as the convention used by target_os
:( But otherwise this should be a reasonable approach. We just need to do some formalisation.
system_module_maps
no longer performs any IO.