Skip to content

Commit

Permalink
Remove tx5 patches
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed May 27, 2024
1 parent 293bfe0 commit 62a634a
Show file tree
Hide file tree
Showing 21 changed files with 257 additions and 320 deletions.
37 changes: 12 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
members = ["crates/*"]
resolver = "2"

[patch.crates-io]
# TODO: remove these patches once https://github.com/holochain/tx5/issues/87 is resolved
tx5-go-pion-sys = { git = "https://github.com/guillemcordoba/tx5", branch = "custom-go" }
tx5-go-pion-turn = { git = "https://github.com/guillemcordoba/tx5", branch = "custom-go" }
2 changes: 2 additions & 0 deletions crates/scaffold-holochain-runtime/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/bash
set -e

DIR=$(pwd)

rm -rf /tmp/test-scaffold-holochain-runtime

nix run --accept-flake-config .#scaffold-holochain-runtime -- --name test-scaffold-holochain-runtime --path /tmp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tauri = { version = "2.0.0-beta", features = [] }
tauri-plugin-holochain = { git = "https://github.com/darksoil-studio/p2p-shipyard", branch = "main" }
holochain_types = { version = "0.3.1-rc" }
lair_keystore = { version = "0.4.0" }
holochain_client = { version = "0.5.0-rc.1" }
holochain_client = { version = "0.5.0-rc" }
log = "0.4"
tauri-plugin-log = "2.0.0-beta"
url2 = "0.0.6"
Expand Down
10 changes: 1 addition & 9 deletions crates/scaffold-tauri-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,15 +506,7 @@ export default defineConfig({

assert_eq!(
file_content(&repo, PathBuf::from("Cargo.toml").as_path()).unwrap(),
r#"[patch.crates-io.tx5-go-pion-sys]
branch = "custom-go"
git = "https://github.com/guillemcordoba/tx5"
[patch.crates-io.tx5-go-pion-turn]
branch = "custom-go"
git = "https://github.com/guillemcordoba/tx5"
[profile.dev]
r#"[profile.dev]
opt-level = "z"
[profile.release]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tauri-plugin-holochain = { git = "https://github.com/darksoil-studio/p2p-shipyar
holochain_types = { version = "0.3.1-rc" }
lair_keystore = { version = "0.4.0" }

holochain_client = { version = "0.5.0-rc.1" }
holochain_client = { version = "0.5.0-rc" }

log = "0.4"
tauri-plugin-log = "2.0.0-beta"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn run() {
//
// You can modify this function to suit your needs if they become more complex
async fn setup(handle: AppHandle) -> anyhow::Result<()> {
let mut admin_ws = handle.holochain()?.admin_websocket().await?;
let admin_ws = handle.holochain()?.admin_websocket().await?;

let installed_apps = admin_ws
.list_apps(None)
Expand Down
15 changes: 1 addition & 14 deletions crates/tauri-plugin-holochain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lair_keystore = "0.4.0"
lair_keystore_api = "0.4.0"

# Holochain client
holochain_client = { version = "0.5.0-rc.1" }
holochain_client = { version = "0.5.0-rc.2" }

serde_json = "1"
sha256 = "1"
Expand Down Expand Up @@ -54,16 +54,3 @@ one_err = "0"
[build-dependencies]
tauri-plugin = { version = "2.0.0-beta", features = ["build"] }

# [patch.crates-io]
# mr_bundle = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holochain = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holochain_types = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holochain_keystore = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holochain_conductor_api = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holochain_nonce = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# kitsune_p2p_timestamp = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holochain_integrity_types = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holochain_zome_types = {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}
# holo_hash= {git ="https://github.com/guillemcordoba/holochain", branch ="lair-startup-timing"}

# holochain_client = {git ="https://github.com/guillemcordoba/holochain-client-rust", branch ="develop"}
6 changes: 3 additions & 3 deletions crates/tauri-plugin-holochain/src/commands/install_web_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use mr_bundle::{error::MrBundleError, Bundle, ResourceBytes};
use crate::filesystem::FileSystemError;

pub async fn install_web_app(
admin_ws: &mut AdminWebsocket,
admin_ws: &AdminWebsocket,
app_id: String,
bundle: WebAppBundle,
membrane_proofs: HashMap<RoleName, MembraneProof>,
Expand All @@ -39,7 +39,7 @@ pub async fn install_web_app(
}

pub async fn install_app(
admin_ws: &mut AdminWebsocket,
admin_ws: &AdminWebsocket,
app_id: String,
bundle: AppBundle,
membrane_proofs: HashMap<RoleName, MembraneProof>,
Expand Down Expand Up @@ -108,7 +108,7 @@ pub enum UpdateAppError {
}

pub async fn update_app(
admin_ws: &mut AdminWebsocket,
admin_ws: &AdminWebsocket,
app_id: String,
bundle: AppBundle,
) -> Result<(), UpdateAppError> {
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-plugin-holochain/src/commands/list_apps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tauri::{command, AppHandle, Runtime};

#[command]
pub(crate) async fn list_apps<R: Runtime>(app: AppHandle<R>) -> crate::Result<Vec<AppInfo>> {
let mut admin_ws = app.holochain()?.admin_websocket().await?;
let admin_ws = app.holochain()?.admin_websocket().await?;

let apps = admin_ws
.list_apps(None)
Expand Down
14 changes: 7 additions & 7 deletions crates/tauri-plugin-holochain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl<R: Runtime> HolochainPlugin<R> {
return Ok(app_websocket_auth.clone());
}

let mut admin_ws = self.admin_websocket().await?;
let admin_ws = self.admin_websocket().await?;

// Allow any when the app is build in debug mode to allow normal tauri development pointing to http://localhost:1420
let allowed_origins = if cfg!(debug_assertions) {
Expand Down Expand Up @@ -298,9 +298,9 @@ impl<R: Runtime> HolochainPlugin<R> {
.store_web_happ_bundle(app_id.clone(), &web_app_bundle)
.await?;

let mut admin_ws = self.admin_websocket().await?;
let admin_ws = self.admin_websocket().await?;
let app_info = install_web_app(
&mut admin_ws,
&admin_ws,
app_id.clone(),
web_app_bundle,
membrane_proofs,
Expand All @@ -326,15 +326,15 @@ impl<R: Runtime> HolochainPlugin<R> {
membrane_proofs: HashMap<RoleName, MembraneProof>,
network_seed: Option<NetworkSeed>,
) -> crate::Result<AppInfo> {
let mut admin_ws = self.admin_websocket().await?;
let admin_ws = self.admin_websocket().await?;

self.holochain_runtime
.filesystem
.bundle_store
.store_happ_bundle(app_id.clone(), &app_bundle)?;

let app_info = install_app(
&mut admin_ws,
&admin_ws,
app_id.clone(),
app_bundle,
membrane_proofs,
Expand All @@ -361,12 +361,12 @@ impl<R: Runtime> HolochainPlugin<R> {
.store_web_happ_bundle(app_id.clone(), &web_app_bundle)
.await?;

let mut admin_ws = self
let admin_ws = self
.admin_websocket()
.await
.map_err(|_err| UpdateAppError::WebsocketError)?;
update_app(
&mut admin_ws,
&admin_ws,
app_id.clone(),
web_app_bundle.happ_bundle().await?,
)
Expand Down
4 changes: 2 additions & 2 deletions custom-go-compiler.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@

packages.custom-go-compiler = let
go = lib.overrideDerivation pkgs.go_1_21 (attrs: rec {
name = "go-${version}-dev";
version = "1.21";
name = "custom-go-${version}-dev";
src = let
gitSrc = pkgs.fetchgit {
url = "https://github.com/wlynxg/go";
Expand All @@ -73,7 +73,7 @@
cp -R . $out
ls $out
echo "${version}" > $out/VERSION
echo "go${version}" > $out/VERSION
'';
in finalGo;
buildInputs = with pkgs; [ pcre git ];
Expand Down
Loading

0 comments on commit 62a634a

Please sign in to comment.