inline-java icon indicating copy to clipboard operation
inline-java copied to clipboard

The bazel build breaks at fetch of repository in WSL

Open 573 opened this issue 4 years ago • 2 comments

Describe the bug When attempting a bazel build getting

Loading: Loading: 0 packages loaded Analyzing: 62 targets (0 packages loaded, 0 targets configured) waiting for lock on '/home/dkahlenberg/.cache/nix/tarballs/1f29d6zf5n2xnlvc6z07y0b107dxc3i2pfssl0ppcp636563fm0f-file'... waiting for lock on '/home/dkahlenberg/.cache/nix/tarballs/1f29d6zf5n2xnlvc6z07y0b107dxc3i2pfssl0ppcp636563fm0f-file'... /nix/store/89gvmj46vdnajvxsgyhg362gs6rxc1d5-gnused-4.8 INFO: Repository rules_haskell_stack_update instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule _stack_update defined at: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl:1980:32: in ERROR: An error occurred during the fetch of repository 'rules_haskell_stack_update': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) Analyzing: 62 targets (0 packages loaded, 0 targets configured) INFO: Repository maven instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule coursier_fetch defined at: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_jvm_external/coursier.bzl:950:33: in ERROR: /home/dkahlenberg/inline-java/tests/BUILD.bazel:7:13: no such package '@stackage//': no such package '@rules_haskell_stack_update//': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) and referenced by '//tests:spec' ERROR: /home/dkahlenberg/inline-java/tests/BUILD.bazel:7:13: no such package '@stackage//': no such package '@rules_haskell_stack_update//': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) and referenced by '//tests:spec' ERROR: /home/dkahlenberg/inline-java/tests/BUILD.bazel:7:13: no such package '@stackage//': no such package '@rules_haskell_stack_update//': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) and referenced by '//tests:spec' ERROR: /home/dkahlenberg/inline-java/tests/BUILD.bazel:7:13: no such package '@stackage//': no such package '@rules_haskell_stack_update//': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) and referenced by '//tests:spec' ERROR: /home/dkahlenberg/inline-java/tests/BUILD.bazel:7:13: no such package '@stackage//': no such package '@rules_haskell_stack_update//': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) and referenced by '//tests:spec' ERROR: /home/dkahlenberg/inline-java/tests/BUILD.bazel:7:13: no such package '@stackage//': no such package '@rules_haskell_stack_update//': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) and referenced by '//tests:spec' ERROR: /home/dkahlenberg/inline-java/tests/BUILD.bazel:7:13: no such package '@stackage//': no such package '@rules_haskell_stack_update//': Traceback (most recent call last): File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/cabal.bzl", line 1976 _execute_or_fail_loudly(<2 more arguments>) File "/home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in _execute_or_fail_loudly fail(<1 more arguments>) Command failed: /home/dkahlenberg/.cache/bazel/_bazel_dkahlenberg/b0aac5c5f8613dead0406982dee14ecf/external/rules_haskell_stack/stack update openAnonymousTempFileFromDir: inappropriate type (Is a directory) and referenced by '//tests:spec' ERROR: Analysis of target '//tests:spec' failed; build aborted: Analysis failed INFO: Elapsed time: 1.568s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured) FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)

To Reproduce

git clone https://github.com/tweag/inline-java.git
# file ~/.bazelrc.local
# [!] It looks like you are using a linux nix-based system. In order to build this project, you need to add the two following host_platform entries to your .bazelrc.local file.
build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host

Then run

$ NIX_PATH=nixpkgs=http://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz nix-shell --pure --run "bazel build //..."

Expected behavior What is described in the project's Readme.

Environment

  • OS name + version:
uname -a

Linux HOMESRV 4.4.0-19041-Microsoft #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 GNU/Linux

  • Version of the code: https://github.com/tweag/inline-java/commit/a2daaa3cfc5cb172b6334bf5904d1a57025e709a

Additional context Add any other context about the problem here.

Got the hint below to edit .bazelrc.local

[!] It looks like you are using a linux nix-based system. In order to build this project, you need to add the two following host_platform entries to your .bazelrc.local file.

build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host

when attempting to load nix-shell via url as in

NIX_PATH=nixpkgs=http://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz nix-shell --pure -E 'import "${fetchTarball https://github.com/tweag/inline-java/archive/master.tar.gz}/shell.nix" {}' --run "bazel build //..."

573 avatar Apr 09 '21 09:04 573

Thanks for the report @573.

openAnonymousTempFileFromDir: inappropriate type (Is a directory)

The first error might be related to https://github.com/commercialhaskell/stack/issues/5010

That said, this could be the very first time that someone tries inline-java with WSL.

facundominguez avatar Apr 09 '21 12:04 facundominguez

@facundominguez yeah, and I think with WSL2 this error could even be invisible. TBH it is not my first encounter with problems WSL1 belated. Sadly there are reasons to (at least for now) stick with WSL1.

573 avatar Apr 09 '21 12:04 573

Closing since we don't plan to support WSL in the short term. But please, feel free to reopen if you intend to work on this.

facundominguez avatar Oct 25 '22 22:10 facundominguez

@facundominguez yeah, and I think with WSL2 this error could even be invisible. TBH it is not my first encounter with problems WSL1 belated. Sadly there are reasons to (at least for now) stick with WSL1.

Now that there is https://github.com/sakai135/wsl-vpnkit, the reasons to stick with WSL1 do not apply anymore.

573 avatar Oct 26 '22 08:10 573