about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-12-24 18:09:10 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-12-25 07:10:12 +0100
commit597373bbd5ca3237f3b198c150cf7dbb63183fb1 (patch)
tree318e5018a3f8f04004cedff930f3d5fbe0587f5e /pkgs
parent8127edc33590cc9a156afa762b57a4151e1253c5 (diff)
downloadnixlib-597373bbd5ca3237f3b198c150cf7dbb63183fb1.tar
nixlib-597373bbd5ca3237f3b198c150cf7dbb63183fb1.tar.gz
nixlib-597373bbd5ca3237f3b198c150cf7dbb63183fb1.tar.bz2
nixlib-597373bbd5ca3237f3b198c150cf7dbb63183fb1.tar.lz
nixlib-597373bbd5ca3237f3b198c150cf7dbb63183fb1.tar.xz
nixlib-597373bbd5ca3237f3b198c150cf7dbb63183fb1.tar.zst
nixlib-597373bbd5ca3237f3b198c150cf7dbb63183fb1.zip
chromium: Precompile pycs instead of deleting.
This is more of an attempt rather than a real fix (or maybe it is? let's
see) for the corrupted .pyc files during build. I believe the reason we
get these are likely due to several instances of the Python interpreter
that run in parallel and one of these processes might still be writing
the .pyc file.

So, rather than deleting all .pyc files, we now precompile then in order
to avoid any build process trying to generate any .pyc file.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/networking/browsers/chromium/common.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix
index be227fe05793..ee46bb970725 100644
--- a/pkgs/applications/networking/browsers/chromium/common.nix
+++ b/pkgs/applications/networking/browsers/chromium/common.nix
@@ -186,11 +186,13 @@ let
     } // (extraAttrs.gypFlags or {}));
 
     configurePhase = ''
+      # Precompile .pyc files to prevent race conditions during build
+      python -m compileall -q -f . || : # ignore errors
+
       # This is to ensure expansion of $out.
       libExecPath="${libExecPath}"
       python build/linux/unbundle/replace_gyp_files.py ${gypFlags}
       python build/gyp_chromium -f ninja --depth "$(pwd)" ${gypFlags}
-      find . -iname '*.py[co]' -delete
     '';
 
     buildPhase = let