Skip to content
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

Bazel build fails on Big Sur #644

Open
kdeding opened this issue Apr 3, 2021 · 3 comments
Open

Bazel build fails on Big Sur #644

kdeding opened this issue Apr 3, 2021 · 3 comments

Comments

@kdeding
Copy link

kdeding commented Apr 3, 2021

Following the instructions on README to build github/semantic on MacOS Big Sur (with bazel 4.0.0 or 3.0.0), I got the following errors.

After googling around, tried this command: bazel build --copt="-Wno-error=execute_or_fail_loudly" //.... But it didn't help at all.

Have been stuck on this for the last two days. Would appreciate any help to get around this, because this library can really help me do what I want to.

Many thanks, Kurt

~/apps/semantic master bazel build //... 
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 9a0d62b1-447e-4459-b21e-59ea4add91c8
INFO: Call stack for the definition of repository 'rules_haskell_ghc_darwin_amd64' which is a _ghc_bindist (rule definition at /private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/ghc_bindist.bzl:362:16):
 - <builtin>
 - /private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/ghc_bindist.bzl:494:5
 - /private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/ghc_bindist.bzl:534:9
 - /private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/toolchain.bzl:333:5
 - /Users/kurtk/apps/semantic/WORKSPACE:39:1
INFO: Repository 'rules_haskell_ghc_darwin_amd64' used the following cache hits instead of downloading the corresponding file.
 * Hash 'edb772b00c0d7f18bb56ad27765162ee09c508104d40f82128c9114a02f6cfc2' for https://downloads.haskell.org/~ghc/8.10.2/ghc-8.10.2-x86_64-apple-darwin.tar.xz
If the definition of 'rules_haskell_ghc_darwin_amd64' was updated, verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'rules_haskell_ghc_darwin_amd64':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/ghc_bindist.bzl", line 292
		execute_or_fail_loudly(ctx, <1 more arguments>)
	File "/private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in execute_or_fail_loudly
		fail(<1 more arguments>)
Command failed: ./patch_bins
sed: bin/ghc: in-place editing only works for regular files
sed: bin/ghc-pkg: in-place editing only works for regular files
sed: bin/ghci: in-place editing only works for regular files
sed: bin/haddock: in-place editing only works for regular files
sed: bin/runghc: in-place editing only works for regular files
sed: bin/runhaskell: in-place editing only works for regular files
ERROR: /Users/kurtk/apps/semantic/BUILD.bazel:54:1: //:process depends on @rules_haskell_ghc_darwin_amd64//:toolchain-impl in repository @rules_haskell_ghc_darwin_amd64 which failed to fetch. no such package '@rules_haskell_ghc_darwin_amd64//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/ghc_bindist.bzl", line 292
		execute_or_fail_loudly(ctx, <1 more arguments>)
	File "/private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in execute_or_fail_loudly
		fail(<1 more arguments>)
Command failed: ./patch_bins
sed: bin/ghc: in-place editing only works for regular files
sed: bin/ghc-pkg: in-place editing only works for regular files
sed: bin/ghci: in-place editing only works for regular files
sed: bin/haddock: in-place editing only works for regular files
sed: bin/runghc: in-place editing only works for regular files
sed: bin/runhaskell: in-place editing only works for regular files
ERROR: Analysis of target '//:process' failed; build aborted: no such package '@rules_haskell_ghc_darwin_amd64//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/ghc_bindist.bzl", line 292
		execute_or_fail_loudly(ctx, <1 more arguments>)
	File "/private/var/tmp/_bazel_kurtk/5dcfd34ad3073278f929b526764173ae/external/rules_haskell/haskell/private/workspace_utils.bzl", line 18, in execute_or_fail_loudly
		fail(<1 more arguments>)
Command failed: ./patch_bins
sed: bin/ghc: in-place editing only works for regular files
sed: bin/ghc-pkg: in-place editing only works for regular files
sed: bin/ghci: in-place editing only works for regular files
sed: bin/haddock: in-place editing only works for regular files
sed: bin/runghc: in-place editing only works for regular files
sed: bin/runhaskell: in-place editing only works for regular files
INFO: Elapsed time: 112.588s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (62 packages loaded, 43 targets configured)

@kdeding kdeding changed the title failed to run ./bazel build //... failed to build semantic, by running ./bazel build //... command Apr 3, 2021
@kdeding
Copy link
Author

kdeding commented Apr 4, 2021

I got the build working using cabal. I suppose it's just bazel that gives the trouble.

@patrickt
Copy link
Contributor

patrickt commented Apr 5, 2021

Hmm, interesting. Might be worth trying to upgrade the version of rules_haskell that we target; I don’t think Big Sur had come out when we last updated it, and it looks like there is some problem with the GHC bindist. Is this running on Apple Silicon?

@patrickt patrickt changed the title failed to build semantic, by running ./bazel build //... command Bazel build fails on Big Sur Apr 5, 2021
@kdeding
Copy link
Author

kdeding commented Apr 5, 2021

Thanks for the tip. My machine is an Intel MacBook Pro.

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

2 participants