remove gitbutler-git from builds

This commit is contained in:
Josh Junon 2024-02-29 15:19:48 +01:00
parent 6d51b5e252
commit 5c88e3db89
No known key found for this signature in database
5 changed files with 8 additions and 425 deletions

View File

@ -14,7 +14,6 @@ jobs:
rust: ${{ steps.filter.outputs.rust }}
gitbutler-app: ${{ steps.filter.outputs.gitbutler-app }}
gitbutler-core: ${{ steps.filter.outputs.gitbutler-core }}
gitbutler-git: ${{ steps.filter.outputs.gitbutler-git }}
gitbutler-changeset: ${{ steps.filter.outputs.gitbutler-changeset }}
steps:
- uses: actions/checkout@v4
@ -38,9 +37,6 @@ jobs:
gitbutler-core:
- *rust
- 'gitbutler-core/**'
gitbutler-git:
- *rust
- 'gitbutler-git/**'
gitbutler-changeset:
- *rust
- 'gitbutler-changeset/**'
@ -95,7 +91,7 @@ jobs:
- uses: ./.github/actions/init-env-rust
# TODO(qix-): we have to exclude the app here for now because for some
# TODO(qix-): reason it doesn't build with the docs feature enabled.
- run: cargo doc --no-deps --all-features --document-private-items -p gitbutler-core -p gitbutler-git -p gitbutler-changeset
- run: cargo doc --no-deps --all-features --document-private-items -p gitbutler-core -p gitbutler-changeset
env:
RUSTDOCFLAGS: -Dwarnings
@ -121,36 +117,6 @@ jobs:
features: ${{ toJson(matrix.features) }}
action: ${{ matrix.action }}
check-gitbutler-git:
needs: [changes, rust-init]
if: ${{ needs.changes.outputs.gitbutler-git == 'true' }}
runs-on: ubuntu-latest
container:
image: ghcr.io/gitbutlerapp/ci-base-image:latest
strategy:
matrix:
action:
- test
- check
- check-tests
features:
- ''
- '*'
- []
- [cli]
- [cli, tokio]
- [serde]
- [git2]
steps:
- uses: actions/checkout@v4
# FIXME(qix-): figure out a way to make these build automatically with tests
- run: cargo build --locked -p gitbutler-git --bin gitbutler-git-askpass --bin gitbutler-git-setsid
- uses: ./.github/actions/check-crate
with:
crate: gitbutler-git
features: ${{ toJson(matrix.features) }}
action: ${{ matrix.action }}
check-gitbutler-changeset:
needs: [changes, rust-init]
if: ${{ needs.changes.outputs.gitbutler-changeset == 'true' }}
@ -208,7 +174,6 @@ jobs:
needs:
- changes
- check-gitbutler-app
- check-gitbutler-git
- check-gitbutler-changeset
- check-gitbutler-core
runs-on: ubuntu-latest

358
Cargo.lock generated
View File

@ -17,16 +17,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aead"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
dependencies = [
"crypto-common",
"generic-array",
]
[[package]]
name = "aes"
version = "0.8.3"
@ -38,20 +28,6 @@ dependencies = [
"cpufeatures",
]
[[package]]
name = "aes-gcm"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
dependencies = [
"aead",
"aes",
"cipher",
"ctr",
"ghash",
"subtle",
]
[[package]]
name = "ahash"
version = "0.8.3"
@ -392,17 +368,6 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]]
name = "bcrypt-pbkdf"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6aeac2e1fe888769f34f05ac343bbef98b14d1ffb292ab69d4608b3abc86f2a2"
dependencies = [
"blowfish",
"pbkdf2 0.12.2",
"sha2",
]
[[package]]
name = "bincode"
version = "1.3.3"
@ -412,12 +377,6 @@ dependencies = [
"serde",
]
[[package]]
name = "bit-vec"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
[[package]]
name = "bit_field"
version = "0.10.2"
@ -451,15 +410,6 @@ dependencies = [
"generic-array",
]
[[package]]
name = "block-padding"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
dependencies = [
"generic-array",
]
[[package]]
name = "blocking"
version = "1.4.1"
@ -476,16 +426,6 @@ dependencies = [
"tracing",
]
[[package]]
name = "blowfish"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7"
dependencies = [
"byteorder",
"cipher",
]
[[package]]
name = "brotli"
version = "3.3.4"
@ -608,15 +548,6 @@ dependencies = [
"toml 0.7.6",
]
[[package]]
name = "cbc"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"
dependencies = [
"cipher",
]
[[package]]
name = "cc"
version = "1.0.83"
@ -669,17 +600,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chacha20"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
dependencies = [
"cfg-if",
"cipher",
"cpufeatures",
]
[[package]]
name = "chrono"
version = "0.4.33"
@ -942,7 +862,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
"rand_core 0.6.4",
"typenum",
]
@ -983,15 +902,6 @@ dependencies = [
"syn 2.0.48",
]
[[package]]
name = "ctr"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
dependencies = [
"cipher",
]
[[package]]
name = "curve25519-dalek"
version = "4.1.0"
@ -1006,7 +916,6 @@ dependencies = [
"platforms",
"rustc_version",
"subtle",
"zeroize",
]
[[package]]
@ -1068,12 +977,6 @@ dependencies = [
"parking_lot_core 0.9.8",
]
[[package]]
name = "data-encoding"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]]
name = "debugid"
version = "0.8.0"
@ -1091,7 +994,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c"
dependencies = [
"const-oid",
"pem-rfc7468",
"zeroize",
]
@ -1270,7 +1172,6 @@ version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d"
dependencies = [
"pkcs8",
"signature",
]
@ -1282,10 +1183,7 @@ checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980"
dependencies = [
"curve25519-dalek",
"ed25519",
"rand_core 0.6.4",
"serde",
"sha2",
"zeroize",
]
[[package]]
@ -1306,7 +1204,6 @@ dependencies = [
"ff",
"generic-array",
"group",
"pem-rfc7468",
"pkcs8",
"rand_core 0.6.4",
"sec1",
@ -1837,16 +1734,6 @@ dependencies = [
"wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
name = "ghash"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40"
dependencies = [
"opaque-debug",
"polyval",
]
[[package]]
name = "gif"
version = "0.12.0"
@ -1939,7 +1826,6 @@ dependencies = [
"git2",
"git2-hooks",
"gitbutler-core",
"gitbutler-git",
"governor",
"itertools 0.12.1",
"lazy_static",
@ -2007,24 +1893,6 @@ dependencies = [
"uuid",
]
[[package]]
name = "gitbutler-git"
version = "0.0.0"
dependencies = [
"async-trait",
"dirs 5.0.1",
"futures",
"git2",
"nix 0.27.1",
"rand 0.8.5",
"russh",
"russh-keys",
"serde",
"sysinfo",
"thiserror",
"tokio",
]
[[package]]
name = "glib"
version = "0.15.12"
@ -2277,12 +2145,6 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hex-literal"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
[[package]]
name = "hmac"
version = "0.12.1"
@ -2554,7 +2416,6 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
dependencies = [
"block-padding",
"generic-array",
]
@ -2998,7 +2859,7 @@ dependencies = [
"combine",
"libc",
"mach2",
"nix 0.26.4",
"nix",
"sysctl",
"thiserror",
"widestring",
@ -3070,18 +2931,6 @@ dependencies = [
"pin-utils",
]
[[package]]
name = "nix"
version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.4.0",
"cfg-if",
"libc",
"memoffset 0.9.0",
]
[[package]]
name = "no-std-compat"
version = "0.4.1"
@ -3143,15 +2992,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "ntapi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
dependencies = [
"winapi",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
@ -3162,18 +3002,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "num-bigint"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
"rand 0.8.5",
]
[[package]]
name = "num-bigint-dig"
version = "0.8.4"
@ -3318,12 +3146,6 @@ version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "opaque-debug"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "open"
version = "3.2.0"
@ -3573,15 +3395,6 @@ dependencies = [
"sha2",
]
[[package]]
name = "pbkdf2"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
dependencies = [
"digest",
]
[[package]]
name = "pem-rfc7468"
version = "0.7.0"
@ -3850,29 +3663,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "poly1305"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
dependencies = [
"cpufeatures",
"opaque-debug",
"universal-hash",
]
[[package]]
name = "polyval"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb"
dependencies = [
"cfg-if",
"cpufeatures",
"opaque-debug",
"universal-hash",
]
[[package]]
name = "ppv-lite86"
version = "0.2.17"
@ -4411,92 +4201,6 @@ dependencies = [
"smallvec",
]
[[package]]
name = "russh"
version = "0.41.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f5a2a1836739e0dbbdb6efe481b37a540aea25ffa0af466ebb7790fc2f8f9a3"
dependencies = [
"aes",
"aes-gcm",
"async-trait",
"bitflags 2.4.0",
"byteorder",
"chacha20",
"ctr",
"curve25519-dalek",
"digest",
"flate2",
"futures",
"generic-array",
"hex-literal",
"hmac",
"log",
"num-bigint",
"once_cell",
"openssl",
"poly1305",
"rand 0.8.5",
"russh-cryptovec",
"russh-keys",
"sha1",
"sha2",
"subtle",
"thiserror",
"tokio",
"tokio-util",
]
[[package]]
name = "russh-cryptovec"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b077b6dd8d8c085dac62f7fcc5a83df60c7f7a22d49bfba994f2f4dbf60bc74"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "russh-keys"
version = "0.41.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d04bf4f4bea01661f1d7574607ffa510bbb11d19ffa91cda44c24feaa6e0960"
dependencies = [
"aes",
"async-trait",
"bcrypt-pbkdf",
"bit-vec",
"block-padding",
"byteorder",
"cbc",
"ctr",
"data-encoding",
"dirs 5.0.1",
"ed25519-dalek",
"futures",
"hmac",
"inout",
"log",
"md5",
"num-bigint",
"num-integer",
"openssl",
"p256",
"p521",
"pbkdf2 0.11.0",
"rand 0.7.3",
"rand_core 0.6.4",
"russh-cryptovec",
"serde",
"sha1",
"sha2",
"thiserror",
"tokio",
"tokio-stream",
"yasna",
]
[[package]]
name = "rustc-demangle"
version = "0.1.23"
@ -5265,21 +4969,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "sysinfo"
version = "0.30.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"windows 0.52.0",
]
[[package]]
name = "system-configuration"
version = "0.5.1"
@ -6106,16 +5795,6 @@ version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
[[package]]
name = "universal-hash"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
dependencies = [
"crypto-common",
"subtle",
]
[[package]]
name = "ureq"
version = "2.7.1"
@ -6491,16 +6170,6 @@ dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-targets 0.52.0",
]
[[package]]
name = "windows-bindgen"
version = "0.39.0"
@ -6511,15 +6180,6 @@ dependencies = [
"windows-tokens",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
]
[[package]]
name = "windows-implement"
version = "0.39.0"
@ -6903,7 +6563,7 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd"
dependencies = [
"nix 0.26.4",
"nix",
"winapi",
]
@ -6913,16 +6573,6 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
[[package]]
name = "yasna"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd"
dependencies = [
"bit-vec",
"num-bigint",
]
[[package]]
name = "zbus"
version = "3.14.1"
@ -6947,7 +6597,7 @@ dependencies = [
"futures-sink",
"futures-util",
"hex",
"nix 0.26.4",
"nix",
"once_cell",
"ordered-stream",
"rand 0.8.5",
@ -7009,7 +6659,7 @@ dependencies = [
"crossbeam-utils",
"flate2",
"hmac",
"pbkdf2 0.11.0",
"pbkdf2",
"sha1",
"time",
"zstd",

View File

@ -3,13 +3,11 @@ members = [
"gitbutler-app",
"gitbutler-core",
"gitbutler-changeset",
"gitbutler-git",
]
resolver = "2"
[workspace.dependencies]
gitbutler-core = { path = "gitbutler-core" }
gitbutler-git = { path = "gitbutler-git" }
git2 = { version = "0.18.2", features = ["vendored-openssl", "vendored-libgit2"] }
uuid = "1.7.0"
serde = { version = "1.0", features = ["derive"] }

View File

@ -22,7 +22,6 @@ pretty_assertions = "1.4"
tempfile = "3.10"
[dependencies]
gitbutler-git.workspace = true
anyhow = "1.0.79"
async-trait = "0.1.77"
backoff = "0.4.0"

View File

@ -66,42 +66,13 @@ pub async fn git_remote_branches(
#[tauri::command(async)]
#[instrument(skip(handle))]
pub async fn git_head(handle: tauri::AppHandle, project_id: &str) -> Result<String, Error> {
use gitbutler_git::Repository;
let app = handle.state::<app::App>();
let project_id = project_id.parse().map_err(|_| Error::UserError {
code: Code::Validation,
message: "Malformed project id".to_string(),
})?;
let project = handle.state::<projects::Controller>().get(&project_id)?;
let repo =
gitbutler_git::git2::Repository::<gitbutler_git::git2::tokio::TokioThreadedResource>::open(
&project.path,
)
.await
.map_err(|e| Error::UserError {
code: Code::Projects,
message: format!("could not open repository: {e}"),
})?;
repo.symbolic_head().await.map_err(|e| match &e {
gitbutler_git::Error::Backend(err) => {
if err.code() == ErrorCode::UnbornBranch {
return Error::UserError {
code: Code::ProjectHead,
message:
"could not get symbolic head: Cannot load a git repository with 0 commits"
.to_string(),
};
}
Error::UserError {
code: Code::ProjectHead,
message: format!("could not get symbolic head: {e}"),
}
}
_ => Error::UserError {
code: Code::ProjectHead,
message: format!("could not get symbolic head: {e}"),
},
})
let head = app.git_head(&project_id)?;
Ok(head)
}
#[tauri::command(async)]