diff --git a/.circleci/config.yml b/.circleci/config.yml index cd1416338a..f7f47dcc42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,8 +32,8 @@ jobs: apt-get install -y wget gnupg golang make libgmp3-dev libtinfo-dev pkg-config zip g++ zlib1g-dev unzip python python3 bash-completion locales echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen locale-gen - wget "https://github.com/bazelbuild/bazel/releases/download/0.24.0/bazel_0.24.0-linux-x86_64.deb" - dpkg -i bazel_0.24.0-linux-x86_64.deb + wget "https://github.com/bazelbuild/bazel/releases/download/0.27.0/bazel_0.27.0-linux-x86_64.deb" + dpkg -i bazel_0.27.0-linux-x86_64.deb echo "common:ci --build_tag_filters -requires_hackage,-requires_zlib,-requires_doctest,-requires_c2hs,-requires_threaded_rts,-dont_test_with_bindist" > .bazelrc.local - run: name: Build tests diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d7d38059f3..c1914af575 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ jobs: architecture: 'x64' - bash: | set -e - curl -LO https://github.com/bazelbuild/bazel/releases/download/0.24.0/bazel-0.24.0-windows-x86_64.exe + curl -LO https://github.com/bazelbuild/bazel/releases/download/0.27.0/bazel-0.27.0-windows-x86_64.exe mv bazel-*.exe bazel.exe mkdir /c/bazel mv bazel.exe /c/bazel diff --git a/shell.nix b/shell.nix index 62bac4d8f5..693b277d8b 100644 --- a/shell.nix +++ b/shell.nix @@ -1,7 +1,33 @@ { pkgs ? import ./nixpkgs {}, docTools ? true }: with pkgs; +let + # WIP: bazel 0.27 upstreamable to nixpkgs + bazel_027 = bazel.overrideAttrs(oldAttrs: rec { + version = "0.27.0"; + name = "bazel-${version}"; + # WIP: needs python3 during build + buildInputs = oldAttrs.buildInputs ++ [pkgs.python3]; + + src = pkgs.fetchurl { + url = "https://github.com/bazelbuild/bazel/releases/download/${version}/${name}-dist.zip"; + sha256 = "0yn662dzgfr8ls4avfl12k5sr4f210bab12wml18bh4sjlxhs263"; + }; + + # Override a few /bin/bash + postPatch = oldAttrs.postPatch + '' + cat tools/build_rules/test_rules.bzl + substituteInPlace tools/build_rules/test_rules.bzl \ + --replace '#!/bin/bash' '/nix/store/ya42d72dxpby7nplsya8fj7bzj3l7529-bash/bin/bash' + + ''; + + # WIP: install check were broken on nixpkgs, I don't know what is + # the current status + doInstallCheck = false; + }); +in mkShell { # XXX: hack for macosX, this flags disable bazel usage of xcode # Note: this is set even for linux so any regression introduced by this flag @@ -15,7 +41,7 @@ mkShell { which perl python3 - bazel + bazel_027 # For stack_install. TODO Remove ghc when move to Stack 2. stack ghc @@ -49,5 +75,12 @@ mkShell { # source bazel bash completion source ${pkgs.bazel}/share/bash-completion/completions/bazel + + # hack for ijar + bazel build --incompatible_disable_deprecated_attr_params=false --incompatible_new_actions_api=false --incompatible_no_support_tools_in_action_inputs=false --incompatible_require_ctx_in_configure_features=false --incompatible_depset_is_not_iterable=false --incompatible_depset_union=false --incompatible_use_python_toolchains=false @remote_java_tools_linux//:java_tools/ijar/ijar + + chmod u+w ./bazel-rules_haskell/external/remote_java_tools_linux/java_tools/ijar/ijar + patchelf --set-rpath ${gcc-unwrapped.lib}/lib/ ./bazel-rules_haskell/external/remote_java_tools_linux/java_tools/ijar/ijar + patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 ./bazel-rules_haskell/external/remote_java_tools_linux/java_tools/ijar/ijar ''; }