Skip to content

no such package '@io_bazel_rules_rust//rust #103

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

Closed
satori-fredrik opened this issue Jul 8, 2018 · 5 comments
Closed

no such package '@io_bazel_rules_rust//rust #103

satori-fredrik opened this issue Jul 8, 2018 · 5 comments

Comments

@satori-fredrik
Copy link

I wanted to run some of the rust examples in a docker container, built using bazel, but get:

/workspace # bazel build //...
WARNING: Failed to set up cache at /root/.cache/bazel/_bazel_root/cache/repos/v1: /root/.cache/bazel/_bazel_root/cache/repos/v1 ()
ERROR: error loading package '': Encountered error while reading extension file 'rust/repositories.bzl': no such package '@io_bazel_rules_rust//rust': /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/@io_bazel_rules_rust.marker (No such file or directory)
ERROR: error loading package '': Encountered error while reading extension file 'rust/repositories.bzl': no such package '@io_bazel_rules_rust//rust': /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/@io_bazel_rules_rust.marker (No such file or directory)
INFO: Elapsed time: 0.437s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

I also get the following from time to time, dunno what that's about:

/workspace # bazel build //...
ERROR: bazel should not be called from a bazel output directory.

My current setup:

Am using local docker image FROM alpine:3.8 using glibc 2.27-r0, jdk1.8.0_172, bazel-0.15.0-dist

╰─➤  docker run -ti -v "${DIR}/tutor:/workspace/tutor <image id>  

/workspace:

.
├── WORKSPACE
└── tutor
    ├── BUILD
    └── src
        └── main.rs

2 directories, 3 files

/workspace/WORKSPACE:

http_archive(
    name = "io_bazel_rules_rust",
    sha256 = "615639cfd5459fec4b8a5751112be808ab25ba647c4c1953d29bb554ef865da7",
    strip_prefix = "rules_rust-0.0.6",
    urls = [
        "http://bazel-mirror.storage.googleapis.com/github.com/bazelbuild/rules_rust/archive/0.0.6.tar.gz",
        "https://github.com/bazelbuild/rules_rust/archive/0.0.6.tar.gz",
    ],
)

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")

/workspace/tutor/BUILD:

load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary")

rust_binary(
    name = "tutor",
    srcs = [
        "src/main.rs",
    ],

/workspace/tutor/src/main.rs:

fn main() {
    println!("1 - 2 = {}", 1i32 - 2);
}
@satori-fredrik
Copy link
Author

satori-fredrik commented Jul 8, 2018

/workspace # ls $(bazel info output_base)/external
ls: /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external: No such file or directory
/workspace # ls -l /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/
total 48
-rw-r--r--    1 root     root            10 Jul  8 23:17 DO_NOT_BUILD_HERE
-rw-r--r--    1 root     root           764 Jul  8 23:17 README
drwxr-xr-x    2 root     root          4096 Jul  8 23:17 bazel-remote-logs
drwxr-xr-x    2 root     root          4096 Jul  8 23:17 bazel-workers
-rw-r--r--    1 root     root            64 Jul  8 23:17 command.log
lrwxrwxrwx    1 root     root            71 Jul  8 23:17 install -> /root/.cache/bazel/_bazel_root/install/6b900dbed40fcb1263a18feb498ed733
-rw-r--r--    1 root     root         10569 Jul  8 23:17 java.log
-rw-r--r--    1 root     root             0 Jul  8 23:17 java.log.lck
-rw-r--r--    1 root     root           380 Jul  8 23:17 javalog.properties
-rw-r--r--    1 root     root            50 Jul  8 23:17 lock
drwx------    2 root     root          4096 Jul  8 23:17 server

@satori-fredrik
Copy link
Author

Hmm ... looks like something didn't go right:

from java.log:

180708 23:17:08.360:W 1 [com.google.devtools.build.lib.runtime.BlazeWorkspace.writeDoNotBuildHereFile] Couldn't write to '/root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot/DO_NOT_BUILD_HERE': /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot ()
180708 23:17:08.360:W 1 [com.google.devtools.build.lib.runtime.BlazeWorkspace.setupExecRoot] failed to create execution root '/root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot/workspace': /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot/workspace ()

java.log:

/workspace # cat /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/java.log
180708 23:17:07.099:I 1 [com.google.devtools.build.lib.analysis.BlazeVersionInfo.logVersionInfo] Blaze version info: Build label: 0.15.0- (@non-git)
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Sun Jul 8 20:57:49 2018 (1531083469)
Build timestamp: 1531083469
Build timestamp as int: 1531083469
180708 23:17:07.304:I 1 [com.google.devtools.build.lib.runtime.BlazeRuntime.main] Starting Blaze server with pid 9 and args [--max_idle_secs=10800, --connect_timeout_secs=30, --output_user_root=/root/.cache/bazel/_bazel_root, --install_base=/root/.cache/bazel/_bazel_root/install/6b900dbed40fcb1263a18feb498ed733, --install_md5=6b900dbed40fcb1263a18feb498ed733, --output_base=/root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8, --workspace_directory=/workspace, --default_system_javabase=/opt/jdk, --deep_execroot, --expand_configs_in_place, --noexperimental_oom_more_eagerly, --experimental_oom_more_eagerly_threshold=100, --write_command_log, --nowatchfs, --nofatal_event_bus_exceptions, --client_debug=false, --product_name=Bazel, --option_sources=]
180708 23:17:08.360:W 1 [com.google.devtools.build.lib.runtime.BlazeWorkspace.writeDoNotBuildHereFile] Couldn't write to '/root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot/DO_NOT_BUILD_HERE': /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot ()
180708 23:17:08.360:W 1 [com.google.devtools.build.lib.runtime.BlazeWorkspace.setupExecRoot] failed to create execution root '/root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot/workspace': /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/execroot/workspace ()
180708 23:17:08.860:I 15 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command 8f52b4f5-851f-49ab-a8de-32568748750c on thread grpc-default-worker-ELG-3-1
180708 23:17:08.872:I 15 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command 8f52b4f5-851f-49ab-a8de-32568748750c on thread grpc-default-worker-ELG-3-1
180708 23:17:08.895:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command 527e5d4e-3bd7-469a-acd9-09c5ef99d2b4 on thread grpc-command-0
180708 23:17:08.900:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand] [info, --startup_time=595, --extract_data_time=1329, --restart_reason=no_daemon, --binary_path=/workspace/bazel, --rc_source=client, --default_override=0:common=--isatty=0, --default_override=0:common=--terminal_columns=80, --client_env=HOSTNAME=4dddf69cb8e5, --client_env=SHLVL=1, --client_env=HOME=/root, --client_env=JAVA_VERSION_BUILD=14, --client_env=JAVA_VERSION_MAJOR=8, --client_env=TERM=xterm, --client_env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk/bin, --client_env=LANG=C.UTF-8, --client_env=JAVA_VERSION_MINOR=172, --client_env=JAVA_PACKAGE=jdk, --client_env=JAVA_HOME=/opt/jdk, --client_env=PWD=/workspace, --client_cwd=/workspace, output_base]
180708 23:17:08.980:I 19 [com.google.devtools.build.lib.remote.RemoteModule.beforeCommand] Command: buildRequestId = 57a770d2-6ca9-4a54-84ec-b12739d07b06, commandId = c6caee57-5351-49fd-a8f4-ada547b52cde
180708 23:17:08.992:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command 527e5d4e-3bd7-469a-acd9-09c5ef99d2b4 on thread grpc-command-0
180708 23:17:11.535:I 21 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command f47e60e0-d422-4985-94ca-a92a6d4e3353 on thread grpc-default-worker-ELG-3-2
180708 23:17:11.535:I 21 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command f47e60e0-d422-4985-94ca-a92a6d4e3353 on thread grpc-default-worker-ELG-3-2
180708 23:17:11.539:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command 89002ccc-865e-4f52-a751-187ebe0326fe on thread grpc-command-0
180708 23:17:11.540:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand] [info, --startup_time=9, --binary_path=/workspace/bazel, --rc_source=client, --default_override=0:common=--isatty=0, --default_override=0:common=--terminal_columns=80, --client_env=HOSTNAME=4dddf69cb8e5, --client_env=SHLVL=1, --client_env=HOME=/root, --client_env=JAVA_VERSION_BUILD=14, --client_env=JAVA_VERSION_MAJOR=8, --client_env=TERM=xterm, --client_env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk/bin, --client_env=LANG=C.UTF-8, --client_env=JAVA_VERSION_MINOR=172, --client_env=JAVA_PACKAGE=jdk, --client_env=JAVA_HOME=/opt/jdk, --client_env=PWD=/workspace, --client_cwd=/workspace, output_base]
180708 23:17:11.561:I 19 [com.google.devtools.build.lib.buildtool.BuildRequestOptions$JobsConverter.convert] Flag "jobs" was set to "auto"; using 4 jobs
180708 23:17:11.567:I 19 [com.google.devtools.build.lib.remote.RemoteModule.beforeCommand] Command: buildRequestId = 72c4d6fd-586a-4e67-a7cf-228fbf6402a0, commandId = 9cc68ad4-f17c-400b-8c7f-aab8b875da05
180708 23:17:11.569:I 19 [com.google.devtools.build.lib.runtime.BlazeRuntime.setupLogging] Log level: INFO
180708 23:17:11.613:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command 89002ccc-865e-4f52-a751-187ebe0326fe on thread grpc-command-0
180708 23:17:21.654:I 23 [com.google.devtools.build.lib.profiler.AutoProfiler$LoggingElapsedTimeReceiver.log] Spent 38 milliseconds doing Idle GC
180708 23:17:26.855:I 24 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command 42a27f88-86e2-494b-ae47-2e67d9a8acc2 on thread grpc-default-worker-ELG-3-3
180708 23:17:26.856:I 24 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command 42a27f88-86e2-494b-ae47-2e67d9a8acc2 on thread grpc-default-worker-ELG-3-3
180708 23:17:26.859:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command 28a600c3-d3ba-4b78-ba0a-81505dec197c on thread grpc-command-0
180708 23:17:26.866:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand] [build, --startup_time=8, --binary_path=/workspace/bazel, --rc_source=client, --default_override=0:common=--isatty=1, --default_override=0:common=--terminal_columns=272, --client_env=HOSTNAME=4dddf69cb8e5, --client_env=SHLVL=1, --client_env=HOME=/root, --client_env=JAVA_VERSION_BUILD=14, --client_env=JAVA_VERSION_MAJOR=8, --client_env=TERM=xterm, --client_env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk/bin, --client_env=LANG=C.UTF-8, --client_env=JAVA_VERSION_MINOR=172, --client_env=JAVA_PACKAGE=jdk, --client_env=JAVA_HOME=/opt/jdk, --client_env=PWD=/workspace, --client_cwd=/workspace, //...]
180708 23:17:26.870:I 19 [com.google.devtools.build.lib.remote.RemoteModule.beforeCommand] Command: buildRequestId = 0fa3dee2-e4ff-4ae1-adf7-eb8f9a74a114, commandId = 67a362da-eb2f-4f29-8d2d-946185bd016b
180708 23:17:26.902:I 19 [com.google.devtools.build.lib.skyframe.DiffAwarenessManager.maybeGetDiffAwarenessState] Using local DiffAwareness strategy for /workspace
180708 23:17:26.903:I 19 [com.google.devtools.build.lib.skyframe.DiffAwarenessManager.getDiff] Initial baseline view for /workspace is SequentialView[owner=null, position=-2, modifiedAbsolutePaths=[]]
180708 23:17:26.944:I 19 [com.google.devtools.build.lib.skyframe.SequencedSkyframeExecutor.handleDiffsWithMissingDiffInformation] About to scan skyframe graph checking for filesystem nodes of types [EXTERNAL, OUTPUT, EXTERNAL_REPO]
180708 23:17:26.951:I 19 [com.google.devtools.build.lib.skyframe.FilesystemValueChecker.lambda$getDirtyValues$0] Spent 2 ms checking 0 filesystem nodes (7 scanned)
180708 23:17:26.952:I 19 [com.google.devtools.build.lib.skyframe.SequencedSkyframeExecutor.logDiffInfo] DiffAwareness found 0 modified source files and directory listings for /workspace
180708 23:17:27.026:I 19 [com.google.devtools.build.lib.buildtool.BuildTool.buildTargets] Build identifier: 67a362da-eb2f-4f29-8d2d-946185bd016b
180708 23:17:27.204:W 59 [com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run] Aborting evaluation due to com.google.devtools.build.lib.rules.repository.RepositoryFunction$RepositoryFunctionException: java.io.FileNotFoundException: /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/@io_bazel_rules_rust.marker (No such file or directory) while evaluating REPOSITORY_DIRECTORY:@io_bazel_rules_rust
180708 23:17:27.256:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command 28a600c3-d3ba-4b78-ba0a-81505dec197c on thread grpc-command-0
180708 23:17:28.761:I 61 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command a0647176-19ed-49f4-96ff-c0aa9ee2c462 on thread grpc-default-worker-ELG-3-4
180708 23:17:28.762:I 61 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command a0647176-19ed-49f4-96ff-c0aa9ee2c462 on thread grpc-default-worker-ELG-3-4
180708 23:17:28.765:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.<init>] Starting command 9ee1f31d-7596-40a1-a9f8-0806a87737ea on thread grpc-command-0
180708 23:17:28.766:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand] [info, --startup_time=9, --binary_path=/workspace/bazel, --rc_source=client, --default_override=0:common=--isatty=0, --default_override=0:common=--terminal_columns=80, --client_env=HOSTNAME=4dddf69cb8e5, --client_env=SHLVL=1, --client_env=HOME=/root, --client_env=JAVA_VERSION_BUILD=14, --client_env=JAVA_VERSION_MAJOR=8, --client_env=TERM=xterm, --client_env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk/bin, --client_env=LANG=C.UTF-8, --client_env=JAVA_VERSION_MINOR=172, --client_env=JAVA_PACKAGE=jdk, --client_env=JAVA_HOME=/opt/jdk, --client_env=PWD=/workspace, --client_cwd=/workspace, output_base]
180708 23:17:28.772:I 19 [com.google.devtools.build.lib.remote.RemoteModule.beforeCommand] Command: buildRequestId = 0b9ecd50-d50a-4aaa-990f-7e4a84e377e5, commandId = b993ebc1-d2b9-4125-8ddb-a40b1a1e94f1
180708 23:17:28.775:I 19 [com.google.devtools.build.lib.server.GrpcServerImpl$RunningCommand.close] Finished command 9ee1f31d-7596-40a1-a9f8-0806a87737ea on thread grpc-command-0
180708 23:17:38.844:I 63 [com.google.devtools.build.lib.profiler.AutoProfiler$LoggingElapsedTimeReceiver.log] Spent 65 milliseconds doing Idle GC

@mfarrugi
Copy link
Collaborator

@satori-fredrik did you get past this? I think this is a more general bazel + docker issue, and I'm not familiar with the latter.

@UebelAndre
Copy link
Collaborator

Any updates here?

@UebelAndre
Copy link
Collaborator

Gonna close this for now since the workspace has been renamed in #500

If there are any more issues, please don't hesitate to reopen this or create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants