-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
replace accesses to cc_toolchain.compiler_executable with calls to cc_toolchain.get_tool_for_action() #274
Conversation
…_toolchain.get_tool_for_action()
Found it. |
Not as easy as I thought. The current error message suggests that |
That seems to do it, but I'm not sure exactly what these fragments are. Advice would be greatly appreciated. |
A quick question: are all the include directories of the host compiler supposed to be passed to nvcc? It seems it's not the case with my custom |
Otherwise, looks good to me. NOTE: If the |
@hypdeb Yes. The nvcc is just a wrapper in the host compiling case. So all the envs (automatically transitive if you don't specify some weird env flag) and flags ( |
Alright then there's probably some incompatibility between how |
/test |
Please rebase. I might trigger the integration test after merge. Seems some actions update contains breaking change for |
cuda/private/rules/cuda_objects.bzl
Outdated
@@ -1,9 +1,9 @@ | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_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.
And here.
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 just now realized what you meant with your first review comment. Just to confirm: we need to use the use_cpp_toolchain
defined in rules_cuda
because we support versions of Bazel where it is not defined in bazel_tools
correct?
There's no way I suppose to define this one conditionally on the Bazel version? Not that I necessarily think it would be better, mostly out of curiosity.
cuda/private/rules/cuda_objects.bzl
Outdated
load("//cuda/private:actions/compile.bzl", "compile") | ||
load("//cuda/private:cuda_helper.bzl", "cuda_helper") | ||
load("//cuda/private:providers.bzl", "CudaInfo") | ||
load("//cuda/private:rules/common.bzl", "ALLOW_CUDA_HDRS", "ALLOW_CUDA_SRCS") | ||
load("//cuda/private:toolchain.bzl", "find_cuda_toolchain", "use_cpp_toolchain", "use_cuda_toolchain") | ||
load("//cuda/private:toolchain.bzl", "find_cuda_toolchain", "use_cuda_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.
And here.
cuda/private/rules/cuda_library.bzl
Outdated
load("//cuda/private:actions/compile.bzl", "compile") | ||
load("//cuda/private:actions/dlink.bzl", "device_link") | ||
load("//cuda/private:cuda_helper.bzl", "cuda_helper") | ||
load("//cuda/private:providers.bzl", "CudaInfo") | ||
load("//cuda/private:rules/common.bzl", "ALLOW_CUDA_HDRS", "ALLOW_CUDA_SRCS") | ||
load("//cuda/private:toolchain.bzl", "find_cuda_toolchain", "use_cpp_toolchain", "use_cuda_toolchain") | ||
load("//cuda/private:toolchain.bzl", "find_cuda_toolchain", "use_cuda_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.
And here.
cuda/private/rules/cuda_library.bzl
Outdated
@@ -1,10 +1,10 @@ | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_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 think you forgot to revert these changes
@@ -1,9 +1,9 @@ | |||
load("@bazel_skylib//lib:paths.bzl", "paths") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") | |||
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", CC_ACTION_NAMES = "ACTION_NAMES") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_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.
And here.
load("//cuda/private:action_names.bzl", "ACTION_NAMES") | ||
load("//cuda/private:artifact_categories.bzl", "ARTIFACT_CATEGORIES") | ||
load("//cuda/private:providers.bzl", "CudaToolchainConfigInfo", "CudaToolkitInfo") | ||
load("//cuda/private:toolchain.bzl", "use_cpp_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.
And here
load("//cuda/private:action_names.bzl", "ACTION_NAMES") | ||
load("//cuda/private:artifact_categories.bzl", "ARTIFACT_CATEGORIES") | ||
load("//cuda/private:providers.bzl", "CudaToolchainConfigInfo", "CudaToolkitInfo") | ||
load("//cuda/private:toolchain.bzl", "use_cpp_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.
And here
@@ -1,9 +1,9 @@ | |||
load("@bazel_skylib//lib:paths.bzl", "paths") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") | |||
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", CC_ACTION_NAMES = "ACTION_NAMES") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_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.
And here
@@ -1,9 +1,9 @@ | |||
load("@bazel_skylib//lib:paths.bzl", "paths") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") | |||
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", CC_ACTION_NAMES = "ACTION_NAMES") | |||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_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.
And here
load("//cuda/private:action_names.bzl", "ACTION_NAMES") | ||
load("//cuda/private:artifact_categories.bzl", "ARTIFACT_CATEGORIES") | ||
load("//cuda/private:providers.bzl", "CudaToolchainConfigInfo", "CudaToolkitInfo") | ||
load("//cuda/private:toolchain.bzl", "use_cpp_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.
And here
According to the Bazel documentation,
compiler_executable
is going to be phased out. It is already an issue to use it for people who are trying to work with the newrules_cc
implementation of the cc rules.