Skip to content

Commit

Permalink
Merge branch 'develop' into 16247
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Jun 20, 2023
2 parents 618aeec + 66cd3ed commit c594c7f
Show file tree
Hide file tree
Showing 30 changed files with 658 additions and 211 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
*.shadow-cljs
modules
result
target
component-spec
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export NODE_OPTIONS += --openssl-legacy-provider
export KEYSTORE_PATH ?= $(HOME)/.gradle/status-im.keystore

# Our custom config is located in nix/nix.conf
export NIX_CONF_DIR = $(PWD)/nix
export NIX_USER_CONF_FILES = $(PWD)/nix/nix.conf
# Location of symlinks to derivations that should not be garbage collected
export _NIX_GCROOTS = /nix/var/nix/gcroots/per-user/$(USER)/status-mobile
# Defines which variables will be kept for Nix pure shell, use semicolon as divider
Expand Down Expand Up @@ -301,7 +301,7 @@ define find_all_clojure_files
$$(comm -23 <(sort <(git ls-files --cached --others --exclude-standard)) <(sort <(git ls-files --deleted)) | grep -e \.clj$$ -e \.cljs$$ -e \.cljc$$ -e \.edn)
endef

lint: export TARGET := default
lint: export TARGET := clojure
lint: ##@test Run code style checks
@sh scripts/lint-re-frame-in-quo-components.sh && \
clj-kondo --config .clj-kondo/config.edn --cache false --lint src && \
Expand All @@ -310,7 +310,7 @@ lint: ##@test Run code style checks
yarn prettier

# NOTE: We run the linter twice because of https://github.com/kkinnear/zprint/issues/271
lint-fix: export TARGET := default
lint-fix: export TARGET := clojure
lint-fix: ##@test Run code style checks and fix issues
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
Expand Down
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import org.apache.tools.ant.taskdefs.condition.Os
* Project-wide gradle configuration properties for use by all modules
*/
ext {
// kotlin_version is needed for react-native-camera-kit library
kotlin_version = project.kotlinVersion
RNNKotlinVersion = "1.6.20"
RNGH_kotlinVersion = "1.6.20"
buildToolsVersion = project.buildToolsVersion
Expand Down
29 changes: 17 additions & 12 deletions ci/tools/Jenkinsfile.nix-cache
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pipeline {
timestamps()
disableConcurrentBuilds()
/* Prevent Jenkins jobs from running forever */
timeout(time: 300, unit: 'MINUTES')
timeout(time: 120, unit: 'MINUTES')
/* Limit builds retained */
buildDiscarder(logRotator(
numToKeepStr: '20',
Expand All @@ -41,18 +41,19 @@ pipeline {
steps { script {
nix.shell('nix-env -i openssh', sandbox: false, pure: false)
/* some build targets don't build on MacOS */
uname = sh(script: 'uname', returnStdout: true)
os = sh(script: 'uname', returnStdout: true)
arch = sh(script: 'arch', returnStdout: true)
} }
}
stage('Build status-go') {
steps { script {
def platforms = ['mobile.android', 'mobile.ios']
if (uname != "Darwin") {
platforms.removeAll { it == "ios" }
}
def platforms = ['mobile.android', 'mobile.ios', 'library']
if (os != 'Darwin') { platforms.removeAll { it == 'mobile.ios' } }
/* FIXME: Remove this when #16237 is merged. */
if (arch == 'arm64') { platforms.removeAll { it == 'mobile.android' } }
platforms.each { os ->
nix.build(
attr: "targets.status-go.${os}.buildInputs",
attr: "targets.status-go.${os}",
sandbox: false,
link: false
)
Expand Down Expand Up @@ -83,12 +84,16 @@ pipeline {
}
stage('Build nix shell deps') {
steps { script {
def shells = ['android', 'ios', 'fastlane', 'keytool', 'clojure', 'gradle']
if (os != "Darwin") { shells.removeAll { it == 'ios' } }
/* Build/fetch deps required to start default Nix shell. */
nix.build(
attr: 'shells.default.buildInputs',
sandbox: false,
link: false
)
shells.each { shell ->
nix.build(
attr: "shells.${shell}.buildInputs",
sandbox: false,
link: false
)
}
} }
}
stage('Upload') {
Expand Down
18 changes: 9 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ PODS:
- React-Core
- react-native-blur (4.3.3):
- React-Core
- react-native-camera-kit (8.0.4):
- React
- react-native-cameraroll (4.0.4):
- React-Core
- react-native-config (1.5.0):
Expand Down Expand Up @@ -348,6 +346,8 @@ PODS:
- React-perflogger (= 0.69.10)
- ReactNativeAudioToolkit (2.0.3):
- React
- ReactNativeCameraKit (13.0.0):
- React-Core
- ReactNativeNavigation (7.27.1):
- HMSegmentedControl
- React-Core
Expand Down Expand Up @@ -421,7 +421,7 @@ PODS:
- React-RCTText
- ReactCommon/turbomodule/core
- Yoga
- RNShare (7.0.1):
- RNShare (8.2.2):
- React-Core
- RNStaticSafeAreaInsets (2.2.0):
- React-Core
Expand Down Expand Up @@ -473,7 +473,6 @@ DEPENDENCIES:
- react-native-background-timer (from `../node_modules/react-native-background-timer`)
- react-native-blob-util (from `../node_modules/react-native-blob-util`)
- "react-native-blur (from `../node_modules/@react-native-community/blur`)"
- react-native-camera-kit (from `../node_modules/react-native-camera-kit`)
- "react-native-cameraroll (from `../node_modules/@react-native-community/cameraroll`)"
- react-native-config (from `../node_modules/react-native-config`)
- react-native-image-resizer (from `../node_modules/react-native-image-resizer`)
Expand Down Expand Up @@ -501,6 +500,7 @@ DEPENDENCIES:
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "ReactNativeAudioToolkit (from `../node_modules/@react-native-community/audio-toolkit`)"
- ReactNativeCameraKit (from `../node_modules/react-native-camera-kit`)
- ReactNativeNavigation (from `../node_modules/react-native-navigation`)
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
Expand Down Expand Up @@ -590,8 +590,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-blob-util"
react-native-blur:
:path: "../node_modules/@react-native-community/blur"
react-native-camera-kit:
:path: "../node_modules/react-native-camera-kit"
react-native-cameraroll:
:path: "../node_modules/@react-native-community/cameraroll"
react-native-config:
Expand Down Expand Up @@ -646,6 +644,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon"
ReactNativeAudioToolkit:
:path: "../node_modules/@react-native-community/audio-toolkit"
ReactNativeCameraKit:
:path: "../node_modules/react-native-camera-kit"
ReactNativeNavigation:
:path: "../node_modules/react-native-navigation"
RNCAsyncStorage:
Expand Down Expand Up @@ -730,7 +730,6 @@ SPEC CHECKSUMS:
react-native-background-timer: 1f7d560647b40e6a60b01c452ba29c54bf581fc4
react-native-blob-util: 600972b1782380a5a7d5db61a3817ea32349dae9
react-native-blur: c6d0a1dc2b4b519f7afe3b14d8151998632b6d18
react-native-camera-kit: 498a6d111a904834e0824e9073cfadef7303235f
react-native-cameraroll: 88f4e62d9ecd0e1f253abe4f685474f2ea14bfa2
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-image-resizer: 2f1577efa3bc762597681f530c8e8d05ce0ceeb3
Expand Down Expand Up @@ -758,6 +757,7 @@ SPEC CHECKSUMS:
React-runtimeexecutor: 5ebf1ddaa706bf2986123f22d2cad905443c2c5f
ReactCommon: 65754b8932ea80272714988268bbfb9f303264a5
ReactNativeAudioToolkit: de9610f323e855ac6574be8c99621f3d57c5df06
ReactNativeCameraKit: 9d46a5d7dd544ca64aa9c03c150d2348faf437eb
ReactNativeNavigation: 94979dd1572a3f093fc85d4599360530a1bed8c8
RNCAsyncStorage: b2489b49e38c85e10ed45a888d13a2a4c7b32ea1
RNCClipboard: 8148e21ac347c51fd6cd4b683389094c216bb543
Expand All @@ -772,8 +772,8 @@ SPEC CHECKSUMS:
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
RNReactNativeHapticFeedback: 2566b468cc8d0e7bb2f84b23adc0f4614594d071
RNReanimated: 06a228c5a245ef7b5b03f0efc29d76ce4db9031c
RNShare: 2dc2fcac3f7321cfd6b60a23ed4bf4d549f86f5f
RNReanimated: 3e375fc41870cc66c5152a38514c450f7adbc3e1
RNShare: d82e10f6b7677f4b0048c23709bd04098d5aee6c
RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,17 @@ public void loginWithConfig(final String accountData, final String password, fin
}
}

@ReactMethod
public void loginAccount(final String request) {
Log.d(TAG, "loginAccount");
String result = Statusgo.loginAccount(request);
if (result.startsWith("{\"error\":\"\"")) {
Log.d(TAG, "loginAccount result: " + result);
} else {
Log.e(TAG, "loginAccount failed: " + result);
}
}

@ReactMethod
public void exportUnencryptedDatabase(final String accountData, final String password, final Callback callback) {
Log.d(TAG, "login");
Expand Down
8 changes: 8 additions & 0 deletions modules/react-native-status/ios/RCTStatus/RCTStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,14 @@ - (void) migrateKeystore:(NSString *)accountData
NSLog(@"%@", result);
}

RCT_EXPORT_METHOD(loginAccount:(NSString *)request) {
#if DEBUG
NSLog(@"LoginAccount() method called");
#endif
NSString *result = StatusgoLoginAccount(request);
NSLog(@"%@", result);
}

RCT_EXPORT_METHOD(loginWithKeycard:(NSString *)accountData
password:(NSString *)password
chatKey:(NSString *)chatKey) {
Expand Down
13 changes: 13 additions & 0 deletions nix/KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Known Issues

## Ignoring Untrusted Substituter on NixOS

When using our setup on NixOS users can see this warning:
```
warning: ignoring untrusted substituter 'https://nix-cache.status.im/', you are not a trusted user.
```
Which is due to incorrect `trusted-users` setting:
```
> grep trusted-users /etc/nix/nix.conf
trusted-users = root
```
Which can be extended using the [`nix.settings.trusted-users`](https://search.nixos.org/options?channel=23.05&show=nix.settings.trusted-users) option.

## Too many open files

### Single-User Installation
Expand Down
Loading

0 comments on commit c594c7f

Please sign in to comment.