question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failed with /bin/bash: $'\r': command not found WSL Ubuntu 20.04

See original GitHub issue

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 20.04, WSL2):Linux Ubuntu 20.04, WSL2
  • Target (e.g. desktop cpu, android arm64): python3.9 build.py build --desktop gpu -v
  • Bazel version: 4.0.0
  • Python version: 3.9.5
  • GCC/G++ version: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  • Unity version:
  • Android NDK version (if building for Android):
  • Xcode version (if building for iOS):

Describe the problem Build failed

Steps to reproduce the issue -Install WSL 2 with Ubuntu 20.04 distribution -installed required library (python 3.9, pip, numpy, bazel, nuget, gcc) -run python3.9 build.py build --desktop gpu -v

Full logs nolkeg@DESKTOP-71OR9NF:/mnt/d/UnityProjects/MediaPipeUnityPlugin$ python3.9 build.py build --desktop gpu -v INFO (build.py): Building protobuf sources… DEBUG (build.py): Running bazel build -c opt //mediapipe_api:mediapipe_proto_srcs Starting local Bazel server and connecting to it… WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘com_google_absl’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘com_google_protobuf’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘com_google_googletest’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘com_github_gflags_gflags’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘rules_cc’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘rules_python’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘build_bazel_rules_apple’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘build_bazel_rules_swift’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘build_bazel_apple_support’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘bazel_skylib’ because it already exists. DEBUG: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository ‘pybind11’ because it already exists. DEBUG: Rule ‘rules_python’ indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = “1564776078 -0400” DEBUG: Repository rules_python instantiated at: /mnt/d/UnityProjects/MediaPipeUnityPlugin/WORKSPACE:34:23: in <toplevel> /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/rules_pkg/deps.bzl:33:10: in rules_pkg_dependencies /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/bazel_tools/tools/build_defs/repo/utils.bzl:201:18: in maybe Repository rule git_repository defined at: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel> INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 1a42099a527cbef96f5148f4a11d95ddb2d7d8781dd68a664430c1c36b2221cb DEBUG: Rule ‘rules_cc’ indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = “1a42099a527cbef96f5148f4a11d95ddb2d7d8781dd68a664430c1c36b2221cb” DEBUG: Repository rules_cc instantiated at: /mnt/d/UnityProjects/MediaPipeUnityPlugin/WORKSPACE:78:13: in <toplevel> Repository rule http_archive defined at: /home/nolkeg/.cache/bazel/_bazel_nolkeg/2c6909a90362eaccd06b96ea6b50d910/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel> INFO: Analyzed target //mediapipe_api:mediapipe_proto_srcs (43 packages loaded, 666 targets configured). INFO: Found 1 target… ERROR: /mnt/d/UnityProjects/MediaPipeUnityPlugin/mediapipe_api/framework/formats/BUILD:98:17: Executing genrule //mediapipe_api/framework/formats:location_data_cs failed: (Exit 127): bash failed: error executing command /bin/bash -c … (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox bash failed: error executing command /bin/bash -c … (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox /bin/bash: $‘\r’: command not found Target //mediapipe_api:mediapipe_proto_srcs failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 319.508s, Critical Path: 79.02s INFO: 202 processes: 25 internal, 177 linux-sandbox. FAILED: Build did NOT complete successfully Traceback (most recent call last): File “/mnt/d/UnityProjects/MediaPipeUnityPlugin/build.py”, line 392, in <module> Argument().command().run() File “/mnt/d/UnityProjects/MediaPipeUnityPlugin/build.py”, line 109, in run self._run_command(self._build_proto_srcs_commands()) File “/mnt/d/UnityProjects/MediaPipeUnityPlugin/build.py”, line 51, in _run_command return subprocess.run(command_list, check=True) File “/usr/lib/python3.9/subprocess.py”, line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command ‘[‘bazel’, ‘build’, ‘-c’, ‘opt’, ‘//mediapipe_api:mediapipe_proto_srcs’]’ returned non-zero exit status 1.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
homulercommented, May 14, 2021

You can use Docker if your OS is Windows 10 Home, because WSL2 backend is supported (see https://docs.docker.com/docker-for-windows/install/).

You cant’ use Docker only when you need to run it with Hyper-V backend (e.g. to build native libraries for Windows).

0reactions
Nolkegcommented, May 14, 2021

I recommend you use Docker for Windows to build for Android on Windows 10.

Unfotunately, I can’t use docker because I have windows10 home.

Read more comments on GitHub >

github_iconTop Results From Across the Web

command not found" errors running Bash scripts in WSL?
The easiest way to fix the problem is really to just download the files you need inside the Ubuntu system from your bash...
Read more >
'\r': command not found - .bashrc / .bash_profile [duplicate]
I've looked at multiple similar questions but I haven't found one where the question has my error exactly. My home path: $ echo...
Read more >
How To Fix "$'r': command not found" Errors in WSL Bash ...
This error typically arises when running Bash scripts in WSL and can be traced back to the presence of Windows-style line endings in...
Read more >
Why am I getting "line 1: $' :\r': command not found"?
You have Windows-style line endings. The no-op command : is instead read as :<carriage return> , displayed as :\r or more fully as...
Read more >
How to fix the “ '\r': command not found” error
The “ '\r': command not found” occurs when your file contains the DOS script syntax for line ending, but you are attempting to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found