when the flag --experimental_resolved_file_instead_of_workspace is set some errors are thrown saying certain symbols are private and cannot be imported. The same build works normally without the flags. All of the flags included are:
sync --experimental_repository_resolved_file=resolved.bzl
build --experimental_resolved_file_instead_of_workspace=resolved.bzl
build --experimental_repository_hash_file=resolved.bzl
build --experimental_verify_repository_rules=@bazel_tools//tools/build_defs/repo:git.bzl%git_repository
I added a simple example to show when errors are thrown: https://github.com/C00IHandLuke/bazelexperimental
Ubuntu 16.04.5 LTS
bazel info release
?INFO: Invocation ID: bf53182c-934a-48ce-859c-d365f4afda82
release 0.20.0
I have not seen anything
The logs look like this and the repo above should produce the same logs
ERROR: /bazeltest/resolved.bzl:123:1: symbol '_kubectl_configure' is private and cannot be imported.
ERROR: /bazeltest/resolved.bzl:124:1: name '_kubectl_configure' is not defined
ERROR: Error evaluating WORKSPACE file
ERROR: /bazeltest/resolved.bzl:323:1: symbol '_go_download_sdk' is private and cannot be imported.
ERROR: /bazeltest/resolved.bzl:324:1: name '_go_download_sdk' is not defined
ERROR: Error evaluating WORKSPACE file
ERROR: Skipping ':namespace': error loading package 'external': Package 'external' contains errors
WARNING: Target pattern parsing failed.
ERROR: error loading package 'external': Package 'external' contains errors
INFO: Elapsed time: 4.528s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
I am using exactly the same flags and getting very similar errors:
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:163:1: symbol '_nodejs_repo' is private and cannot be imported.
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:164:1: name '_nodejs_repo' is not defined
(09:26:12) ERROR: Error evaluating WORKSPACE file
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:176:1: symbol '_yarn_repo' is private and cannot be imported.
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:177:1: name '_yarn_repo' is not defined
(09:26:12) ERROR: Error evaluating WORKSPACE file
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:559:1: symbol '_go_download_sdk' is private and cannot be imported.
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:560:1: name '_go_download_sdk' is not defined
(09:26:12) ERROR: Error evaluating WORKSPACE file
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:682:1: symbol '_deb_packages' is private and cannot be imported.
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:683:1: name '_deb_packages' is not defined
(09:26:12) ERROR: Error evaluating WORKSPACE file
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:694:1: symbol '_deb_packages' is private and cannot be imported.
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:695:1: name '_deb_packages' is not defined
(09:26:12) ERROR: Error evaluating WORKSPACE file
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:706:1: symbol '_deb_packages' is private and cannot be imported.
(09:26:12) ERROR: /home/markus/Projects/github.com/path/resolved.bzl:707:1: name '_deb_packages' is not defined
(09:26:12) ERROR: Error evaluating WORKSPACE file
cc @aehlig
Edit: I am happy to provide the resolved file if necessary. Just let me know.
You hit this if you setup buildifier within bazel with rules_go as well:
ERROR: .../resolved.bzl:121:1: symbol '_go_download_sdk' is private and cannot be imported.
ERROR: .../resolved.bzl:122:1: name '_go_download_sdk' is not defined
As fix, I propose the following patch series.
Most helpful comment
As fix, I propose the following patch series.