summaryrefslogtreecommitdiff
path: root/pkgs/development/tools/build-managers/bazel
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/build-managers/bazel')
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix78
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel_3/default.nix2
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel_4/default.nix2
3 files changed, 9 insertions, 73 deletions
diff --git a/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix b/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
index 1dfe784ec254..711b971c2d88 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
@@ -1,85 +1,22 @@
-{ buildBazelPackage
-, cacert
+{ buildGoModule
, fetchFromGitHub
-, git
-, go
, lib
-, stdenv
}:
-buildBazelPackage rec {
+buildGoModule rec {
pname = "bazel-remote";
- version = "1.0.0";
+ version = "2.0.1";
src = fetchFromGitHub {
owner = "buchgr";
- repo = "bazel-remote";
+ repo = pname;
rev = "v${version}";
- sha256 = "1fpdw139d5q1377qnqbgkahmdr4mdaa17d2m10wkyvyvijwm4r2m";
+ sha256 = "193amcx4nk7mr51jcawym46gizqmfkvksjxm64pf7s3wraf00v01";
};
- nativeBuildInputs = [ go git ];
+ vendorSha256 = "1sxv9mya8plkn3hpjgfpzgwlh4m3cbhpywqv86brj2h9i4ad0gl5";
- bazelTarget = "//:bazel-remote";
-
- removeRulesCC = false;
-
- # this is to work around `test -f` failing when called by gazelle
- # https://github.com/bazelbuild/bazel-gazelle/blob/v0.19.1/internal/go_repository.bzl#L135
- patches = [ ./disable_build_file_generation.patch ];
-
- fetchAttrs = {
- preBuild = ''
- patchShebangs .
-
- # tell rules_go to use the Go binary found in the PATH
- sed -e 's:go_register_toolchains():go_register_toolchains(go_version = "host"):g' -i WORKSPACE
-
- # tell rules_go to invoke GIT with custom CAINFO path
- export GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt"
-
- # force gazelle to use the nix go cache rather than its own
- # export GO_REPOSITORY_USE_HOST_CACHE=1
- '';
-
- preInstall = ''
- # Remove the go_sdk (it's just a copy of the go derivation) and all
- # references to it from the marker files. Bazel does not need to download
- # this sdk because we have patched the WORKSPACE file to point to the one
- # currently present in PATH. Without removing the go_sdk from the marker
- # file, the hash of it will change anytime the Go derivation changes and
- # that would lead to impurities in the marker files which would result in
- # a different sha256 for the fetch phase.
- rm -rf $bazelOut/external/{go_sdk,\@go_sdk.marker}
- sed -e '/^FILE:@go_sdk.*/d' -i $bazelOut/external/\@*.marker
-
- # Remove the gazelle repository cache as it contains built binaries
- chmod -R u+w $bazelOut/external/bazel_gazelle_go_repository_cache
- rm -rf $bazelOut/external/{bazel_gazelle_go_repository_cache,\@bazel_gazelle_go_repository_cache.marker}
- sed -e '/^FILE:@bazel_gazelle_go_repository_cache.*/d' -i $bazelOut/external/\@*.marker
-
- # Remove the gazelle tools, they contain go binaries that are built
- # non-deterministically. As long as the gazelle version matches the tools
- # should be equivalent.
- rm -rf $bazelOut/external/{bazel_gazelle_go_repository_tools,\@bazel_gazelle_go_repository_tools.marker}
- sed -e '/^FILE:@bazel_gazelle_go_repository_tools.*/d' -i $bazelOut/external/\@*.marker
- '';
-
- sha256 = "1vijh3nl30n8k6xlx6in92pzs70x15akbqiqalk8apgvphvdz8vy";
- };
-
- buildAttrs = {
- preBuild = ''
- patchShebangs .
-
- # tell rules_go to use the Go binary found in the PATH
- sed -e 's:go_register_toolchains():go_register_toolchains(go_version = "host"):g' -i WORKSPACE
- '';
-
- installPhase = ''
- install -Dm755 bazel-bin/*_pure_stripped/bazel-remote $out/bin/bazel-remote
- '';
- };
+ doCheck = false;
meta = with lib; {
homepage = "https://github.com/buchgr/bazel-remote";
@@ -87,6 +24,5 @@ buildBazelPackage rec {
license = licenses.asl20;
maintainers = [ maintainers.uri-canva ];
platforms = platforms.darwin ++ platforms.linux;
- broken = stdenv.isDarwin;
};
}
diff --git a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix
index 5b20ece76803..fd29102b7e58 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/bazel_3/default.nix
@@ -371,7 +371,7 @@ stdenv.mkDerivation rec {
# libcxx includes aren't added by libcxx hook
# https://github.com/NixOS/nixpkgs/pull/41589
- export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${libcxx}/include/c++/v1"
+ export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1"
# don't use system installed Xcode to run clang, use Nix clang instead
sed -i -E "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \
diff --git a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix
index 31dbc2779cde..7fc034220163 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/bazel_4/default.nix
@@ -388,7 +388,7 @@ stdenv.mkDerivation rec {
# libcxx includes aren't added by libcxx hook
# https://github.com/NixOS/nixpkgs/pull/41589
- export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${libcxx}/include/c++/v1"
+ export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem ${lib.getDev libcxx}/include/c++/v1"
# don't use system installed Xcode to run clang, use Nix clang instead
sed -i -E "s;/usr/bin/xcrun (--sdk macosx )?clang;${stdenv.cc}/bin/clang $NIX_CFLAGS_COMPILE $(bazelLinkFlags) -framework CoreFoundation;g" \