Commit ded7bc01 authored by Emily's avatar Emily
Browse files

bazel_5: drop

EOL and out of security support for over half a year; only used by
outdated TensorFlow source builds. Since we use `tensorflow-bin`
by default now and CUDA 11 and GCC 12 are both being removed, I
think it’s okay to mark these broken until updates can be finished
and merged.
parent 1bcb2913
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ buildBazelPackage rec {
    hash = "sha256-Rq5pAVmxlWBVnph20fkAwbfy+iuBNlfFy14poDPd5h0=";
  };

  bazel = buildPackages.bazel_5;
  #bazel = buildPackages.bazel_5;
  bazel = buildPackages.bazel;

  nativeBuildInputs = [
    pythonEnv
@@ -120,5 +121,7 @@ buildBazelPackage rec {
      "x86_64-linux"
      "aarch64-linux"
    ];
    # Bazel 5 was removed.
    broken = true;
  };
}
+4 −2
Original line number Diff line number Diff line
{
  stdenv,
  bazel_5,
  #bazel_5,
  bazel,
  buildBazelPackage,
  lib,
  fetchFromGitHub,
@@ -285,7 +286,8 @@ let

  _bazel-build = buildBazelPackage.override { inherit stdenv; } {
    name = "${pname}-${version}";
    bazel = bazel_5;
    #bazel = bazel_5;
    bazel = bazel;

    src = fetchFromGitHub {
      owner = "tensorflow";
+0 −41
Original line number Diff line number Diff line
diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java b/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java
index 6fff2af..7e2877e 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java
@@ -47,6 +47,16 @@ public final class PosixLocalEnvProvider implements LocalEnvProvider {
       Map<String, String> env, BinTools binTools, String fallbackTmpDir) {
     ImmutableMap.Builder<String, String> result = ImmutableMap.builder();
     result.putAll(Maps.filterKeys(env, k -> !k.equals("TMPDIR")));
+
+    // In case we are running on NixOS.
+    // If bash is called with an unset PATH on this platform,
+    // it will set it to /no-such-path and default tools will be missings.
+    // See, https://github.com/NixOS/nixpkgs/issues/94222
+    // So we ensure that minimal dependencies are present.
+    if (!env.containsKey("PATH")){
+        result.put("PATH", "@actionsPathPatch@");
+    }
+ 
     String p = clientEnv.get("TMPDIR");
     if (Strings.isNullOrEmpty(p)) {
       // Do not use `fallbackTmpDir`, use `/tmp` instead. This way if the user didn't export TMPDIR
index 95642767c6..39d3c62461 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java
@@ -74,6 +74,16 @@ public final class XcodeLocalEnvProvider implements LocalEnvProvider {

     ImmutableMap.Builder<String, String> newEnvBuilder = ImmutableMap.builder();
     newEnvBuilder.putAll(Maps.filterKeys(env, k -> !k.equals("TMPDIR")));
+
+    // In case we are running on NixOS.
+    // If bash is called with an unset PATH on this platform,
+    // it will set it to /no-such-path and default tools will be missings.
+    // See, https://github.com/NixOS/nixpkgs/issues/94222
+    // So we ensure that minimal dependencies are present.
+    if (!env.containsKey("PATH")){
+      newEnvBuilder.put("PATH", "@actionsPathPatch@");
+    }
+
     String p = clientEnv.get("TMPDIR");
     if (Strings.isNullOrEmpty(p)) {
       // Do not use `fallbackTmpDir`, use `/tmp` instead. This way if the user didn't export TMPDIR
+0 −11
Original line number Diff line number Diff line
diff -ru a/src/main/native/unix_jni_darwin.cc b/src/main/native/unix_jni_darwin.cc
--- a/src/main/native/unix_jni_darwin.cc	1980-01-01 00:00:00.000000000 -0500
+++ b/src/main/native/unix_jni_darwin.cc	2021-11-27 20:35:29.000000000 -0500
@@ -270,6 +270,7 @@
 }
 
 void portable_start_suspend_monitoring() {
+  if (getenv("NIX_BUILD_TOP")) return;
   static dispatch_once_t once_token;
   static SuspendState suspend_state;
   dispatch_once(&once_token, ^{
+0 −763

File deleted.

Preview size limit exceeded, changes collapsed.

Loading