Skip to content

Commit

Permalink
Merge branch 'main' into fix/rn-build-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwhitehead authored Nov 9, 2023
2 parents 46bd4bd + 27ddf9b commit 7a110b4
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 63 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ jobs:
run: |
if [ -n "${{ matrix.use_cross }}" ]; then
cargo install --bins --git https://github.com/rust-embedded/cross --tag v${{ env.CROSS_VERSION }} cross
# Required for compatibility with manylinux2014.
# https://github.com/briansmith/ring/issues/1728
if [ "${{ matrix.architecture }}" = "linux-aarch64" ]; then
export CFLAGS="-D__ARM_ARCH=8"
fi
cross build --lib --release --target ${{ matrix.target }}
elif [ "${{ matrix.architecture }}" == "darwin-universal" ]; then
./build-universal.sh
Expand Down Expand Up @@ -427,6 +432,11 @@ jobs:
- name: Build
run: |
cargo install --bins --git https://github.com/rust-embedded/cross --tag v${{ env.CROSS_VERSION }} cross
# Required for compatibility with manylinux2014:
# https://github.com/briansmith/ring/issues/1728
if [ "${{ matrix.target }}" = "aarch64-linux-android" ]; then
export CFLAGS="-D__ARM_ARCH=8"
fi
cross build --lib --release --target ${{matrix.target}}
- name: Upload artifacts
Expand Down
3 changes: 3 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build.env]
passthrough = ["CFLAGS"]

[target.aarch64-unknown-linux-gnu]
image = "ghcr.io/rust-cross/manylinux2014-cross:aarch64"

Expand Down
12 changes: 12 additions & 0 deletions wrappers/javascript/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ module.exports = {
],
},
overrides: [
{
files: ['**/scripts/*.js'],
env: {
node: true,
},
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'no-console': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
},
},
{
files: ['.eslintrc.js', 'babel.config.js'],
env: {
Expand Down
6 changes: 3 additions & 3 deletions wrappers/javascript/aries-askar-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/aries-askar-nodejs",
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"license": "Apache-2.0",
"description": "Nodejs wrapper for Aries Askar",
"source": "src/index",
Expand Down Expand Up @@ -31,7 +31,7 @@
"example": "yarn --cwd example",
"release": "release-it",
"test": "jest",
"install": "node-pre-gyp install --target_arch=$(node scripts/arch.js) --target_platform=$(node scripts/platform.js)"
"install": "node scripts/install.js"
},
"devDependencies": {
"@types/jest": "^27.4.1",
Expand All @@ -48,7 +48,7 @@
"dependencies": {
"@2060.io/ffi-napi": "4.0.8",
"@2060.io/ref-napi": "3.0.6",
"@hyperledger/aries-askar-shared": "0.2.0-dev.1",
"@hyperledger/aries-askar-shared": "0.2.0-dev.2",
"@mapbox/node-pre-gyp": "^1.0.10",
"node-cache": "^5.1.2",
"ref-array-di": "^1.2.2",
Expand Down
27 changes: 0 additions & 27 deletions wrappers/javascript/aries-askar-nodejs/scripts/arch.js

This file was deleted.

15 changes: 15 additions & 0 deletions wrappers/javascript/aries-askar-nodejs/scripts/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { execSync } = require('node:child_process')
const { arch, platform: osPlatform } = require('os')

const archTable = {
x64: 'x86_64',
arm64: 'aarch64',
}

const platform = osPlatform()
const targetPlatform = platform === 'win32' ? 'windows' : platform
const targetArchitecture = platform == 'darwin' ? 'universal' : archTable[arch]

const command = `node-pre-gyp install --target_arch=${targetArchitecture} --target_platform=${targetPlatform}`

execSync(command)
13 changes: 0 additions & 13 deletions wrappers/javascript/aries-askar-nodejs/scripts/platform.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <fbjni/fbjni.h>
#include <ReactCommon/CallInvokerHolder.h>

#include <turboModuleUtility.h>
#include "turboModuleUtility.h"

using namespace facebook;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <HostObject.h>
#include <algorithm>
#include <vector>

#include "HostObject.h"

AriesAskarTurboModuleHostObject::AriesAskarTurboModuleHostObject(
jsi::Runtime &rt) {
return;
Expand Down
5 changes: 2 additions & 3 deletions wrappers/javascript/aries-askar-react-native/cpp/HostObject.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#pragma once

#include <jsi/jsi.h>

#include <map>

#include <ariesAskar.h>
#include <turboModuleUtility.h>
#include "ariesAskar.h"
#include "turboModuleUtility.h"

using namespace facebook;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <ariesAskar.h>

#include <include/libaries_askar.h>
#include "ariesAskar.h"
#include "include/libaries_askar.h"

using namespace ariesAskarTurboModuleUtility;

Expand Down
4 changes: 2 additions & 2 deletions wrappers/javascript/aries-askar-react-native/cpp/ariesAskar.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <jsi/jsi.h>

#include <include/libaries_askar.h>
#include <turboModuleUtility.h>
#include "include/libaries_askar.h"
#include "turboModuleUtility.h"

using namespace facebook;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <vector>

#include <turboModuleUtility.h>
#include "turboModuleUtility.h"

namespace ariesAskarTurboModuleUtility {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <ReactCommon/CallInvoker.h>
#include <jsi/jsi.h>

#include <HostObject.h>
#include <include/libaries_askar.h>
#include "HostObject.h"
#include "include/libaries_askar.h"

using namespace facebook;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#import "turboModuleUtility.h"

#import "AriesAskar.h"
#import <React/RCTBridge+Private.h>
#import <jsi/jsi.h>
#import <React/RCTUtils.h>
#import <ReactCommon/RCTTurboModule.h>

#import "turboModuleUtility.h"
#import "AriesAskar.h"

using namespace facebook;

@implementation AriesAskar
Expand Down
4 changes: 2 additions & 2 deletions wrappers/javascript/aries-askar-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/aries-askar-react-native",
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"license": "Apache-2.0",
"description": "React Native wrapper for Aries Askar",
"main": "build/index",
Expand Down Expand Up @@ -35,7 +35,7 @@
"install": "node-pre-gyp install"
},
"dependencies": {
"@hyperledger/aries-askar-shared": "0.2.0-dev.1",
"@hyperledger/aries-askar-shared": "0.2.0-dev.2",
"@mapbox/node-pre-gyp": "^1.0.10"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/javascript/aries-askar-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/aries-askar-shared",
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"license": "Apache-2.0",
"description": "Shared library for using Aries Askar with NodeJS and React Native",
"main": "build/index",
Expand Down
2 changes: 1 addition & 1 deletion wrappers/javascript/lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.0-dev.1",
"version": "0.2.0-dev.2",
"npmClient": "yarn",
"command": {
"version": {
Expand Down

0 comments on commit 7a110b4

Please sign in to comment.