mirror of
https://github.com/status-im/status-react.git
synced 2025-02-01 21:57:16 +00:00
nix: upgrade nixpkgs
Also: - upgrade Go: 1.12 > 1.13 - upgrade Android SDK: 28.0.3 > 29.0.2 - nix: stop using system Fastlane for iOS builds - nix: include CocoaPods in shell for iOS - nix: concatenate shellHooks correctly - fix gomobile status-go build by setting GO111MODULE=off - fix gradle accepting empty STATUS_GO_SRC_OVERRIDE value - don't use a pure shell for uploadToSauceLabs() Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
7ab5cf053f
commit
b32dd113f6
@ -22,9 +22,9 @@
|
||||
|
||||
# Version requirements used throughout the Gradle scripts
|
||||
minSdkVersion=23
|
||||
compileSdkVersion=28
|
||||
targetSdkVersion=28
|
||||
buildToolsVersion=28.0.3
|
||||
compileSdkVersion=29
|
||||
targetSdkVersion=29
|
||||
buildToolsVersion=29.0.2
|
||||
supportLibVersion=28.0.0
|
||||
gradlePluginVersion=3.4.1
|
||||
|
||||
|
@ -93,7 +93,7 @@ def renameAPKs() {
|
||||
/* rename each for upload & archiving */
|
||||
for (apk in found) {
|
||||
def arch = extractArchFromAPK(apk)
|
||||
def pkg = utils.pkgFilename(btype, 'apk', arch)
|
||||
def pkg = utils.pkgFilename(env.BUILD_TYPE, 'apk', arch)
|
||||
def newApk = "result/${pkg}"
|
||||
renamed += newApk
|
||||
sh "cp ${apk.path} ${newApk}"
|
||||
@ -118,7 +118,7 @@ def uploadToSauceLabs() {
|
||||
if (changeId != null) {
|
||||
env.SAUCE_LABS_NAME = "${changeId}.apk"
|
||||
} else {
|
||||
def pkg = utils.pkgFilename(utils.getBuildType(), 'apk', 'x86')
|
||||
def pkg = utils.pkgFilename(env.BUILD_TYPE, 'apk', 'x86')
|
||||
env.SAUCE_LABS_NAME = "${pkg}"
|
||||
}
|
||||
withCredentials([
|
||||
@ -134,7 +134,8 @@ def uploadToSauceLabs() {
|
||||
keep: [
|
||||
'FASTLANE_DISABLE_COLORS', 'APK_PATHS',
|
||||
'SAUCE_ACCESS_KEY', 'SAUCE_USERNAME', 'SAUCE_LABS_NAME'
|
||||
]
|
||||
],
|
||||
pure: false
|
||||
)
|
||||
}
|
||||
return env.SAUCE_LABS_NAME
|
||||
|
@ -40,23 +40,3 @@ let
|
||||
};
|
||||
|
||||
in fastlane
|
||||
|
||||
## This nix file cannot currently be used for iOS due to an error in BUILD TARGET ReactNativeConfig OF PROJECT ReactNativeConfig WITH CONFIGURATION Release
|
||||
## The log shows:
|
||||
## PhaseScriptExecution Run\ Script /Users/jenkins/Library/Developer/Xcode/DerivedData/StatusIm-gzbepwnrlqbukxbmmpfskimspfch/Build/Intermediates.noindex/ArchiveIntermediates/StatusIm/IntermediateBuildFilesPath/ReactNativeConfig.build/Release-iphoneos/ReactNativeConfig.build/Script-EBE4E8281C7BF689000F8875.sh
|
||||
## /bin/sh -c /Users/jenkins/Library/Developer/Xcode/DerivedData/StatusIm-gzbepwnrlqbukxbmmpfskimspfch/Build/Intermediates.noindex/ArchiveIntermediates/StatusIm/IntermediateBuildFilesPath/ReactNativeConfig.build/Release-iphoneos/ReactNativeConfig.build/Script-EBE4E8281C7BF689000F8875.sh
|
||||
## which calls node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.ruby. The log further shows:
|
||||
## Ignoring json-2.2.0 because its extensions are not built. Try: gem pristine json --version 2.2.0
|
||||
## Ignoring unf_ext-0.0.7.6 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.6
|
||||
## /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find unf_ext-0.0.7.6 in any of the sources (Bundler::GemNotFound)
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/spec_set.rb:85:in `map!'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/spec_set.rb:85:in `materialize'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/definition.rb:170:in `specs'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/definition.rb:237:in `specs_for'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/definition.rb:226:in `requested_specs'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:108:in `block in definition_method'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:20:in `setup'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler.rb:107:in `setup'
|
||||
## from /nix/store/w7rysr83rd8jga24mp3a2m3vx50n4nva-bundler-1.17.2/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/setup.rb:20:in `<top (required)>'
|
||||
## from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
|
||||
## from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
|
||||
|
@ -2,8 +2,8 @@ apply plugin: 'com.android.library'
|
||||
|
||||
def getStatusGoSHA1 = { ->
|
||||
def statusgoOverridePath = System.getenv("STATUS_GO_SRC_OVERRIDE")
|
||||
if (statusgoOverridePath != null) {
|
||||
printf "build.gradle: Using local version of status-go from ${statusgoOverridePath}"
|
||||
if (statusgoOverridePath != null && statusgoOverridePath != "") {
|
||||
logger.info("build.gradle: Using local version of status-go from ${statusgoOverridePath}")
|
||||
return "unknown" // This value is defined in https://github.com/status-im/status-react/blob/develop/nix/status-go/default.nix, in `srcData.shortRev`
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# This Nix expression appends/modifies an existing attribute set in order to run scripts/setup if needed,
|
||||
# This Nix expression appends/modifies an existing attribute set in order to run scripts/setup if needed,
|
||||
# as well as define STATUS_REACT_HOME
|
||||
#
|
||||
|
||||
|
@ -17,7 +17,7 @@ let
|
||||
# TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib)
|
||||
stdenv = pkgs.stdenvNoCC;
|
||||
maven = pkgs.maven;
|
||||
baseGo = pkgs.go_1_12;
|
||||
baseGo = pkgs.go_1_13;
|
||||
go = pkgs.callPackage ./patched-go { inherit baseGo; };
|
||||
buildGoPackage = pkgs.buildGoPackage.override { inherit go; };
|
||||
desktop = pkgs.callPackage ./desktop { inherit target-os stdenv status-go pkgs go nodejs; inherit (pkgs) darwin; };
|
||||
@ -37,7 +37,9 @@ let
|
||||
|
||||
# TARGETS
|
||||
leiningen-shell = mkShell {
|
||||
buildInputs = with pkgs; [ clojure leiningen flock maven nodejs openjdk ];
|
||||
buildInputs = with pkgs; [
|
||||
clojure leiningen flock maven nodejs openjdk
|
||||
] ++ optional isDarwin pkgs.cocoapods;
|
||||
shellHook =
|
||||
if target-os == "android" then mobile.android.shellHook else
|
||||
if target-os == "ios" then mobile.ios.shellHook else "";
|
||||
@ -60,9 +62,9 @@ in {
|
||||
|
||||
shell = {
|
||||
buildInputs = unique ([
|
||||
yarn
|
||||
nodejs
|
||||
pkgs.python27 # for e.g. gyp
|
||||
yarn
|
||||
] ++ optional isDarwin pkgs.cocoapods
|
||||
++ optional (isDarwin && !platform.targetIOS) pkgs.clang
|
||||
++ optional (!isDarwin) pkgs.gcc8
|
||||
|
@ -10,18 +10,18 @@ let
|
||||
|
||||
androidComposition = androidenv.composeAndroidPackages {
|
||||
toolsVersion = "26.1.1";
|
||||
platformToolsVersion = "28.0.2";
|
||||
buildToolsVersions = [ "28.0.3" ];
|
||||
platformToolsVersion = "29.0.5";
|
||||
buildToolsVersions = [ "29.0.2" ];
|
||||
includeEmulator = false;
|
||||
platformVersions = [ "28" ];
|
||||
platformVersions = [ "29" ];
|
||||
includeSources = false;
|
||||
includeDocs = false;
|
||||
includeSystemImages = false;
|
||||
systemImageTypes = [ "default" ];
|
||||
lldbVersions = [ "2.0.2558144" ];
|
||||
cmakeVersions = [ "3.6.4111459" ];
|
||||
lldbVersions = [ "3.1.4508709" ];
|
||||
cmakeVersions = [ "3.10.2" ];
|
||||
includeNDK = true;
|
||||
ndkVersion = "19.2.5345600";
|
||||
ndkVersion = "21.0.5935234";
|
||||
useGoogleAPIs = false;
|
||||
useGoogleTVAddOns = false;
|
||||
includeExtras = [ "extras;android;m2repository" "extras;google;m2repository" ];
|
||||
@ -59,4 +59,4 @@ let
|
||||
|
||||
in {
|
||||
inherit androidComposition licensedAndroidEnv shellHook;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ in {
|
||||
${concatStrings (catAttrs "shellHook" [ mavenAndNpmDeps androidEnv ])}
|
||||
|
||||
$STATUS_REACT_HOME/scripts/generate-keystore.sh
|
||||
|
||||
$STATUS_REACT_HOME/nix/mobile/reset-node_modules.sh "${mavenAndNpmDeps.deriv}/project" || exit
|
||||
'';
|
||||
|
||||
|
@ -5,7 +5,6 @@ let
|
||||
inherit (stdenv.lib) optionals optionalString unique;
|
||||
|
||||
platform = callPackage ../../platform.nix { inherit target-os; };
|
||||
useFastlanePkg = platform.targetAndroid && !stdenv.isDarwin;
|
||||
fastlane = callPackage ../../../fastlane {
|
||||
bundlerEnv = _:
|
||||
bundlerEnv {
|
||||
@ -17,17 +16,17 @@ let
|
||||
bundler
|
||||
ruby
|
||||
]; # bundler/ruby used for fastlane on macOS
|
||||
shellHook = optionalString useFastlanePkg fastlane.shellHook;
|
||||
inherit (fastlane) shellHook;
|
||||
|
||||
# TARGETS
|
||||
shell = mkShell {
|
||||
buildInputs = if useFastlanePkg then [ fastlane curl ] else bundlerDeps;
|
||||
buildInputs = [ fastlane curl ] ++ bundlerDeps;
|
||||
inherit shellHook;
|
||||
};
|
||||
|
||||
in {
|
||||
# We only include bundler in regular shell if targetting iOS, because that's how the CI builds the whole project
|
||||
buildInputs = unique (optionals (!useFastlanePkg && platform.targetIOS) bundlerDeps);
|
||||
# We only include bundler in regular shell if targetting iOS, because that's how the CI builds the whole project
|
||||
buildInputs = unique (optionals platform.targetIOS bundlerDeps);
|
||||
inherit shellHook;
|
||||
|
||||
# TARGETS
|
||||
|
@ -2,3 +2,4 @@
|
||||
substituters = https://nix-cache.status.im/ https://cache.nixos.org/
|
||||
trusted-public-keys = nix-cache.status.im-1:x/93lOfLU+duPplwMSBR+OlY4+mo+dCN7n0mr4oPwgY= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-cache-cn.status.im:WUiOoTQQurm+rEL/yuAuU/a3TViDtMM9DCMgMx/KkOw=
|
||||
connect-timeout = 10
|
||||
max-jobs = auto
|
||||
|
@ -6,8 +6,8 @@ let
|
||||
name = "nixpkgs-source";
|
||||
owner = "status-im";
|
||||
repo = "nixpkgs";
|
||||
rev = "f54e1c6441868450e947f6171b129dfb90a91653";
|
||||
sha256 = "13cf3pi277ifg57l11kmjk08vrpv6km2jfxq7sp63zxw5bgkiqpd";
|
||||
rev = "d9b2c6b8add87098adb8ee34042e39d15f3658c4";
|
||||
sha256 = "19wnp97nlkyd825pjd9vm9rngy3gcil9bwqncwscivsmaz5c7l37";
|
||||
# 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.
|
||||
|
@ -28,6 +28,8 @@ let
|
||||
in ''
|
||||
pushd "$NIX_BUILD_TOP/go/src/${goPackagePath}" >/dev/null
|
||||
|
||||
export GO111MODULE=off
|
||||
|
||||
go build -o $out/${outputFileName} \
|
||||
${goBuildFlags} \
|
||||
-buildmode=c-archive \
|
||||
|
@ -31,10 +31,11 @@ let
|
||||
in with targetConfig; ''
|
||||
mkdir ${NIX_GOWORKDIR}
|
||||
|
||||
GOPATH=${gomobile.dev}:$GOPATH \
|
||||
PATH=${makeBinPath [ gomobile.bin ]}:$PATH \
|
||||
NIX_GOWORKDIR=${NIX_GOWORKDIR} \
|
||||
${concatStringsSep " " envVars} \
|
||||
export GO111MODULE=off
|
||||
export GOPATH=${gomobile.dev}:$GOPATH
|
||||
export PATH=${makeBinPath [ gomobile.bin ]}:$PATH
|
||||
export NIX_GOWORKDIR=${NIX_GOWORKDIR}
|
||||
export ${concatStringsSep " " envVars}
|
||||
gomobile bind \
|
||||
-target=${name} \
|
||||
-ldflags='${CGO_LDFLAGS}' \
|
||||
|
@ -21,7 +21,7 @@ let
|
||||
pname = repo;
|
||||
version = "${version}-${strings.substring 0 7 rev}-${host}";
|
||||
|
||||
nativeBuildInputs =
|
||||
nativeBuildInputs =
|
||||
nativeBuildInputs ++
|
||||
lib.optional isDarwin xcodeWrapper;
|
||||
|
||||
@ -53,11 +53,9 @@ let
|
||||
'';
|
||||
|
||||
# replace hardcoded paths to go package in /nix/store, otherwise Nix will fail the build
|
||||
preFixup = ''
|
||||
${preFixup}
|
||||
|
||||
preFixup = preFixup + ''
|
||||
find $out -type f -exec ${removeExpr removeReferences} '{}' + || true
|
||||
return
|
||||
return # make sure we stop fixup so as to not allow the host preFixup script to proceed
|
||||
'';
|
||||
|
||||
passthru = { inherit owner version rev; };
|
||||
|
27
shell.nix
27
shell.nix
@ -17,24 +17,15 @@ let
|
||||
stdenv = pkgs.stdenvNoCC;
|
||||
# those should always be present in a shell
|
||||
coreInputs = with pkgs; [
|
||||
# utilities
|
||||
bash
|
||||
curl
|
||||
file
|
||||
flock
|
||||
git
|
||||
gnumake
|
||||
jq
|
||||
wget
|
||||
bash curl file flock git gnumake jq wget
|
||||
];
|
||||
|
||||
in mkShell {
|
||||
name = "status-react-shell";
|
||||
# none means we shouldn't include project specific deps
|
||||
buildInputs = if target-os == "none" then
|
||||
coreInputs
|
||||
else
|
||||
with pkgs; [
|
||||
buildInputs =
|
||||
coreInputs ++
|
||||
stdenv.lib.optionals (target-os != "none") (with pkgs; [
|
||||
unzip
|
||||
ncurses
|
||||
lsof # used in scripts/start-react-native.sh
|
||||
@ -43,12 +34,6 @@ in mkShell {
|
||||
leiningen
|
||||
maven
|
||||
watchman
|
||||
] ++ coreInputs;
|
||||
|
||||
inputsFrom = if target-os == "none" then
|
||||
[]
|
||||
else
|
||||
[ project.shell ];
|
||||
|
||||
shellHook = project.shell.shellHook;
|
||||
]);
|
||||
inputsFrom = stdenv.lib.optional (target-os != "none") project.shell;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.34.0-beta.8",
|
||||
"commit-sha1": "9d7c570593b1f88e9688204d8e1041d57b98da1f",
|
||||
"src-sha256": "1kwxf0h80vdj493c7s3lpmdjpbc72plbll0rj1vv7kzf8a84ff2k"
|
||||
"version": "v0.35.0",
|
||||
"commit-sha1": "2dd74da23d9fcca116e02a2a35d964172c98ffdf",
|
||||
"src-sha256": "16zb6a5svh7hqm77jnsf5dyrl173mvddd6rxhmvcs6prblg4j7f8"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user