Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: various macos issues #125

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[target.x86_64-apple-darwin]
rustflags = [
"-L", "/opt/homebrew/lib",
"-L", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib",
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-apple-darwin]
rustflags = [
"-L", "/opt/homebrew/lib",
"-L", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib",
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
2 changes: 0 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
name: Test
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: actions/checkout@v3
with:
repository: 'near/pagoda-relayer-rs-fastauth'
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
name: Test
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -36,8 +34,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ RUN apt-get update \
RUN echo "fn main() {}" > dummy.rs
COPY mpc-recovery/Cargo.toml Cargo.toml
RUN sed -i 's#src/main.rs#dummy.rs#' Cargo.toml
RUN sed -i 's#mpc-recovery-gcp = { path = "../mpc-recovery-gcp" }##' Cargo.toml
RUN cargo build --release
COPY . .
RUN cargo build --release --package mpc-recovery

FROM debian:buster-slim as runtime
FROM debian:bullseye-slim as runtime
RUN apt-get update && apt-get install --assume-yes libssl-dev ca-certificates
RUN update-ca-certificates
COPY --from=builder /usr/src/app/target/release/mpc-recovery /usr/local/bin/mpc-recovery
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,9 @@ Internally, we are identifying users by their issuer id (iss) and their unique I

### Contribute

In order to build the project, you will need to have `protoc` installed and execute the following:
In order to build the project, you will need to have `protoc` and `gmp` installed. Refer to your system's package manager on how to do this.

```BASH
# init submodules
git submodule update --init --recursive
```

alternatively if you have [nix](https://nixos.org/) and [direnv](https://direnv.net/) installed, you can set up a development environment by running:
If you have [nix](https://nixos.org/) and [direnv](https://direnv.net/) installed, you can set up a development environment by running:

```BASH
direnv allow
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ where
.await?;

// Wait until all nodes initialize
tokio::time::sleep(Duration::from_millis(2000)).await;
tokio::time::sleep(Duration::from_millis(10000)).await;

let result = f(TestContext {
leader_node: &leader_node,
Expand Down
9 changes: 0 additions & 9 deletions mpc-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ edition = "2021"
name = "mpc-recovery"
path = "src/main.rs"

# We have encountered issue with linking GMP on ARM macos machines. This is a temporary fix that
# replaces GMP implementation with num-bigint.
# [target.'cfg(macos)'.dependencies]
# curv = { package = "curv-kzen", version = "0.9", default-features = false, features = ["num-bigint"] }
# multi-party-eddsa = { git = "https://github.com/ZenGo-X/multi-party-eddsa.git", default-features = false }

# [target.'cfg(unix)'.dependencies]
# multi-party-eddsa = { git = "https://github.com/ZenGo-X/multi-party-eddsa.git" }

[dependencies]
actix-rt = "2.8"
anyhow = "1"
Expand Down
2 changes: 2 additions & 0 deletions mpc-recovery/src/gcp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl GcpService {
read_options: None,
database_id: Some("".to_string()),
};
tracing::debug!(?request);
let (_, response) = self
.datastore
.projects()
Expand Down Expand Up @@ -138,6 +139,7 @@ impl GcpService {
single_use_transaction: None,
transaction: None,
};
tracing::debug!(?request);
let (_, response) = self
.datastore
.projects()
Expand Down