Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Commit

Permalink
setup: update nixpkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
garbas authored and Bastien Abadie committed Apr 3, 2019
1 parent b32b4e1 commit 1ebc128
Show file tree
Hide file tree
Showing 35 changed files with 132 additions and 83 deletions.
2 changes: 1 addition & 1 deletion lib/backend_common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ let
allDeps = builtins.attrNames self;
in {
doCheck = true;
buildInputs =
nativeBuildInputs =
builtins.map (name: self."${name}") (
unique(
(fromRequirementsFile ./../cli_common/requirements-dev.txt) ++
Expand Down
2 changes: 1 addition & 1 deletion lib/cli_common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ let
allDeps = builtins.attrNames self;
in {
doCheck = true;
buildInputs =
nativeBuildInputs =
builtins.map (name: self."${name}") (
builtins.filter (name: builtins.elem name allDeps) (
unique (
Expand Down
24 changes: 15 additions & 9 deletions nix/gecko_env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

let
inherit (releng_pkgs.lib) mkRustPlatform ;
inherit (releng_pkgs.pkgs) rustChannelOf bash autoconf213 clang_7 llvm_7 llvmPackages_7 gcc-unwrapped glibc fetchFromGitHub unzip zip openjdk python2Packages sqlite zlib nasm;
inherit (releng_pkgs.pkgs) rustChannelOf bash autoconf213 gcc-unwrapped glibc fetchFromGitHub unzip zip openjdk python2Packages sqlite zlib nasm;
inherit (releng_pkgs.pkgs.devEnv) gecko;

clang = releng_pkgs.pkgs.clang_7;
clang-tools = releng_pkgs.pkgs.clang-tools.override { inherit llvmPackages; };
llvm = releng_pkgs.pkgs.llvm_7;
llvmPackages = releng_pkgs.pkgs.llvmPackages_7;

# Rust 1.32.0
rustChannel' = rustChannelOf { date = "2019-01-17"; channel = "stable"; };
rustChannel = { inherit (rustChannel') cargo; rust = rustChannel'.rust.override { targets=["armv7-linux-androideabi"]; }; };
Expand Down Expand Up @@ -73,20 +78,20 @@ in gecko.overrideDerivation (old: {
echo "export JAVA_HOME=${openjdk}" >> $geckoenv
# Setup Clang & Autoconf
echo "export CC=${clang_7}/bin/clang" >> $geckoenv
echo "export CXX=${clang_7}/bin/clang++" >> $geckoenv
echo "export LD=${clang_7}/bin/ld" >> $geckoenv
echo "export LLVM_CONFIG=${llvm_7}/bin/llvm-config" >> $geckoenv
echo "export LLVMCONFIG=${llvm_7}/bin/llvm-config" >> $geckoenv # we need both
echo "export LLVM_OBJDUMP=${llvm_7}/bin/llvm-objdump" >> $geckoenv
echo "export CC=${clang}/bin/clang" >> $geckoenv
echo "export CXX=${clang}/bin/clang++" >> $geckoenv
echo "export LD=${clang}/bin/ld" >> $geckoenv
echo "export LLVM_CONFIG=${llvm}/bin/llvm-config" >> $geckoenv
echo "export LLVMCONFIG=${llvm}/bin/llvm-config" >> $geckoenv # we need both
echo "export LLVM_OBJDUMP=${llvm}/bin/llvm-objdump" >> $geckoenv
echo "export AUTOCONF=${autoconf213}/bin/autoconf" >> $geckoenv
# Build custom mozconfig
mozconfig=$out/conf/mozconfig
echo > $mozconfig "
ac_add_options --enable-debug
ac_add_options --with-clang-path=${clang_7}/bin/clang
ac_add_options --with-libclang-path=${llvmPackages_7.libclang}/lib
ac_add_options --with-clang-path=${clang}/bin/clang
ac_add_options --with-libclang-path=${llvmPackages.libclang}/lib
mk_add_options AUTOCLOBBER=1
"
Expand Down Expand Up @@ -115,5 +120,6 @@ in gecko.overrideDerivation (old: {
sqlite
zlib
nasm
clang-tools
];
})
23 changes: 22 additions & 1 deletion nix/lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ in rec {
}:
let

module_name = mkProjectModuleName project_name;

self = mkProject {
# yarn2nix knows how to extract the name/version from package.json
inherit src project_name version;
Expand All @@ -441,6 +443,11 @@ in rec {

extraBuildInputs = extraBuildInputs;

preConfigure = ''
export HOME=$TMPDIR/${module_name}-$RANDOM
mkdir $HOME
'';

checkPhase = ''
yarn lint
yarn test
Expand Down Expand Up @@ -889,15 +896,29 @@ in rec {

inherit src;

checkInputs =
[ makeWrapper
glibcLocales
] ++ buildInputs ++ propagatedBuildInputs;

buildInputs =
[ makeWrapper
glibcLocales
] ++ buildInputs;
] ++ buildInputs ++ propagatedBuildInputs;

nativeBuildInputs =
[ makeWrapper
glibcLocales
] ++ buildInputs ++ propagatedBuildInputs;

propagatedBuildInputs =
[ releng_pkgs.pkgs.cacert
] ++ propagatedBuildInputs;

nativePropagatedBuildInputs =
[ releng_pkgs.pkgs.cacert
] ++ propagatedBuildInputs;

preConfigure = ''
rm -rf build *.egg-info
'';
Expand Down
5 changes: 4 additions & 1 deletion nix/lib/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ let
in pkgs.recurseIntoAttrs (pkgs.lib.fix (self:
let
callPackage = pkgs.newScope self;
fetchcargo = callPackage "${pkgs.path}/pkgs/build-support/rust/fetchcargo.nix" {
cargo = rust.cargo;
};
in {
inherit rust rustRegistry;
buildRustPackage = callPackage "${pkgs.path}/pkgs/build-support/rust" {
inherit rust;
inherit fetchcargo;
};
}
))
4 changes: 2 additions & 2 deletions nix/nix.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "2.1.3",
"sha256": "3169d05aa713f6ffa774f001cae133557d3ad72e23d9b6f6ebbddd77b477304f"
"version": "2.2.1",
"sha256": "264671eb9e5b35b543f87cb55a2879c7d5e8c1333b4f6426ab4f3fb627359f41"
}
4 changes: 2 additions & 2 deletions nix/nixpkgs-mozilla.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "e37160aaf4de5c4968378e7ce6fe5212f4be239f",
"sha256": "013hapfp76s87wiwyc02mzq1mbva2akqxyh37p27ngqiz0kq5f2n"
"rev": "50bae918794d3c283aeb335b209efd71e75e3954",
"sha256": "07b7hgq5awhddcii88y43d38lncqq9c8b2px4p93r5l7z0phv89d"
}
6 changes: 3 additions & 3 deletions nix/nixpkgs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"owner": "NixOS",
"repo": "nixpkgs-channels",
"rev": "80738ed9dc0ce48d7796baed5364eef8072c794d",
"sha256": "0anmvr6b47gbbyl9v2fn86mfkcwgpbd5lf0yf3drgm8pbv57c1dc",
"sha256_tarball": "36755e283e6fb38990e24afa3b2826160e29ff604efb5305eb419f410e6cd1df"
"rev": "07b42ccf2de451342982b550657636d891c4ba35",
"sha256": "1a7ga18pwq0y4p9r787622ry8gssw1p6wsr5l7dl8pqnj1hbbzwh",
"sha256_tarball": "43bf66bb2cc0fea3bda9b61804489063935a3fff283e6ce6f13a35619e7d84df"
}
44 changes: 38 additions & 6 deletions nix/requirements_override.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,26 @@ in skipOverrides {
];
};

"bugbug" = self: old: {
patchPhase = ''
sed -i 's/python-dateutil==2.8.0/python-dateutil/' requirements.txt
sed -i 's/spacy==2.1.0/spacy==2.0.18/' requirements.txt
'';
};

"cryptography" = self: old: {
propagatedBuildInputs =
builtins.filter
(x: ! (pkgs.lib.hasSuffix "-flake8" (builtins.parseDrvName x.name).name))
old.propagatedBuildInputs;
};

"cymem" = self: old: {
patchPhase = ''
sed -i -e "s|setup_requires=\['wheel>=0.32.0,<0.33.0'\],|setup_requires=\['wheel'\],|" setup.py
'';
};

"en-core-web-sm" = self: old: {
propagatedBuildInputs =
builtins.filter
Expand All @@ -66,6 +79,12 @@ in skipOverrides {
'';
};

"murmurhash" = self: old: {
patchPhase = ''
sed -i -e "s|setup_requires=\['wheel>=0.32.0,<0.33.0'\],|setup_requires=\['wheel'\],|" setup.py
'';
};

"numpy" = self: old: {
preConfigure = ''
sed -i 's/-faltivec//' numpy/distutils/system_info.py
Expand All @@ -87,10 +106,20 @@ in skipOverrides {
buildInputs = old.buildInputs ++ [ self."setuptools-scm" ];
};

"preshed" = self: old: {
patchPhase = ''
sed -i -e "s|setup_requires=\['wheel>=0.32.0,<0.33.0'\],|setup_requires=\['wheel'\],|" setup.py
'';
};

"pytest" = self: old: {
buildInputs = old.buildInputs ++ [ self."setuptools-scm" ];
};

"scikit-image" = self: old: {
buildInputs = old.buildInputs ++ [ self."Cython" ];
};

"scipy" = self: old: {
prePatch = ''
rm scipy/linalg/tests/test_lapack.py
Expand All @@ -112,21 +141,24 @@ in skipOverrides {
};
};

"scikit-image" = self: old: {
buildInputs = old.buildInputs ++ [ self."Cython" ];
};

"bugbug" = self: old: {
"spacy" = self: old: {
patchPhase = ''
sed -i 's/python-dateutil==2.8.0/python-dateutil/' requirements.txt
sed -i 's/spacy==2.1.3/spacy==2.0.18/' requirements.txt
sed -i -e "s|setup_requires=\['wheel>=0.32.0,<0.33.0'\],|setup_requires=\['wheel'\],|" setup.py
'';
};

"taskcluster-urls" = self: old: {
patchPhase = ''
# until this is fixed https://github.com/taskcluster/taskcluster-proxy/pull/37
sed -i -e "s|/api/|/|" taskcluster_urls/__init__.py
'';
};

"thinc" = self: old: {
patchPhase = ''
sed -i -e "s|setup_requires=\[\"wheel>=0.32.0,<0.33.0\"\],|setup_requires=\['wheel'\],|" setup.py
'';
};

}
2 changes: 1 addition & 1 deletion nix/tools/mercurial.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ in python2Packages.buildPythonApplication {
sha256 = "00rzjbf2blxkc0qwd9mdzx5fnzgpp4jxzijq6wgsjgmqscx40sy5";
};

buildInputs = [ makeWrapper docutils unzip ];
buildInputs = [ makeWrapper python2Packages.docutils unzip ];

makeFlags = [ "PREFIX=$(out)" ];

Expand Down
2 changes: 1 addition & 1 deletion src/bugbug/data/requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = pythonPackages.buildPythonPackage;
mkDerivation = args: pythonPackages.buildPythonPackage (args // { nativeBuildInputs = args.buildInputs; });
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
Expand Down
5 changes: 0 additions & 5 deletions src/bugbug/data/requirements_override.nix

This file was deleted.

1 change: 1 addition & 0 deletions src/bugbug/data/requirements_override.nix
2 changes: 1 addition & 1 deletion src/bugbug/eval/requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = pythonPackages.buildPythonPackage;
mkDerivation = args: pythonPackages.buildPythonPackage (args // { nativeBuildInputs = args.buildInputs; });
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
Expand Down
5 changes: 0 additions & 5 deletions src/bugbug/eval/requirements_override.nix

This file was deleted.

1 change: 1 addition & 0 deletions src/bugbug/eval/requirements_override.nix
2 changes: 1 addition & 1 deletion src/bugbug/train/requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = pythonPackages.buildPythonPackage;
mkDerivation = args: pythonPackages.buildPythonPackage (args // { nativeBuildInputs = args.buildInputs; });
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
Expand Down
5 changes: 0 additions & 5 deletions src/bugbug/train/requirements_override.nix

This file was deleted.

1 change: 1 addition & 0 deletions src/bugbug/train/requirements_override.nix
4 changes: 2 additions & 2 deletions src/codecoverage/backend/requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = pythonPackages.buildPythonPackage;
mkDerivation = args: pythonPackages.buildPythonPackage (args // { nativeBuildInputs = args.buildInputs; });
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
Expand Down Expand Up @@ -2542,4 +2542,4 @@ in python.withPackages
generated
allOverrides
)
)
)
4 changes: 2 additions & 2 deletions src/codecoverage/bot/requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = pythonPackages.buildPythonPackage;
mkDerivation = args: pythonPackages.buildPythonPackage (args // { nativeBuildInputs = args.buildInputs; });
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
Expand Down Expand Up @@ -1419,4 +1419,4 @@ in python.withPackages
generated
allOverrides
)
)
)
4 changes: 2 additions & 2 deletions src/codecoverage/crawler/requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = pythonPackages.buildPythonPackage;
mkDerivation = args: pythonPackages.buildPythonPackage (args // { nativeBuildInputs = args.buildInputs; });
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
Expand Down Expand Up @@ -1500,4 +1500,4 @@ in python.withPackages
generated
allOverrides
)
)
)
4 changes: 2 additions & 2 deletions src/common/naming/requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let
__old = pythonPackages;
inherit interpreter;
inherit interpreterWithPackages;
mkDerivation = pythonPackages.buildPythonPackage;
mkDerivation = args: pythonPackages.buildPythonPackage (args // { nativeBuildInputs = args.buildInputs; });
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (
Expand Down Expand Up @@ -953,4 +953,4 @@ in python.withPackages
generated
allOverrides
)
)
)
Loading

0 comments on commit 1ebc128

Please sign in to comment.