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

"the easy way" instructions in README do not produce a passing build #855

Closed
davidabrahams opened this issue May 1, 2019 · 2 comments
Closed

Comments

@davidabrahams
Copy link

Describe the bug
Following along the instructions in the README does not produce a passing build

To Reproduce

➜  haskell curl https://haskell.build/start | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3090    0  3090    0     0  33454      0 --:--:-- --:--:-- --:--:-- 33586
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
WORKSPACE and initial BUILD files created. To run Bazel and build the example:

    $ bazel run //:example
➜  haskell ls
BUILD.bazel Example.hs  WORKSPACE
➜  haskell bazel build //...
Starting local Bazel server and connecting to it...
ERROR: Failed to load Starlark extension '@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl'.
It usually happens when the repository is not defined prior to being used.
This could either mean you have to add the 'io_tweag_rules_nixpkgs' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or the repository 'io_tweag_rules_nixpkgs' was defined too late in your WORKSPACE file.
ERROR: cycles detected during target parsing
INFO: Elapsed time: 1.948s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

Expected behavior
I would expect this script to give me a passing build to start from?

Environment

  • OS name + version: OSX 10.14.3
  • Bazel version: 0.24.1
  • Version of the rules: not sure?

Additional context
all i got

@davidabrahams davidabrahams changed the title "the easy way" instructions in README don't produce a passing build "the easy way" instructions in README do not produce a passing build May 1, 2019
@Profpatsch
Copy link
Contributor

We switched the start script over to to Haskell bindists, but on OSX (and NixOS) only the nix backend is supported.

There is an open issue to make it compatible with nix backends again: #784

@Profpatsch Profpatsch self-assigned this May 2, 2019
@Profpatsch
Copy link
Contributor

Profpatsch commented May 2, 2019

Use this WORKSPACE file in the meantime, it should work:

bazel run //:example --host_platform=@io_tweag_rules_haskell//haskell/platforms:darwin_x86_64_nixpkgs
# Give your project a name. :)
workspace(name = "YOUR_PROJECT_NAME_HERE")

# Load the repository rule to download an http archive.
load(
    "@bazel_tools//tools/build_defs/repo:http.bzl",
    "http_archive"
)

http_archive(
    name = "io_tweag_rules_nixpkgs",
    strip_prefix = "rules_nixpkgs-78f1f6ff1b3df620057749009b22d6912b03945d",
    urls = ["https://github.com/tweag/rules_nixpkgs/archive/78f1f6ff1b3df620057749009b22d6912b03945d.tar.gz"],
)

load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository")

nixpkgs_git_repository(
    name = "nixpkgs",
    revision = "18.09",
)

# Download `rules_haskell`.
# and make it accessible `@io_tweag_rules_haskell`.
http_archive(
    name = "io_tweag_rules_haskell",
    strip_prefix = "rules_haskell-adc3503387fbb54173dc4b4f21ae0aefe33759a4",
    urls = ["https://github.com/tweag/rules_haskell/archive/adc3503387fbb54173dc4b4f21ae0aefe33759a4.tar.gz"],
)

load(
    "@io_tweag_rules_haskell//haskell:repositories.bzl",
    "haskell_repositories"
)

# `haskell_repositories()` sets up all bazel dependencies
# required by `rules_haskell`.
haskell_repositories()

load(
    "@io_tweag_rules_haskell//haskell:nixpkgs.bzl",
    "haskell_register_ghc_nixpkgs",
)

haskell_register_ghc_nixpkgs(
    version = "8.4.3",
    repositories = { "nixpkgs": "@nixpkgs//:default.nix" }
)

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

No branches or pull requests

2 participants