Merge branch 'master' into staging

This commit is contained in:
Jan Tojnar
2019-04-05 11:37:15 +02:00
513 changed files with 10098 additions and 5499 deletions
@@ -13,12 +13,17 @@
}:
let
srcDeps = lib.singleton (
fetchurl {
srcDeps = [
(fetchurl {
url = "https://github.com/google/desugar_jdk_libs/archive/915f566d1dc23bc5a8975320cd2ff71be108eb9c.zip";
sha256 = "0b926df7yxyyyiwm9cmdijy6kplf0sghm23sf163zh8wrk87wfi7";
}
);
})
(fetchurl {
url = "https://mirror.bazel.build/bazel_java_tools/java_tools_pkg-0.5.1.tar.gz";
sha256 = "1ld8m5cj9j0r474f56pixcfi0xvx3w7pzwahxngs8f6ns0yimz5w";
})
];
distDir = runCommand "bazel-deps" {} ''
mkdir -p $out
@@ -61,7 +66,7 @@ let
in
stdenv.mkDerivation rec {
version = "0.22.0";
version = "0.24.0";
meta = with lib; {
homepage = "https://github.com/bazelbuild/bazel/";
@@ -85,9 +90,13 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://github.com/bazelbuild/bazel/releases/download/${version}/${name}-dist.zip";
sha256 = "0hannnvia8rvmi2v5d97j1f6wv0m1kxkd5hq4aqp0dqjr0ka4q38";
sha256 = "11gsc00ghxqkbci8nrflkwq1lcvqawlgkaryj458b24si6bjl7b2";
};
# Necessary for the tests to pass on Darwin with sandbox enabled.
# Bazel starts a local server and needs to bind a local address.
__darwinAllowLocalNetworking = true;
sourceRoot = ".";
patches = [
@@ -168,6 +177,10 @@ stdenv.mkDerivation rec {
--replace "/usr/bin/env python" "${python}/bin/python" \
--replace "NIX_STORE_PYTHON_PATH" "${python}/bin/python" \
# md5sum is part of coreutils
sed -i 's|/sbin/md5|md5sum|' \
src/BUILD
# substituteInPlace is rather slow, so prefilter the files with grep
grep -rlZ /bin src/main/java/com/google/devtools | while IFS="" read -r -d "" path; do
# If you add more replacements here, you must change the grep above!
@@ -211,8 +224,17 @@ stdenv.mkDerivation rec {
src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java \
--replace /bin:/usr/bin ${defaultShellPath}
# This is necessary to avoid:
# "error: no visible @interface for 'NSDictionary' declares the selector
# 'initWithContentsOfURL:error:'"
# This can be removed when the apple_sdk is upgraded beyond 10.13+
sed -i '/initWithContentsOfURL:versionPlistUrl/ {
N
s/error:nil\];/\];/
}' tools/osx/xcode_locator.m
# append the PATH with defaultShellPath in tools/bash/runfiles/runfiles.bash
echo "PATH=$PATH:${defaultShellPath}" >> runfiles.bash.tmp
echo "PATH=\$PATH:${defaultShellPath}" >> runfiles.bash.tmp
cat tools/bash/runfiles/runfiles.bash >> runfiles.bash.tmp
mv runfiles.bash.tmp tools/bash/runfiles/runfiles.bash
@@ -236,18 +258,27 @@ stdenv.mkDerivation rec {
customBash
] ++ lib.optionals (stdenv.isDarwin) [ cctools clang libcxx CoreFoundation CoreServices Foundation ];
# If TMPDIR is in the unpack dir we run afoul of blaze's infinite symlink
# detector (see com.google.devtools.build.lib.skyframe.FileFunction).
# Change this to $(mktemp -d) as soon as we figure out why.
# Bazel makes extensive use of symlinks in the WORKSPACE.
# This causes problems with infinite symlinks if the build output is in the same location as the
# Bazel WORKSPACE. This is why before executing the build, the source code is moved into a
# subdirectory.
# Failing to do this causes "infinite symlink expansion detected"
preBuildPhases = ["preBuildPhase"];
preBuildPhase = ''
mkdir bazel_src
shopt -s dotglob extglob
mv !(bazel_src) bazel_src
'';
buildPhase = ''
export TMPDIR=/tmp/.bazel-$UID
./compile.sh
scripts/generate_bash_completion.sh \
--bazel=./output/bazel \
--output=output/bazel-complete.bash \
--prepend=scripts/bazel-complete-header.bash \
--prepend=scripts/bazel-complete-template.bash
# Increasing memory during compilation might be necessary.
# export BAZEL_JAVAC_OPTS="-J-Xmx2g -J-Xms200m"
./bazel_src/compile.sh
./bazel_src/scripts/generate_bash_completion.sh \
--bazel=./bazel_src/output/bazel \
--output=./bazel_src/output/bazel-complete.bash \
--prepend=./bazel_src/scripts/bazel-complete-header.bash \
--prepend=./bazel_src/scripts/bazel-complete-template.bash
'';
installPhase = ''
@@ -255,15 +286,15 @@ stdenv.mkDerivation rec {
# official wrapper scripts that searches for $WORKSPACE_ROOT/tools/bazel
# if it cant find something in tools, it calls $out/bin/bazel-real
cp scripts/packages/bazel.sh $out/bin/bazel
mv output/bazel $out/bin/bazel-real
cp ./bazel_src/scripts/packages/bazel.sh $out/bin/bazel
mv ./bazel_src/output/bazel $out/bin/bazel-real
wrapProgram "$out/bin/bazel" --add-flags --server_javabase="${runJdk}"
# shell completion files
mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions
mv output/bazel-complete.bash $out/share/bash-completion/completions/bazel
cp scripts/zsh_completion/_bazel $out/share/zsh/site-functions/
mv ./bazel_src/output/bazel-complete.bash $out/share/bash-completion/completions/bazel
cp ./bazel_src/scripts/zsh_completion/_bazel $out/share/zsh/site-functions/
'';
doInstallCheck = true;
@@ -278,6 +309,8 @@ stdenv.mkDerivation rec {
examples/java-native/src/test/java/com/example/myproject:hello
}
cd ./bazel_src
# test whether $WORKSPACE_ROOT/tools/bazel works
mkdir -p tools
@@ -30,6 +30,13 @@ let newPython = python3.override {
sha256 = "1fyybgbmlr8ms32j7h76hz5g9xc6nf0644mwhc40a0s5k14makav";
};
});
pluginbase = super.pluginbase.overridePythonAttrs (oldAttrs: rec {
version = "0.7";
src = oldAttrs.src.override {
inherit version;
sha256 = "c0abe3218b86533cca287e7057a37481883c07acef7814b70583406938214cc8";
};
});
};
};
@@ -52,32 +52,32 @@ rec {
};
gradle_latest = gradleGen rec {
name = "gradle-5.0";
nativeVersion = "0.14";
name = "gradle-5.3.1";
nativeVersion = "0.17";
src = fetchurl {
url = "http://services.gradle.org/distributions/${name}-bin.zip";
sha256 = "19krxq9pid9dg6bhdbhhg7ykm5kcx7lv7cr58rj67g0h6jgsqmv1";
sha256 = "0dkl6f17zl9pc6y2xm8xqz23x53fck4p2648vpq8572f0mxa2n8w";
};
};
gradle_4_10 = gradleGen rec {
name = "gradle-4.10.2";
name = "gradle-4.10.3";
nativeVersion = "0.14";
src = fetchurl {
url = "http://services.gradle.org/distributions/${name}-bin.zip";
sha256 = "0a9s2iisivgaapsz4vq1l8fa2w0wnlq0cj67yv5a0rybnahnv75l";
sha256 = "0vhqxnk0yj3q9jam5w4kpia70i4h0q4pjxxqwynh3qml0vrcn9l6";
};
};
gradle_3_5 = gradleGen rec {
name = "gradle-3.5";
name = "gradle-3.5.1";
nativeVersion = "0.14";
src = fetchurl {
url = "http://services.gradle.org/distributions/${name}-bin.zip";
sha256 = "046i268zkg89ps7c1sq8yx9lbn9kighh4gcskxmzf3qriiwm0x0b";
sha256 = "1y7fbhrdriclbs5ksxahi0aafsz760lalwyz8r4llysc5pskbkld";
};
};
@@ -91,6 +91,10 @@ rec {
};
};
# Nix pkgs that depend on this old version:
# pkgs/tools/security/jd-gui/default.nix
# pkgs/servers/mxisd/default.nix
# If these packages are updated, this old version can probably be removed
gradle_2_5 = gradleGen rec {
name = "gradle-2.5";
nativeVersion = "0.10";
@@ -8,7 +8,7 @@ in {
sha256 = "0wzid419mlwqw9llrg8gsx4nkzhqy16m4m40r0xnh6cwscw5wir4";
};
scons_latest = mkScons {
version = "3.0.4";
sha256 = "06lv3pmdz5l23rx3kqsi1k712bdl36i942hgbjh209s94mpb7f72";
version = "3.0.5";
sha256 = "0gn7fgxvx94bjm4cim29cdz91ar1rmfxk2f39wwgljvdvhinyryz";
};
}