fix: compile errors (#2310)

This commit is contained in:
Nathan.fooo 2023-04-21 17:02:26 +08:00 committed by GitHub
parent c009347735
commit 0068c7e731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 384 additions and 46 deletions

View File

@ -26,6 +26,7 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
706E045829F286F600B789F4 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 706E045729F286EC00B789F4 /* libc++.tbd */; };
D7360C6D6177708F7B2D3C9D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CD81A6C7244B2318E0BA2E8 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
@ -70,6 +71,7 @@
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
6DEEC7DEFA746DDF1338FF4D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
706E045729F286EC00B789F4 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
7D41C30A3910C3A40B6085E3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
@ -80,6 +82,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
706E045829F286F600B789F4 /* libc++.tbd in Frameworks */,
D7360C6D6177708F7B2D3C9D /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -165,6 +168,7 @@
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
706E045729F286EC00B789F4 /* libc++.tbd */,
1CD81A6C7244B2318E0BA2E8 /* Pods_Runner.framework */,
);
name = Frameworks;

View File

@ -220,6 +220,26 @@ dependencies = [
"serde",
]
[[package]]
name = "bindgen"
version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"
dependencies = [
"bitflags",
"cexpr",
"clang-sys",
"lazy_static",
"lazycell",
"peeking_take_while",
"proc-macro2",
"quote",
"regex",
"rustc-hash",
"shlex",
"syn 1.0.109",
]
[[package]]
name = "bit-set"
version = "0.5.3"
@ -390,6 +410,17 @@ dependencies = [
"serde",
]
[[package]]
name = "bzip2-sys"
version = "0.1.11+1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]]
name = "cairo-rs"
version = "0.15.12"
@ -429,6 +460,9 @@ name = "cc"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
dependencies = [
"jobserver",
]
[[package]]
name = "cesu8"
@ -436,6 +470,15 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom 7.1.3",
]
[[package]]
name = "cfb"
version = "0.6.1"
@ -507,6 +550,17 @@ dependencies = [
"phf_codegen 0.10.0",
]
[[package]]
name = "clang-sys"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "cmd_lib"
version = "1.3.0"
@ -576,7 +630,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#986737b4125162ae94dbeb6ece8267714f67b1dd"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"anyhow",
"bytes",
@ -594,7 +648,7 @@ dependencies = [
[[package]]
name = "collab-derive"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#986737b4125162ae94dbeb6ece8267714f67b1dd"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"proc-macro2",
"quote",
@ -606,7 +660,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#986737b4125162ae94dbeb6ece8267714f67b1dd"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"anyhow",
"collab",
@ -617,12 +671,13 @@ dependencies = [
"serde",
"serde_json",
"thiserror",
"tracing",
]
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#986737b4125162ae94dbeb6ece8267714f67b1dd"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"anyhow",
"collab",
@ -640,16 +695,20 @@ dependencies = [
[[package]]
name = "collab-persistence"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab#986737b4125162ae94dbeb6ece8267714f67b1dd"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"bincode",
"chrono",
"lazy_static",
"lib0",
"parking_lot 0.12.1",
"rocksdb",
"serde",
"sled",
"smallvec",
"thiserror",
"tokio",
"tracing",
"yrs",
]
@ -676,7 +735,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3"
dependencies = [
"lazy_static",
"nom",
"nom 5.1.2",
"serde",
"yaml-rust",
]
@ -1480,6 +1539,7 @@ dependencies = [
"serde_json",
"strum",
"strum_macros",
"tracing",
]
[[package]]
@ -2604,6 +2664,15 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]]
name = "jobserver"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
dependencies = [
"libc",
]
[[package]]
name = "js-sys"
version = "0.3.61"
@ -2642,6 +2711,12 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "lexical-core"
version = "0.7.6"
@ -2769,12 +2844,38 @@ version = "0.2.141"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
[[package]]
name = "libloading"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
dependencies = [
"cfg-if",
"winapi",
]
[[package]]
name = "libm"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
[[package]]
name = "librocksdb-sys"
version = "0.10.0+7.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b"
dependencies = [
"bindgen",
"bzip2-sys",
"cc",
"glob",
"libc",
"libz-sys",
"lz4-sys",
"zstd-sys",
]
[[package]]
name = "libsqlite3-sys"
version = "0.22.2"
@ -2786,6 +2887,17 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "libz-sys"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf"
dependencies = [
"cc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "line-wrap"
version = "0.1.1"
@ -2850,6 +2962,16 @@ dependencies = [
"tracing-subscriber 0.3.16",
]
[[package]]
name = "lz4-sys"
version = "1.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "mac"
version = "0.1.1"
@ -2951,6 +3073,12 @@ version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.6.2"
@ -3060,6 +3188,16 @@ dependencies = [
"version_check",
]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
@ -3344,6 +3482,12 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
[[package]]
name = "peeking_take_while"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
name = "percent-encoding"
version = "2.2.0"
@ -4025,6 +4169,16 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "rocksdb"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99"
dependencies = [
"libc",
"librocksdb-sys",
]
[[package]]
name = "rust_decimal"
version = "1.29.1"
@ -4059,6 +4213,12 @@ version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b"
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc_version"
version = "0.4.0"
@ -4374,6 +4534,12 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "shlex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
[[package]]
name = "signal-hook-registry"
version = "1.4.1"
@ -6096,3 +6262,14 @@ dependencies = [
"smallvec",
"thiserror",
]
[[package]]
name = "zstd-sys"
version = "2.0.8+zstd.1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c"
dependencies = [
"cc",
"libc",
"pkg-config",
]

View File

@ -33,10 +33,10 @@ default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]
[patch.crates-io]
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
#collab = { path = "../../AppFlowy-Collab/collab" }
#collab-folder = { path = "../../AppFlowy-Collab/collab-folder" }

View File

@ -249,6 +249,26 @@ dependencies = [
"serde",
]
[[package]]
name = "bindgen"
version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4"
dependencies = [
"bitflags",
"cexpr",
"clang-sys",
"lazy_static",
"lazycell",
"peeking_take_while",
"proc-macro2",
"quote",
"regex",
"rustc-hash",
"shlex",
"syn 1.0.109",
]
[[package]]
name = "bit-set"
version = "0.5.3"
@ -386,6 +406,17 @@ dependencies = [
"serde",
]
[[package]]
name = "bzip2-sys"
version = "0.1.11+1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]]
name = "cast"
version = "0.3.0"
@ -397,6 +428,18 @@ name = "cc"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
dependencies = [
"jobserver",
]
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom 7.1.3",
]
[[package]]
name = "cfg-if"
@ -441,6 +484,17 @@ dependencies = [
"phf_codegen",
]
[[package]]
name = "clang-sys"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "clap"
version = "2.34.0"
@ -490,7 +544,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#2493922c509a4d2862bc49a11f068917b0c5bb93"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"anyhow",
"bytes",
@ -508,7 +562,7 @@ dependencies = [
[[package]]
name = "collab-derive"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#2493922c509a4d2862bc49a11f068917b0c5bb93"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"proc-macro2",
"quote",
@ -520,7 +574,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#2493922c509a4d2862bc49a11f068917b0c5bb93"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"anyhow",
"collab",
@ -537,7 +591,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#2493922c509a4d2862bc49a11f068917b0c5bb93"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"anyhow",
"collab",
@ -555,12 +609,14 @@ dependencies = [
[[package]]
name = "collab-persistence"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?branch=main#2493922c509a4d2862bc49a11f068917b0c5bb93"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=fd64f5#fd64f5b9ccc40aa52eae34789133f39172259832"
dependencies = [
"bincode",
"chrono",
"lazy_static",
"lib0",
"parking_lot 0.12.1",
"rocksdb",
"serde",
"sled",
"smallvec",
@ -2240,6 +2296,15 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
[[package]]
name = "jobserver"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
dependencies = [
"libc",
]
[[package]]
name = "js-sys"
version = "0.3.61"
@ -2255,6 +2320,12 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "lexical-core"
version = "0.7.6"
@ -2382,12 +2453,38 @@ version = "0.2.141"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
[[package]]
name = "libloading"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
dependencies = [
"cfg-if",
"winapi",
]
[[package]]
name = "libm"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
[[package]]
name = "librocksdb-sys"
version = "0.10.0+7.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b"
dependencies = [
"bindgen",
"bzip2-sys",
"cc",
"glob",
"libc",
"libz-sys",
"lz4-sys",
"zstd-sys",
]
[[package]]
name = "libsqlite3-sys"
version = "0.22.2"
@ -2399,6 +2496,17 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "libz-sys"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf"
dependencies = [
"cc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "link-cplusplus"
version = "1.0.8"
@ -2439,6 +2547,16 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "lz4-sys"
version = "1.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "matchers"
version = "0.0.1"
@ -2775,6 +2893,12 @@ dependencies = [
"regex",
]
[[package]]
name = "peeking_take_while"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
name = "percent-encoding"
version = "2.2.0"
@ -3443,6 +3567,16 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "rocksdb"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99"
dependencies = [
"libc",
"librocksdb-sys",
]
[[package]]
name = "rust_decimal"
version = "1.29.1"
@ -3477,6 +3611,12 @@ version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b"
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc_version"
version = "0.4.0"
@ -3726,6 +3866,12 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "shlex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
[[package]]
name = "signal-hook-registry"
version = "1.4.1"
@ -4869,3 +5015,14 @@ dependencies = [
"smallvec",
"thiserror",
]
[[package]]
name = "zstd-sys"
version = "2.0.8+zstd.1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c"
dependencies = [
"cc",
"libc",
"pkg-config",
]

View File

@ -39,10 +39,10 @@ opt-level = 3
incremental = false
[patch.crates-io]
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", branch = "main" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "fd64f5" }
# collab = { path = "../AppFlowy-Collab/collab" }
# collab-folder = { path = "../AppFlowy-Collab/collab-folder" }

View File

@ -1,6 +1,6 @@
use std::sync::Arc;
use collab_persistence::CollabKV;
use collab_persistence::kv::rocks_kv::RocksCollabDB;
use flowy_database::manager::DatabaseManager;
use flowy_document2::manager::{DocumentManager as DocumentManager2, DocumentUser};
use flowy_error::FlowyError;
@ -10,7 +10,7 @@ pub struct Document2DepsResolver();
impl Document2DepsResolver {
pub fn resolve(
user_session: Arc<UserSession>,
database_manager: &Arc<DatabaseManager>,
_database_manager: &Arc<DatabaseManager>,
) -> Arc<DocumentManager2> {
let user: Arc<dyn DocumentUser> = Arc::new(DocumentUserImpl(user_session.clone()));
@ -34,7 +34,7 @@ impl DocumentUser for DocumentUserImpl {
.map_err(|e| FlowyError::internal().context(e))
}
fn kv_db(&self) -> Result<Arc<CollabKV>, FlowyError> {
fn kv_db(&self) -> Result<Arc<RocksCollabDB>, FlowyError> {
self.0.get_kv_db()
}
}

View File

@ -1,5 +1,5 @@
use bytes::Bytes;
use collab_persistence::CollabKV;
use collab_persistence::kv::rocks_kv::RocksCollabDB;
use database_model::BuildDatabaseContext;
use flowy_database::entities::DatabaseLayoutPB;
use flowy_database::manager::{create_new_database, link_existing_database, DatabaseManager};
@ -70,7 +70,7 @@ impl FolderUser for FolderUserImpl {
.map_err(|e| FlowyError::internal().context(e))
}
fn kv_db(&self) -> Result<Arc<CollabKV>, FlowyError> {
fn kv_db(&self) -> Result<Arc<RocksCollabDB>, FlowyError> {
self.0.get_kv_db()
}
}

View File

@ -109,7 +109,7 @@ impl From<BlockPB> for Block {
}
impl From<BlockEvent> for BlockEventPB {
fn from(block_event: BlockEvent) -> Self {
fn from(_block_event: BlockEvent) -> Self {
// let delta = serde_json::to_value(&block_event.delta).unwrap();
// Self {
// path: block_event.path.into(),

View File

@ -1,9 +1,9 @@
use std::{collections::HashMap, sync::Arc};
use collab::{plugin_impl::disk::CollabDiskPlugin, preclude::CollabBuilder};
use collab_persistence::CollabKV;
use collab::plugin_impl::rocks_disk::RocksDiskPlugin;
use collab::preclude::{Collab, CollabBuilder};
use collab_persistence::kv::rocks_kv::RocksCollabDB;
use flowy_error::{FlowyError, FlowyResult};
use parking_lot::RwLock;
use std::{collections::HashMap, sync::Arc};
use crate::{
document::{Document, DocumentDataWrapper},
@ -14,7 +14,7 @@ use crate::{
pub trait DocumentUser: Send + Sync {
fn user_id(&self) -> Result<i64, FlowyError>;
fn token(&self) -> Result<String, FlowyError>; // unused now.
fn kv_db(&self) -> Result<Arc<CollabKV>, FlowyError>;
fn kv_db(&self) -> Result<Arc<RocksCollabDB>, FlowyError>;
}
pub struct DocumentManager {
@ -90,12 +90,12 @@ impl DocumentManager {
Ok(())
}
fn get_collab_for_doc_id(&self, doc_id: &str) -> Result<collab::preclude::Collab, FlowyError> {
fn get_collab_for_doc_id(&self, doc_id: &str) -> Result<Collab, FlowyError> {
let uid = self.user.user_id()?;
let kv_db = self.user.kv_db()?;
let mut collab = CollabBuilder::new(uid, doc_id).build();
let disk_plugin = Arc::new(
CollabDiskPlugin::new(uid, kv_db).map_err(|err| FlowyError::internal().context(err))?,
RocksDiskPlugin::new(uid, kv_db).map_err(|err| FlowyError::internal().context(err))?,
);
collab.add_plugin(disk_plugin);
collab.initial();

View File

@ -10,13 +10,13 @@ use crate::user_default::{gen_workspace_id, DefaultFolderBuilder};
use crate::view_ext::{
gen_view_id, view_from_create_view_params, ViewDataProcessor, ViewDataProcessorMap,
};
use collab::plugin_impl::disk::CollabDiskPlugin;
use collab::plugin_impl::rocks_disk::RocksDiskPlugin;
use collab::preclude::CollabBuilder;
use collab_folder::core::{
Folder as InnerFolder, FolderContext, TrashChange, TrashChangeReceiver, TrashInfo, TrashRecord,
View, ViewChange, ViewChangeReceiver, ViewLayout, Workspace,
};
use collab_persistence::CollabKV;
use collab_persistence::kv::rocks_kv::RocksCollabDB;
use flowy_error::{FlowyError, FlowyResult};
use lib_infra::util::timestamp;
use parking_lot::Mutex;
@ -28,7 +28,7 @@ use tracing::{event, Level};
pub trait FolderUser: Send + Sync {
fn user_id(&self) -> Result<i64, FlowyError>;
fn token(&self) -> Result<String, FlowyError>;
fn kv_db(&self) -> Result<Arc<CollabKV>, FlowyError>;
fn kv_db(&self) -> Result<Arc<RocksCollabDB>, FlowyError>;
}
pub struct Folder2Manager {
@ -93,7 +93,7 @@ impl Folder2Manager {
let mut collab = CollabBuilder::new(uid, folder_id).build();
if let Ok(kv_db) = self.user.kv_db() {
let disk_plugin = Arc::new(
CollabDiskPlugin::new(uid, kv_db).map_err(|err| FlowyError::internal().context(err))?,
RocksDiskPlugin::new(uid, kv_db).map_err(|err| FlowyError::internal().context(err))?,
);
collab.add_plugin(disk_plugin);
collab.initial();

View File

@ -1,4 +1,4 @@
use collab_persistence::CollabKV;
use collab_persistence::kv::rocks_kv::RocksCollabDB;
use flowy_error::FlowyError;
use flowy_sqlite::ConnectionPool;
use flowy_sqlite::{schema::user_table, DBConnection, Database};
@ -47,12 +47,12 @@ impl UserDB {
Ok(pool)
}
fn open_kv_db_if_need(&self, user_id: i64) -> Result<Arc<CollabKV>, FlowyError> {
if let Some(kv) = KVDB_MAP.read().get(&user_id) {
fn open_kv_db_if_need(&self, user_id: i64) -> Result<Arc<RocksCollabDB>, FlowyError> {
if let Some(kv) = COLLAB_DB_MAP.read().get(&user_id) {
return Ok(kv.clone());
}
let mut write_guard = KVDB_MAP.write();
let mut write_guard = COLLAB_DB_MAP.write();
// The Write guard acquire exclusive access that will guarantee the user db only initialize once.
match write_guard.get(&user_id) {
None => {},
@ -64,8 +64,8 @@ impl UserDB {
dir.push(user_id.to_string());
tracing::trace!("open kv db {} at path: {:?}", user_id, dir);
let kv_db = CollabKV::open(dir).map_err(|err| FlowyError::internal().context(err))?;
let kv_db = Arc::new(kv_db);
let db = RocksCollabDB::open(dir).map_err(|err| FlowyError::internal().context(err))?;
let kv_db = Arc::new(db);
write_guard.insert(user_id.to_owned(), kv_db.clone());
drop(write_guard);
Ok(kv_db)
@ -91,7 +91,7 @@ impl UserDB {
Ok(pool)
}
pub(crate) fn get_kv_db(&self, user_id: i64) -> Result<Arc<CollabKV>, FlowyError> {
pub(crate) fn get_kv_db(&self, user_id: i64) -> Result<Arc<RocksCollabDB>, FlowyError> {
let kv_db = self.open_kv_db_if_need(user_id)?;
Ok(kv_db)
}
@ -99,7 +99,7 @@ impl UserDB {
lazy_static! {
static ref DB_MAP: RwLock<HashMap<i64, Database>> = RwLock::new(HashMap::new());
static ref KVDB_MAP: RwLock<HashMap<i64, Arc<CollabKV>>> = RwLock::new(HashMap::new());
static ref COLLAB_DB_MAP: RwLock<HashMap<i64, Arc<RocksCollabDB>>> = RwLock::new(HashMap::new());
}
#[derive(Clone, Default, Queryable, Identifiable, Insertable)]

View File

@ -7,7 +7,7 @@ use crate::{
notification::*,
services::database::{UserDB, UserTable, UserTableChangeset},
};
use collab_persistence::CollabKV;
use collab_persistence::kv::rocks_kv::RocksCollabDB;
use flowy_sqlite::ConnectionPool;
use flowy_sqlite::{
kv::KV,
@ -125,7 +125,7 @@ impl UserSession {
self.database.get_pool(user_id)
}
pub fn get_kv_db(&self) -> Result<Arc<CollabKV>, FlowyError> {
pub fn get_kv_db(&self) -> Result<Arc<RocksCollabDB>, FlowyError> {
let user_id = self.get_session()?.user_id;
self.database.get_kv_db(user_id)
}