Commit 95cfbc33 authored by Emily's avatar Emily
Browse files

bazel_6: drop

parent c2374fd1
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -6,7 +6,8 @@
  # Build-time dependencies:
  addDriverRunpath,
  autoAddDriverRunpath,
  bazel_6,
  #bazel_6,
  bazel,
  binutils,
  buildBazelPackage,
  buildPythonPackage,
@@ -77,6 +78,9 @@ let
    # however even with that fix applied, it doesn't work for everyone:
    # https://github.com/NixOS/nixpkgs/pull/184395#issuecomment-1207287129
    platforms = platforms.linux;

    # Needs update for Bazel 7.
    broken = true;
  };

  # Bazel wants a merged cudnn at configuration time
@@ -221,7 +225,8 @@ let
    name = "bazel-build-${pname}-${version}";

    # See https://github.com/google/jax/blob/main/.bazelversion for the latest.
    bazel = bazel_6;
    #bazel = bazel_6;
    bazel = bazel;

    src = fetchFromGitHub {
      owner = "google";
+6 −2
Original line number Diff line number Diff line
@@ -12,7 +12,8 @@
  wheel,
  absl-py,

  bazel_6,
  #bazel_6,
  bazel,
  cctools,

  # python package
@@ -60,7 +61,8 @@ let
      wheel
    ];

    bazel = bazel_6;
    #bazel = bazel_6;
    bazel = bazel;

    bazelTargets = [ ":pip_pkg" ];
    LIBTOOL = lib.optionalString stdenv.hostPlatform.isDarwin "${cctools}/bin/libtool";
@@ -131,5 +133,7 @@ buildPythonPackage {
    changelog = "https://github.com/tensorflow/probability/releases/tag/v${version}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ GaetanLepage ];
    # Needs update for Bazel 7.
    broken = true;
  };
}
+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 −56
Original line number Diff line number Diff line
diff --git a/src/main/native/darwin/sleep_prevention_jni.cc b/src/main/native/darwin/sleep_prevention_jni.cc
index 67c35b201e..e50a58320e 100644
--- a/src/main/native/darwin/sleep_prevention_jni.cc
+++ b/src/main/native/darwin/sleep_prevention_jni.cc
@@ -33,31 +33,13 @@ static int g_sleep_state_stack = 0;
 static IOPMAssertionID g_sleep_state_assertion = kIOPMNullAssertionID;
 
 int portable_push_disable_sleep() {
-  std::lock_guard<std::mutex> lock(g_sleep_state_mutex);
-  BAZEL_CHECK_GE(g_sleep_state_stack, 0);
-  if (g_sleep_state_stack == 0) {
-    BAZEL_CHECK_EQ(g_sleep_state_assertion, kIOPMNullAssertionID);
-    CFStringRef reasonForActivity = CFSTR("build.bazel");
-    IOReturn success = IOPMAssertionCreateWithName(
-        kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, reasonForActivity,
-        &g_sleep_state_assertion);
-    BAZEL_CHECK_EQ(success, kIOReturnSuccess);
-  }
-  g_sleep_state_stack += 1;
-  return 0;
+  // Unreliable, disable for now
+  return -1;
 }
 
 int portable_pop_disable_sleep() {
-  std::lock_guard<std::mutex> lock(g_sleep_state_mutex);
-  BAZEL_CHECK_GT(g_sleep_state_stack, 0);
-  g_sleep_state_stack -= 1;
-  if (g_sleep_state_stack == 0) {
-    BAZEL_CHECK_NE(g_sleep_state_assertion, kIOPMNullAssertionID);
-    IOReturn success = IOPMAssertionRelease(g_sleep_state_assertion);
-    BAZEL_CHECK_EQ(success, kIOReturnSuccess);
-    g_sleep_state_assertion = kIOPMNullAssertionID;
-  }
-  return 0;
+  // Unreliable, disable for now
+  return -1;
 }
 
 }  // namespace blaze_jni
diff --git a/src/main/native/darwin/system_suspension_monitor_jni.cc b/src/main/native/darwin/system_suspension_monitor_jni.cc
index 3483aa7935..51782986ec 100644
--- a/src/main/native/darwin/system_suspension_monitor_jni.cc
+++ b/src/main/native/darwin/system_suspension_monitor_jni.cc
@@ -83,10 +83,7 @@ void portable_start_suspend_monitoring() {
     // Register to receive system sleep notifications.
     // Testing needs to be done manually. Use the logging to verify
     // that sleeps are being caught here.
-    suspend_state.connect_port = IORegisterForSystemPower(
-        &suspend_state, &notifyPortRef, SleepCallBack, &notifierObject);
-    BAZEL_CHECK_NE(suspend_state.connect_port, MACH_PORT_NULL);
-    IONotificationPortSetDispatchQueue(notifyPortRef, queue);
+    // XXX: Unreliable, disable for now
 
     // Register to deal with SIGCONT.
     // We register for SIGCONT because we can't catch SIGSTOP.
+0 −855

File deleted.

Preview size limit exceeded, changes collapsed.

Loading