nix: fix order of iOS shell components
Possible fix for errors like: ``` bundler: failed to load command: fastlane (/Users/jenkins/.bundle/ruby/2.7.0/bin/fastlane) /Users/jenkins/.bundle/ruby/2.7.0/gems/fastlane-2.205.2/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': [!] Shell command exited with exit status 51 instead of 0. (FastlaneCore::Interface::FastlaneShellError) ``` Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
badf72af9f
commit
ca8b721135
|
@ -1,14 +1,15 @@
|
||||||
{ callPackage, lib, mkShell, deps, pkgs
|
{ callPackage, lib, mkShell, pkgs
|
||||||
, status-go, fastlane }:
|
, status-go, fastlane }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) catAttrs unique;
|
inherit (lib) catAttrs unique;
|
||||||
|
|
||||||
pod-shell = callPackage ./pod-shell.nix { };
|
nodejs-sh = callPackage ./shells/nodejs.nix { };
|
||||||
status-go-shell = callPackage ./status-go-shell.nix { inherit status-go; };
|
cocoapods-sh = callPackage ./shells/pod.nix { };
|
||||||
|
status-go-sh = callPackage ./shells/status-go.nix { inherit status-go; };
|
||||||
|
|
||||||
in {
|
in {
|
||||||
inherit pod-shell status-go-shell;
|
inherit nodejs-sh cocoapods-sh status-go-sh;
|
||||||
|
|
||||||
shell = mkShell {
|
shell = mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
|
@ -19,14 +20,9 @@ in {
|
||||||
# WARNING: Executes shellHook in reverse order.
|
# WARNING: Executes shellHook in reverse order.
|
||||||
inputsFrom = [
|
inputsFrom = [
|
||||||
fastlane.shell
|
fastlane.shell
|
||||||
pod-shell
|
cocoapods-sh
|
||||||
status-go-shell # Needs to run before pod-install
|
nodejs-sh # before 'pod install'
|
||||||
|
status-go-sh # before 'pod install'
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
|
||||||
# check if node modules changed and if so install them
|
|
||||||
./nix/scripts/node_modules.sh "${deps.nodejs-patched}"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ mkShell, deps }:
|
||||||
|
|
||||||
|
mkShell {
|
||||||
|
# check if node modules changed and if so install them
|
||||||
|
shellHook = ''
|
||||||
|
export STATUS_MOBILE_HOME=$(git rev-parse --show-toplevel)
|
||||||
|
"$STATUS_MOBILE_HOME/nix/scripts/node_modules.sh" ${deps.nodejs-patched}
|
||||||
|
'';
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ mkShell, cocoapods }:
|
||||||
|
|
||||||
|
let
|
||||||
|
# source of what pod should install
|
||||||
|
podfileLock = "ios/Podfile.lock";
|
||||||
|
# current state of pods installed by pod
|
||||||
|
manifestLock = "ios/Pods/Manifest.lock";
|
||||||
|
in mkShell {
|
||||||
|
buildInputs = [ cocoapods ];
|
||||||
|
shellHook = ''
|
||||||
|
pushd "$STATUS_MOBILE_HOME" > /dev/null
|
||||||
|
{
|
||||||
|
echo "Checking for modifications in ios/Pods..."
|
||||||
|
if diff -q ${podfileLock} ${manifestLock}; then
|
||||||
|
echo "No modifications detected."
|
||||||
|
else
|
||||||
|
# CocoaPods are trash and can't handle other pod instances running
|
||||||
|
./scripts/wait-for.sh 240 'pod install'
|
||||||
|
(cd ios && pod install)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
popd > /dev/null
|
||||||
|
'';
|
||||||
|
}
|
|
@ -13,23 +13,18 @@ let
|
||||||
default = callPackage ./shell.nix { };
|
default = callPackage ./shell.nix { };
|
||||||
|
|
||||||
# Combines with many other shells
|
# Combines with many other shells
|
||||||
node-sh = mkShell {
|
nodejs-sh = targets.mobile.ios.nodejs-sh;
|
||||||
shellHook = ''
|
|
||||||
export STATUS_MOBILE_HOME=$(git rev-parse --show-toplevel)
|
|
||||||
"$STATUS_MOBILE_HOME/nix/scripts/node_modules.sh" ${pkgs.deps.nodejs-patched}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# An attrset for easier merging with default shell
|
# An attrset for easier merging with default shell
|
||||||
shells = {
|
shells = {
|
||||||
inherit default;
|
inherit default;
|
||||||
|
|
||||||
nodejs = node-sh;
|
nodejs = nodejs-sh;
|
||||||
|
|
||||||
# for calling clojure targets in CI or Makefile
|
# for calling clojure targets in CI or Makefile
|
||||||
clojure = mkShell {
|
clojure = mkShell {
|
||||||
buildInputs = with pkgs; [ clojure flock maven openjdk ];
|
buildInputs = with pkgs; [ clojure flock maven openjdk ];
|
||||||
inputsFrom = [ node-sh ];
|
inputsFrom = [ nodejs-sh ];
|
||||||
# CLASSPATH from clojure deps with 'src' appended to find local sources.
|
# CLASSPATH from clojure deps with 'src' appended to find local sources.
|
||||||
shellHook = with pkgs; ''
|
shellHook = with pkgs; ''
|
||||||
export CLASS_PATH="$(find ${deps.clojure} -iname '*.jar' | tr '\n' ':')src"
|
export CLASS_PATH="$(find ${deps.clojure} -iname '*.jar' | tr '\n' ':')src"
|
||||||
|
@ -47,7 +42,7 @@ let
|
||||||
# for running gradle by hand
|
# for running gradle by hand
|
||||||
gradle = mkShell {
|
gradle = mkShell {
|
||||||
buildInputs = with pkgs; [ gradle maven goMavenResolver ];
|
buildInputs = with pkgs; [ gradle maven goMavenResolver ];
|
||||||
inputsFrom = [ node-sh ];
|
inputsFrom = [ nodejs-sh ];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export STATUS_GO_ANDROID_LIBDIR="DUMMY"
|
export STATUS_GO_ANDROID_LIBDIR="DUMMY"
|
||||||
export STATUS_NIX_MAVEN_REPO="${pkgs.deps.gradle}"
|
export STATUS_NIX_MAVEN_REPO="${pkgs.deps.gradle}"
|
||||||
|
|
Loading…
Reference in New Issue