From 5380fcd68f21ac75af284bab06c1c066c6f19922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 15 Apr 2020 13:12:56 +0200 Subject: [PATCH] upgrade Nix packages, and a lot of dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notable version upgrades: - Go: 1.13.4 > 1.14.0 - GoMobile: 20190806 > 20200329 - NodeJS: 10.17.0 > 12.0.0 - Yarn: 1.19.1 > 1.22.4 - Gradle: 5.1.1 > 5.6.4 - OpenJDK: 1.8.0-222 > 8u242-b08 - Clojure: 1.10.0.411 > 1.10.1.507 OpenSSL is still stuck on 1.0.2u due to Android SDK. Signed-off-by: Jakub SokoĊ‚owski --- nix/mobile/android/android-env.nix | 2 +- nix/mobile/android/default.nix | 4 +-- nix/mobile/android/gradle.nix | 15 ---------- nix/patched-go/default.nix | 5 ++-- nix/pkgs.nix | 23 ++++++++++----- nix/status-go/default.nix | 8 ++--- nix/status-go/gomobile/default.nix | 13 +++++---- nix/status-go/gomobile/deps.nix | 47 ++++++++++++++++++++++++++++++ 8 files changed, 79 insertions(+), 38 deletions(-) delete mode 100644 nix/mobile/android/gradle.nix create mode 100644 nix/status-go/gomobile/deps.nix diff --git a/nix/mobile/android/android-env.nix b/nix/mobile/android/android-env.nix index bdecaadeee..d2f7ddb7d3 100644 --- a/nix/mobile/android/android-env.nix +++ b/nix/mobile/android/android-env.nix @@ -7,7 +7,7 @@ let androidComposition = androidenv.composeAndroidPackages { toolsVersion = "26.1.1"; - platformToolsVersion = "29.0.5"; + platformToolsVersion = "29.0.6"; buildToolsVersions = [ "29.0.2" ]; includeEmulator = false; platformVersions = [ "29" ]; diff --git a/nix/mobile/android/default.nix b/nix/mobile/android/default.nix index 34e2c38c9c..d63394eebf 100644 --- a/nix/mobile/android/default.nix +++ b/nix/mobile/android/default.nix @@ -1,8 +1,8 @@ -{ config, lib, callPackage, mkShell, mergeSh, androidenv, flock, lsof, openjdk, +{ config, lib, callPackage, mkShell, mergeSh, androidenv, flock, lsof, openjdk, gradle_5, status-go, localMavenRepoBuilder, projectNodePackage }: let - gradle = callPackage ./gradle.nix { }; + gradle = gradle_5; # Currently 5.6.4 androidEnv = callPackage ./android-env.nix { }; leinProjectDeps = import ../../lein/lein-project-deps.nix { }; diff --git a/nix/mobile/android/gradle.nix b/nix/mobile/android/gradle.nix deleted file mode 100644 index b4c668d2f4..0000000000 --- a/nix/mobile/android/gradle.nix +++ /dev/null @@ -1,15 +0,0 @@ -# -# This Nix expression returns our sanctioned version of Gradle -# - -{ gradleGen, fetchurl }: - -gradleGen.gradleGen rec { - name = "gradle-5.1.1"; - nativeVersion = "0.14"; - - src = fetchurl { - url = "https://services.gradle.org/distributions/${name}-bin.zip"; - sha256 = "16671jp5wdr3q6p91h6szkgcxg3mw9wpgp6hjygbimy50lv34ls9"; - }; -} diff --git a/nix/patched-go/default.nix b/nix/patched-go/default.nix index a1bba31718..b1093f9959 100644 --- a/nix/patched-go/default.nix +++ b/nix/patched-go/default.nix @@ -1,6 +1,7 @@ # -# Patch the Go compiler so that we can have a say (using a NIX_GOWORKDIR environment variable) as to the temporary directory it uses for linking, -# since that directory path ends up in the string table and .gnu.version_d ELF header +# Patch the Go compiler so that we can have a say (using a NIX_GOWORKDIR env variable) +# as to the temporary directory it uses for linking, since that directory path ends up +# in the string table and .gnu.version_d ELF header. # { baseGo }: diff --git a/nix/pkgs.nix b/nix/pkgs.nix index 13f7ba1123..3eafd7e92d 100644 --- a/nix/pkgs.nix +++ b/nix/pkgs.nix @@ -3,19 +3,26 @@ { config ? { } }: let - inherit (import { }) fetchFromGitHub; - nixpkgsSrc = { + inherit (import { }) fetchFromGitHub lib; + + # For testing local version of nixpkgs + #nixpkgsSrc = (import { }).lib.cleanSource "/home/jakubgs/work/nixpkgs"; + + nixpkgsSrc = fetchFromGitHub { name = "nixpkgs-source"; owner = "status-im"; repo = "nixpkgs"; - rev = "6b866d0e1aa66962a63fceb99210276696e5cccc"; - sha256 = "0507cbrvp7m36z86kbgh617cc96j8jk74kvjflxsjz2f196z070p"; + rev = "6dacca5eb43a8bfb02fb09331df607d4465a28e9"; + sha256 = "0whwzll9lvrq4gg5j838skg7fqpvb55w4z7y44pzib32k613y2qn"; # To get the compressed Nix sha256, use: # nix-prefetch-url --unpack https://github.com/${ORG}/nixpkgs/archive/${REV}.tar.gz # The last line will be the hash. }; + defaultConfig = { android_sdk.accept_license = true; + # Android Env still needs old OpenSSL + permittedInsecurePackages = [ "openssl-1.0.2u" ]; # Override some package versions packageOverrides = pkgs: rec { # utilities @@ -24,15 +31,15 @@ let mergeSh = import ./tools/mergeSh.nix { inherit (pkgs.stdenv) lib; }; # custom packages + openjdk = pkgs.openjdk8_headless; nodejs = pkgs.nodejs-10_x; yarn = pkgs.yarn.override { inherit nodejs; }; - clojure = pkgs.clojure.overrideAttrs (old: rec { version = "1.10.0.411"; }); - go = pkgs.callPackage ./patched-go { baseGo = pkgs.go_1_13; }; + go = pkgs.callPackage ./patched-go { baseGo = pkgs.go_1_14; }; # custom builders - buildGoPackage = pkgs.buildGoPackage.override { inherit go; }; + buildGoPackage = pkgs.buildGo114Package.override { inherit go; }; }; }; - pkgs = (import (fetchFromGitHub nixpkgsSrc)) { config = defaultConfig // config; }; + pkgs = (import nixpkgsSrc) { config = defaultConfig // config; }; in pkgs diff --git a/nix/status-go/default.nix b/nix/status-go/default.nix index 9c4fbcc16b..a9c0890761 100644 --- a/nix/status-go/default.nix +++ b/nix/status-go/default.nix @@ -1,4 +1,4 @@ -{ config, stdenv, callPackage, mkShell, mergeSh, buildGoPackage, go, +{ config, stdenv, callPackage, mkShell, mergeSh, fetchFromGitHub, mkFilter, openjdk, androidPkgs, xcodeWrapper }: let @@ -10,10 +10,10 @@ let envFlags = callPackage ../tools/envParser.nix { }; enableNimbus = (attrByPath ["STATUS_GO_ENABLE_NIMBUS"] "0" envFlags) != "0"; utils = callPackage ./utils.nix { inherit xcodeWrapper; }; - gomobile = callPackage ./gomobile { inherit (androidPkgs) platform-tools; inherit xcodeWrapper utils buildGoPackage; }; + gomobile = callPackage ./gomobile { inherit (androidPkgs) platform-tools; inherit xcodeWrapper utils; }; nimbus = if enableNimbus then callPackage ./nimbus { } else { wrappers-android = { }; }; - buildStatusGoDesktopLib = callPackage ./build-desktop-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; }; - buildStatusGoMobileLib = callPackage ./build-mobile-status-go.nix { inherit buildGoPackage go gomobile xcodeWrapper utils androidPkgs; }; + buildStatusGoDesktopLib = callPackage ./build-desktop-status-go.nix { inherit xcodeWrapper utils; }; + buildStatusGoMobileLib = callPackage ./build-mobile-status-go.nix { inherit gomobile xcodeWrapper utils androidPkgs; }; srcData = # If config.status-im.status-go.src-override is defined, instruct Nix to use that path to build status-go if (attrByPath ["status-im" "status-go" "src-override"] "" config) != "" then rec { diff --git a/nix/status-go/gomobile/default.nix b/nix/status-go/gomobile/default.nix index 58b24fae3d..57ee9a61f1 100644 --- a/nix/status-go/gomobile/default.nix +++ b/nix/status-go/gomobile/default.nix @@ -1,6 +1,5 @@ -{ stdenv, callPackage, utils, fetchgit, - buildGoPackage, glibc, ncurses5, zlib, makeWrapper, patchelf, - platform-tools, xcodeWrapper +{ stdenv, callPackage, utils, fetchgit, buildGoPackage, + ncurses5, zlib, makeWrapper, patchelf, platform-tools, xcodeWrapper }: let @@ -8,12 +7,13 @@ let inherit (stdenv.lib) optional optionalString strings; in buildGoPackage rec { pname = "gomobile"; - version = "20190719-${strings.substring 0 7 rev}"; - rev = "d2bd2a29d028cb94031e5e81788b19b371d00eb8"; - sha256 = "1nv6vvhnjr01nx9y06q46ww87dppdwpbqrlsfg1xf2587wxl8xiv"; + version = "20200329-${strings.substring 0 7 rev}"; + rev = "4c31acba000778d337c0e4f32091cc923b3363d2"; + sha256 = "0k42pn6fq886k9hn85wbgg4h4y1myj7niw0746sn50zfbrmy3s2c"; goPackagePath = "golang.org/x/mobile"; subPackages = [ "bind" "cmd/gobind" "cmd/gomobile" ]; + goDeps = ./deps.nix; buildInputs = [ makeWrapper ] ++ optional isDarwin xcodeWrapper; @@ -67,6 +67,7 @@ in buildGoPackage rec { src = fetchgit { inherit rev sha256; + name = "gomobile"; url = "https://go.googlesource.com/mobile"; }; diff --git a/nix/status-go/gomobile/deps.nix b/nix/status-go/gomobile/deps.nix new file mode 100644 index 0000000000..7a4f6d1e45 --- /dev/null +++ b/nix/status-go/gomobile/deps.nix @@ -0,0 +1,47 @@ +[ + { + goPackagePath = "golang.org/x/tools"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/tools"; + rev = "6edc0a871e69"; + sha256 = "1nxrr7nin65cmsm6i3vxdc57n03v1i541hfllw0p4zw8f414wfll"; + }; + } + { + goPackagePath = "golang.org/x/mod"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/mod"; + rev = "331c550502dd"; + sha256 = "0942gzs6mlsjal4drjmm8gr54pj1cdhsl9mnj3ygm200mf3fj6pi"; + }; + } + { + goPackagePath = "golang.org/x/exp"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/exp"; + rev = "ec7cb31e5a56"; + sha256 = "19b4kdwfahq9f809v4lmn9h47sq1y67nkl7csnracn5qd334hp06"; + }; + } + { + goPackagePath = "golang.org/x/image"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/image"; + rev = "cff245a6509b"; + sha256 = "0hiznlkiaay30acwvvyq8g6bm32r7bc6gv47pygrcxqpapasbz84"; + }; + } + { + goPackagePath = "golang.org/x/xerrors"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/xerrors"; + rev = "1b5146add8981d58be77b16229c0ff0f8bebd8c1"; + sha256 = "0w2akj91krxjag0xdhsg78470888nicc5ismc2ap9jqpss6v1zih"; + }; + } +]