🐞 bug report
Affected Rule
The issue is caused by the rule: container_deps() WORKSPACE rule.
Is this a regression?
I don't think so. I tried some earlier versions, including 0.20.0 (with repo mapping @nodejs to @nodejs_host), but the error persisted. My guess is this was caused by a change rules_nodejs made that rules_docker may need to adapt to. However, the breakage is between minor versions of rules_nodejs, so this may be a regression on their side. I'm happy to create an issue there if necessary, and I'll see if I can find the cause by looking at the difference between 5.5.4 and 5.6.0.
Description
When using rules_nodejs >= 5.6.0 on an Apple Silicon mac with rules_docker, running container_deps() in the WORKSPACE file to set up rules_docker's deps results in the @rules_nodejs//nodejs:toolchain_type toolchain not being resolved by rules like nodejs_binary.
🔬 Minimal Reproduction
https://github.com/mattsoulanille/docker_rules_nodejs_issue
🔥 Exception or Error
% bazel run :index_bin --toolchain_resolution_debug='nodejs' --define=VERBOSE_LOGS=1
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_amd64//:node_toolchain; mismatching values: linux, x86_64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: execution platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_amd64//:node_toolchain; mismatching values: linux, x86_64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_arm64//:node_toolchain; mismatching values: linux, arm64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: execution platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_arm64//:node_toolchain; mismatching values: linux, arm64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_s390x//:node_toolchain; mismatching values: linux, s390x
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: execution platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_s390x//:node_toolchain; mismatching values: linux, s390x
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_ppc64le//:node_toolchain; mismatching values: linux, ppc
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: execution platform @local_config_platform//:host: Rejected toolchain @nodejs_linux_ppc64le//:node_toolchain; mismatching values: linux, ppc
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: Rejected toolchain @nodejs_darwin_amd64//:node_toolchain; mismatching values: x86_64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: execution platform @local_config_platform//:host: Rejected toolchain @nodejs_darwin_amd64//:node_toolchain; mismatching values: x86_64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: Rejected toolchain @nodejs_darwin_arm64//:node_toolchain; mismatching values: arm64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: execution platform @local_config_platform//:host: Rejected toolchain @nodejs_darwin_arm64//:node_toolchain; mismatching values: arm64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: Rejected toolchain @nodejs_windows_amd64//:node_toolchain; mismatching values: windows, x86_64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: execution platform @local_config_platform//:host: Rejected toolchain @nodejs_windows_amd64//:node_toolchain; mismatching values: windows, x86_64
INFO: ToolchainResolution: Type @rules_nodejs//nodejs:toolchain_type: target platform @local_config_platform//:host: No toolchains found.
ERROR: /Users/matthew/Projects/docker_rules_nodejs_issue/BUILD.bazel:3:14: While resolving toolchains for target //:index_bin: no matching toolchains found for types @rules_nodejs//nodejs:toolchain_type
ERROR: Analysis of target '//:index_bin' failed; build aborted:
INFO: Elapsed time: 0.272s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (38 packages loaded, 259 targets configured)
FAILED: Build did NOT complete successfully (38 packages loaded, 259 targets configured)
🌍 Your Environment
Operating System:
Output of bazel version:
Rules_docker version:
Anything else relevant?
🐞 bug report
Affected Rule
The issue is caused by the rule:
container_deps()WORKSPACE rule.Is this a regression?
I don't think so. I tried some earlier versions, including 0.20.0 (with repo mapping
@nodejsto@nodejs_host), but the error persisted. My guess is this was caused by a changerules_nodejsmade thatrules_dockermay need to adapt to. However, the breakage is between minor versions ofrules_nodejs, so this may be a regression on their side. I'm happy to create an issue there if necessary, and I'll see if I can find the cause by looking at the difference between5.5.4and5.6.0.Description
When using
rules_nodejs >= 5.6.0on an Apple Silicon mac withrules_docker, runningcontainer_deps()in the WORKSPACE file to set uprules_docker's deps results in the@rules_nodejs//nodejs:toolchain_typetoolchain not being resolved by rules likenodejs_binary.🔬 Minimal Reproduction
https://github.com/mattsoulanille/docker_rules_nodejs_issue
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version:Rules_docker version:
Anything else relevant?