refactor: add debug messages

This commit is contained in:
daimond113 2024-07-24 00:53:34 +02:00
parent 5661194721
commit f0cd53a2c9
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
13 changed files with 149 additions and 78 deletions

130
Cargo.lock generated
View file

@ -1098,9 +1098,9 @@ dependencies = [
[[package]] [[package]]
name = "gix" name = "gix"
version = "0.63.0" version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "984c5018adfa7a4536ade67990b3ebc6e11ab57b3d6cd9968de0947ca99b4b06" checksum = "d78414d29fcc82329080166077e0f7689f4016551fdb334d787c3d040fe2634f"
dependencies = [ dependencies = [
"gix-actor", "gix-actor",
"gix-attributes", "gix-attributes",
@ -1145,7 +1145,6 @@ dependencies = [
"gix-worktree", "gix-worktree",
"gix-worktree-state", "gix-worktree-state",
"once_cell", "once_cell",
"parking_lot",
"regex", "regex",
"smallvec", "smallvec",
"thiserror", "thiserror",
@ -1153,9 +1152,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-actor" name = "gix-actor"
version = "0.31.4" version = "0.31.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b8ee65074b2bbb91d9d97c15d172ea75043aefebf9869b5b329149dc76501c" checksum = "a0e454357e34b833cc3a00b6efbbd3dd4d18b24b9fb0c023876ec2645e8aa3f2"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-date", "gix-date",
@ -1167,9 +1166,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-attributes" name = "gix-attributes"
version = "0.22.2" version = "0.22.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eefb48f42eac136a4a0023f49a54ec31be1c7a9589ed762c45dcb9b953f7ecc8" checksum = "e37ce99c7e81288c28b703641b6d5d119aacc45c1a6b247156e6249afa486257"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-glob", "gix-glob",
@ -1202,9 +1201,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-command" name = "gix-command"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c22e086314095c43ffe5cdc5c0922d5439da4fd726f3b0438c56147c34dc225" checksum = "0d76867867da891cbe32021ad454e8cae90242f6afb06762e4dd0d357afd1d7b"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-path", "gix-path",
@ -1214,9 +1213,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-commitgraph" name = "gix-commitgraph"
version = "0.24.2" version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7b102311085da4af18823413b5176d7c500fb2272eaf391cfa8635d8bcb12c4" checksum = "133b06f67f565836ec0c473e2116a60fb74f80b6435e21d88013ac0e3c60fc78"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-chunk", "gix-chunk",
@ -1228,9 +1227,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-config" name = "gix-config"
version = "0.37.0" version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53fafe42957e11d98e354a66b6bd70aeea00faf2f62dd11164188224a507c840" checksum = "28f53fd03d1bf09ebcc2c8654f08969439c4556e644ca925f27cf033bc43e658"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-config-value", "gix-config-value",
@ -1249,9 +1248,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-config-value" name = "gix-config-value"
version = "0.14.6" version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" checksum = "b328997d74dd15dc71b2773b162cb4af9a25c424105e4876e6d0686ab41c383e"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"bstr", "bstr",
@ -1262,9 +1261,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-credentials" name = "gix-credentials"
version = "0.24.2" version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c70146183bd3c7119329a3c7392d1aa0e0adbe48d727f4df31828fe6d8fdaa1" checksum = "91b446df0841c9d74b3f98f21657b892581a4af78904a22e0cbc6144da972eea"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-command", "gix-command",
@ -1291,9 +1290,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-diff" name = "gix-diff"
version = "0.44.0" version = "0.44.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40b9bd8b2d07b6675a840b56a6c177d322d45fa082672b0dad8f063b25baf0a4" checksum = "1996d5c8a305b59709467d80617c9fde48d9d75fd1f4179ea970912630886c9d"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-hash", "gix-hash",
@ -1303,9 +1302,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-discover" name = "gix-discover"
version = "0.32.0" version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc27c699b63da66b50d50c00668bc0b7e90c3a382ef302865e891559935f3dbf" checksum = "67662731cec3cb31ba3ed2463809493f76d8e5d6c6d245de8b0560438c13450e"
dependencies = [ dependencies = [
"bstr", "bstr",
"dunce", "dunce",
@ -1339,9 +1338,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-filter" name = "gix-filter"
version = "0.11.2" version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00ce6ea5ac8fca7adbc63c48a1b9e0492c222c386aa15f513405f1003f2f4ab2" checksum = "e6547738da28275f4dff4e9f3a0f28509f53f94dd6bd822733c91cb306bca61a"
dependencies = [ dependencies = [
"bstr", "bstr",
"encoding_rs", "encoding_rs",
@ -1360,9 +1359,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-fs" name = "gix-fs"
version = "0.11.1" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3338ff92a2164f5209f185ec0cd316f571a72676bb01d27e22f2867ba69f77a" checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"gix-features", "gix-features",
@ -1371,9 +1370,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-glob" name = "gix-glob"
version = "0.16.3" version = "0.16.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a29ad0990cf02c48a7aac76ed0dbddeb5a0d070034b83675cc3bbf937eace4" checksum = "fa7df15afa265cc8abe92813cd354d522f1ac06b29ec6dfa163ad320575cb447"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"bstr", "bstr",
@ -1404,9 +1403,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-ignore" name = "gix-ignore"
version = "0.11.2" version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "640dbeb4f5829f9fc14d31f654a34a0350e43a24e32d551ad130d99bf01f63f1" checksum = "5e6afb8f98e314d4e1adc822449389ada863c174b5707cedd327d67b84dba527"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-glob", "gix-glob",
@ -1417,9 +1416,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-index" name = "gix-index"
version = "0.33.0" version = "0.33.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d8c5a5f1c58edcbc5692b174cda2703aba82ed17d7176ff4c1752eb48b1b167" checksum = "9a9a44eb55bd84bb48f8a44980e951968ced21e171b22d115d1cdcef82a7d73f"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"bstr", "bstr",
@ -1467,9 +1466,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-negotiate" name = "gix-negotiate"
version = "0.13.1" version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d57dec54544d155a495e01de947da024471e1825d7d3f2724301c07a310d6184" checksum = "9ec879fb6307bb63519ba89be0024c6f61b4b9d61f1a91fd2ce572d89fe9c224"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"gix-commitgraph", "gix-commitgraph",
@ -1502,9 +1501,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-odb" name = "gix-odb"
version = "0.61.0" version = "0.61.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e92b9790e2c919166865d0825b26cc440a387c175bed1b43a2fa99c0e9d45e98" checksum = "20d384fe541d93d8a3bb7d5d5ef210780d6df4f50c4e684ccba32665a5e3bc9b"
dependencies = [ dependencies = [
"arc-swap", "arc-swap",
"gix-date", "gix-date",
@ -1522,9 +1521,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-pack" name = "gix-pack"
version = "0.51.0" version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a8da51212dbff944713edb2141ed7e002eea326b8992070374ce13a6cb610b3" checksum = "3e0594491fffe55df94ba1c111a6566b7f56b3f8d2e1efc750e77d572f5f5229"
dependencies = [ dependencies = [
"clru", "clru",
"gix-chunk", "gix-chunk",
@ -1579,9 +1578,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-pathspec" name = "gix-pathspec"
version = "0.7.5" version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a76cab098dc10ba2d89f634f66bf196dea4d7db4bf10b75c7a9c201c55a2ee19" checksum = "d307d1b8f84dc8386c4aa20ce0cf09242033840e15469a3ecba92f10cfb5c046"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"bstr", "bstr",
@ -1594,9 +1593,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-prompt" name = "gix-prompt"
version = "0.8.5" version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fddabbc7c51c241600ab3c4623b19fa53bde7c1a2f637f61043ed5fcadf000cc" checksum = "7e0595d2be4b6d6a71a099e989bdd610882b882da35fb8503d91d6f81aa0936f"
dependencies = [ dependencies = [
"gix-command", "gix-command",
"gix-config-value", "gix-config-value",
@ -1607,9 +1606,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-protocol" name = "gix-protocol"
version = "0.45.1" version = "0.45.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c140d4c6d209048826bad78f021a01b612830f89da356efeb31afe8957f8bee" checksum = "bad8da8e89f24177bd77947092199bb13dcc318bbd73530ba8a05e6d6adaaa9d"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-credentials", "gix-credentials",
@ -1636,12 +1635,11 @@ dependencies = [
[[package]] [[package]]
name = "gix-ref" name = "gix-ref"
version = "0.44.1" version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3394a2997e5bc6b22ebc1e1a87b41eeefbcfcff3dbfa7c4bd73cb0ac8f1f3e2e" checksum = "636e96a0a5562715153fee098c217110c33a6f8218f08f4687ff99afde159bb5"
dependencies = [ dependencies = [
"gix-actor", "gix-actor",
"gix-date",
"gix-features", "gix-features",
"gix-fs", "gix-fs",
"gix-hash", "gix-hash",
@ -1658,9 +1656,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-refspec" name = "gix-refspec"
version = "0.23.0" version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dde848865834a54fe4d9b4573f15d0e9a68eaf3d061b42d3ed52b4b8acf880b2" checksum = "6868f8cd2e62555d1f7c78b784bece43ace40dd2a462daf3b588d5416e603f37"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-hash", "gix-hash",
@ -1672,9 +1670,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-revision" name = "gix-revision"
version = "0.27.1" version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e08f8107ed1f93a83bcfbb4c38084c7cb3f6cd849793f1d5eec235f9b13b2b" checksum = "01b13e43c2118c4b0537ddac7d0821ae0dfa90b7b8dbf20c711e153fb749adce"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-date", "gix-date",
@ -1688,9 +1686,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-revwalk" name = "gix-revwalk"
version = "0.13.1" version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4181db9cfcd6d1d0fd258e91569dbb61f94cb788b441b5294dd7f1167a3e788f" checksum = "1b030ccaab71af141f537e0225f19b9e74f25fefdba0372246b844491cab43e0"
dependencies = [ dependencies = [
"gix-commitgraph", "gix-commitgraph",
"gix-date", "gix-date",
@ -1703,9 +1701,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-sec" name = "gix-sec"
version = "0.10.6" version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" checksum = "1547d26fa5693a7f34f05b4a3b59a90890972922172653bcb891ab3f09f436df"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"gix-path", "gix-path",
@ -1715,9 +1713,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-submodule" name = "gix-submodule"
version = "0.11.0" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "921cd49924ac14b6611b22e5fb7bbba74d8780dc7ad26153304b64d1272460ac" checksum = "0f2e0f69aa00805e39d39ec80472a7e9da20ed5d73318b27925a2cc198e854fd"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-config", "gix-config",
@ -1749,9 +1747,9 @@ checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e"
[[package]] [[package]]
name = "gix-transport" name = "gix-transport"
version = "0.42.1" version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb0ffa5f869977f5b9566399154055902f05d7e85c787d5eacf551acdd0c4adf" checksum = "27c02b83763ffe95bcc27ce5821b2b7f843315a009c06f1cd59c9b66c508c058"
dependencies = [ dependencies = [
"base64", "base64",
"bstr", "bstr",
@ -1768,9 +1766,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-traverse" name = "gix-traverse"
version = "0.39.1" version = "0.39.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f20cb69b63eb3e4827939f42c05b7756e3488ef49c25c412a876691d568ee2a0" checksum = "e499a18c511e71cf4a20413b743b9f5bcf64b3d9e81e9c3c6cd399eae55a8840"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"gix-commitgraph", "gix-commitgraph",
@ -1785,9 +1783,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-url" name = "gix-url"
version = "0.27.3" version = "0.27.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0db829ebdca6180fbe32be7aed393591df6db4a72dbbc0b8369162390954d1cf" checksum = "e2eb9b35bba92ea8f0b5ab406fad3cf6b87f7929aa677ff10aa042c6da621156"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-features", "gix-features",
@ -1819,9 +1817,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-worktree" name = "gix-worktree"
version = "0.34.0" version = "0.34.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53f6b7de83839274022aff92157d7505f23debf739d257984a300a35972ca94e" checksum = "26f7326ebe0b9172220694ea69d344c536009a9b98fb0f9de092c440f3efe7a6"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-attributes", "gix-attributes",
@ -1838,9 +1836,9 @@ dependencies = [
[[package]] [[package]]
name = "gix-worktree-state" name = "gix-worktree-state"
version = "0.11.0" version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e64b2835892ce553b15aef7f6f7bb1e39e146fdf71eb99609b86710a7786cf34" checksum = "39ed6205b5f51067a485b11843babcf3304c0799e265a06eb0dde7f69cd85cd8"
dependencies = [ dependencies = [
"bstr", "bstr",
"gix-features", "gix-features",

View file

@ -11,10 +11,11 @@ include = ["src/**/*", "Cargo.toml", "Cargo.lock", "README.md", "LICENSE", "CHAN
[features] [features]
bin = ["clap", "directories", "pretty_env_logger", "reqwest/json", "reqwest/multipart", "indicatif", "indicatif-log-bridge", "inquire", "toml_edit", "colored", "anyhow", "keyring", "open", "gix/worktree-mutation"] bin = ["clap", "directories", "pretty_env_logger", "reqwest/json", "reqwest/multipart", "indicatif", "indicatif-log-bridge", "inquire", "toml_edit", "colored", "anyhow", "keyring", "open", "gix/worktree-mutation"]
wally-compat = ["zip"] wally-compat = ["zip", "roblox"]
roblox = [] roblox = []
lune = [] lune = []
luau = [] luau = []
patches = ["git2"]
[[bin]] [[bin]]
name = "pesde" name = "pesde"
@ -29,9 +30,7 @@ serde = { version = "1.0.204", features = ["derive"] }
toml = "0.8.15" toml = "0.8.15"
serde_json = "1.0.120" serde_json = "1.0.120"
serde_with = "3.9.0" serde_with = "3.9.0"
gix = { version = "0.63.0", default-features = false, features = ["blocking-http-transport-reqwest-rust-tls", "revparse-regex", "credentials"] } gix = { version = "0.64.0", default-features = false, features = ["blocking-http-transport-reqwest-rust-tls", "revparse-regex", "credentials"] }
# TODO: remove this when gitoxide adds support for: committing, pushing, adding
git2 = "0.19.0"
semver = { version = "1.0.23", features = ["serde"] } semver = { version = "1.0.23", features = ["serde"] }
reqwest = { version = "0.12.5", default-features = false, features = ["rustls-tls", "blocking"] } reqwest = { version = "0.12.5", default-features = false, features = ["rustls-tls", "blocking"] }
tar = "0.4.41" tar = "0.4.41"
@ -48,6 +47,9 @@ cfg-if = "1.0.0"
# secrecy = "0.8.0" # secrecy = "0.8.0"
chrono = { version = "0.4.38", features = ["serde"] } chrono = { version = "0.4.38", features = ["serde"] }
# TODO: remove this when gitoxide adds support for: committing, pushing, adding
git2 = { version = "0.19.0", optional = true }
zip = { version = "2.1.5", optional = true } zip = { version = "2.1.5", optional = true }
anyhow = { version = "1.0.86", optional = true } anyhow = { version = "1.0.86", optional = true }

View file

@ -2,7 +2,7 @@ use crate::cli::{reqwest_client, IsUpToDate};
use anyhow::Context; use anyhow::Context;
use clap::Args; use clap::Args;
use indicatif::MultiProgress; use indicatif::MultiProgress;
use pesde::{lockfile::Lockfile, Project}; use pesde::{lockfile::Lockfile, manifest::TargetKind, Project};
use std::{collections::HashSet, sync::Arc, time::Duration}; use std::{collections::HashSet, sync::Arc, time::Duration};
#[derive(Debug, Args)] #[derive(Debug, Args)]
@ -37,6 +37,25 @@ impl InstallCommand {
None None
}; };
{
let mut deleted_folders = HashSet::new();
for target_kind in TargetKind::VARIANTS {
let folder = manifest.target.kind().packages_folder(target_kind);
if deleted_folders.insert(folder.to_string()) {
log::debug!("deleting the {folder} folder");
if let Some(e) = std::fs::remove_dir_all(project.path().join(&folder))
.err()
.filter(|e| e.kind() != std::io::ErrorKind::NotFound)
{
return Err(e).context(format!("failed to remove the {folder} folder"));
};
}
}
}
let old_graph = lockfile.map(|lockfile| { let old_graph = lockfile.map(|lockfile| {
lockfile lockfile
.graph .graph

View file

@ -11,7 +11,9 @@ mod auth;
mod config; mod config;
mod init; mod init;
mod install; mod install;
#[cfg(feature = "patches")]
mod patch; mod patch;
#[cfg(feature = "patches")]
mod patch_commit; mod patch_commit;
mod publish; mod publish;
mod run; mod run;
@ -249,10 +251,12 @@ impl IsUpToDate for Project {
}; };
if manifest.overrides != lockfile.overrides { if manifest.overrides != lockfile.overrides {
log::debug!("overrides are different");
return Ok(false); return Ok(false);
} }
if manifest.target.kind() != lockfile.target { if manifest.target.kind() != lockfile.target {
log::debug!("target kind is different");
return Ok(false); return Ok(false);
} }
@ -261,6 +265,7 @@ impl IsUpToDate for Project {
} }
if manifest.name != lockfile.name || manifest.version != lockfile.version { if manifest.name != lockfile.name || manifest.version != lockfile.version {
log::debug!("name or version is different");
return Ok(false); return Ok(false);
} }
@ -274,11 +279,15 @@ impl IsUpToDate for Project {
}) })
.collect::<HashSet<_>>(); .collect::<HashSet<_>>();
Ok(manifest let same_dependencies = manifest
.all_dependencies() .all_dependencies()
.context("failed to get all dependencies")? .context("failed to get all dependencies")?
.iter() .iter()
.all(|(_, (spec, ty))| specs.contains(&(spec.clone(), *ty)))) .all(|(_, (spec, ty))| specs.contains(&(spec.clone(), *ty)));
log::debug!("dependencies are the same: {same_dependencies}");
Ok(same_dependencies)
} }
} }
@ -350,9 +359,11 @@ pub enum Subcommand {
SelfInstall(self_install::SelfInstallCommand), SelfInstall(self_install::SelfInstallCommand),
/// Sets up a patching environment for a package /// Sets up a patching environment for a package
#[cfg(feature = "patches")]
Patch(patch::PatchCommand), Patch(patch::PatchCommand),
/// Finalizes a patching environment for a package /// Finalizes a patching environment for a package
#[cfg(feature = "patches")]
PatchCommit(patch_commit::PatchCommitCommand), PatchCommit(patch_commit::PatchCommitCommand),
} }
@ -366,7 +377,9 @@ impl Subcommand {
Subcommand::Install(install) => install.run(project, multi), Subcommand::Install(install) => install.run(project, multi),
Subcommand::Publish(publish) => publish.run(project), Subcommand::Publish(publish) => publish.run(project),
Subcommand::SelfInstall(self_install) => self_install.run(project), Subcommand::SelfInstall(self_install) => self_install.run(project),
#[cfg(feature = "patches")]
Subcommand::Patch(patch) => patch.run(project), Subcommand::Patch(patch) => patch.run(project),
#[cfg(feature = "patches")]
Subcommand::PatchCommit(patch_commit) => patch_commit.run(project), Subcommand::PatchCommit(patch_commit) => patch_commit.run(project),
} }
} }

View file

@ -63,6 +63,8 @@ impl Project {
threadpool.execute(move || { threadpool.execute(move || {
let project = project.clone(); let project = project.clone();
log::debug!("downloading {name}@{version_id}");
let target = let target =
match source.download(&node.pkg_ref, &container_folder, &project, &reqwest) match source.download(&node.pkg_ref, &container_folder, &project, &reqwest)
{ {
@ -73,6 +75,8 @@ impl Project {
} }
}; };
log::debug!("downloaded {name}@{version_id}");
let mut downloaded_graph = downloaded_graph.lock().unwrap(); let mut downloaded_graph = downloaded_graph.lock().unwrap();
downloaded_graph downloaded_graph
.entry(name) .entry(name)

View file

@ -11,6 +11,7 @@ pub mod linking;
pub mod lockfile; pub mod lockfile;
pub mod manifest; pub mod manifest;
pub mod names; pub mod names;
#[cfg(feature = "patches")]
pub mod patches; pub mod patches;
pub mod resolver; pub mod resolver;
pub mod scripts; pub mod scripts;

View file

@ -76,8 +76,10 @@ pub fn get_require_path(
let path = pathdiff::diff_paths(destination_dir, base_dir).unwrap(); let path = pathdiff::diff_paths(destination_dir, base_dir).unwrap();
let path = if !use_new_structure { let path = if !use_new_structure {
log::debug!("using old structure for require path");
lib_file.to_path(path) lib_file.to_path(path)
} else { } else {
log::debug!("using new structure for require path");
path path
}; };

View file

@ -54,6 +54,8 @@ impl Project {
} }
}; };
log::debug!("{name}@{version_id} has {} exported types", types.len());
package_types package_types
.entry(name) .entry(name)
.or_default() .or_default()

View file

@ -53,8 +53,10 @@ pub fn insert_node(
mut node: DependencyGraphNode, mut node: DependencyGraphNode,
is_top_level: bool, is_top_level: bool,
) { ) {
if !is_top_level { if !is_top_level && node.direct.take().is_some() {
node.direct.take(); log::debug!(
"tried to insert {name}@{version} as direct dependency from a non top-level context",
);
} }
match graph match graph

View file

@ -53,6 +53,15 @@ impl FromStr for TargetKind {
} }
impl TargetKind { impl TargetKind {
pub const VARIANTS: &'static [TargetKind] = &[
#[cfg(feature = "roblox")]
TargetKind::Roblox,
#[cfg(feature = "lune")]
TargetKind::Lune,
#[cfg(feature = "luau")]
TargetKind::Luau,
];
// self is the project's target, dependency is the target of the dependency // self is the project's target, dependency is the target of the dependency
pub fn is_compatible_with(&self, dependency: &Self) -> bool { pub fn is_compatible_with(&self, dependency: &Self) -> bool {
if self == dependency { if self == dependency {
@ -213,7 +222,7 @@ impl Display for OverrideKey {
pub enum ScriptName { pub enum ScriptName {
#[cfg(feature = "roblox")] #[cfg(feature = "roblox")]
RobloxSyncConfigGenerator, RobloxSyncConfigGenerator,
#[cfg(all(feature = "wally-compat", feature = "roblox"))] #[cfg(feature = "wally-compat")]
SourcemapGenerator, SourcemapGenerator,
} }
@ -222,7 +231,7 @@ impl Display for ScriptName {
match self { match self {
#[cfg(feature = "roblox")] #[cfg(feature = "roblox")]
ScriptName::RobloxSyncConfigGenerator => write!(f, "roblox_sync_config_generator"), ScriptName::RobloxSyncConfigGenerator => write!(f, "roblox_sync_config_generator"),
#[cfg(all(feature = "wally-compat", feature = "roblox"))] #[cfg(feature = "wally-compat")]
ScriptName::SourcemapGenerator => write!(f, "sourcemap_generator"), ScriptName::SourcemapGenerator => write!(f, "sourcemap_generator"),
} }
} }
@ -254,6 +263,7 @@ pub struct Manifest {
pub overrides: BTreeMap<OverrideKey, DependencySpecifiers>, pub overrides: BTreeMap<OverrideKey, DependencySpecifiers>,
#[serde(default)] #[serde(default)]
pub includes: BTreeSet<String>, pub includes: BTreeSet<String>,
#[cfg(feature = "patches")]
#[serde(default, skip_serializing)] #[serde(default, skip_serializing)]
pub patches: BTreeMap<PackageNames, BTreeMap<VersionId, RelativePathBuf>>, pub patches: BTreeMap<PackageNames, BTreeMap<VersionId, RelativePathBuf>>,

View file

@ -90,11 +90,15 @@ impl Project {
version_id.version(), version_id.version(),
); );
log::debug!("applying patch to {name}@{version_id}");
{ {
let repo = setup_patches_repo(&container_folder)?; let repo = setup_patches_repo(&container_folder)?;
repo.apply(&patch, ApplyLocation::Both, None)?; repo.apply(&patch, ApplyLocation::Both, None)?;
} }
log::debug!("patch applied to {name}@{version_id}, removing .git directory");
std::fs::remove_dir_all(container_folder.join(".git")).map_err(|e| { std::fs::remove_dir_all(container_folder.join(".git")).map_err(|e| {
errors::ApplyPatchesError::GitDirectoryRemovalError(container_folder, e) errors::ApplyPatchesError::GitDirectoryRemovalError(container_folder, e)
})?; })?;

View file

@ -39,7 +39,9 @@ impl Project {
.remove(&(specifier.clone(), node.ty)) .remove(&(specifier.clone(), node.ty))
.is_none() .is_none()
{ {
// this dependency is no longer in the manifest, or it's type has changed log::debug!(
"dependency {name}@{version} from old dependency graph is no longer in the manifest",
);
continue; continue;
} }
@ -258,6 +260,13 @@ impl Project {
}) })
}); });
if overridden.is_some() {
log::debug!(
"{}overridden specifier found for {dependency_alias} ({dependency_spec})",
"\t".repeat(depth)
);
}
queue.push_back(( queue.push_back((
dependency_alias, dependency_alias,
overridden.cloned().unwrap_or(dependency_spec), overridden.cloned().unwrap_or(dependency_spec),

View file

@ -250,6 +250,8 @@ impl PackageSource for PesdePackageSource {
type DownloadError = errors::DownloadError; type DownloadError = errors::DownloadError;
fn refresh(&self, project: &Project) -> Result<(), Self::RefreshError> { fn refresh(&self, project: &Project) -> Result<(), Self::RefreshError> {
log::debug!("refreshing pesde index at {}", self.repo_url);
let path = self.path(project); let path = self.path(project);
if path.exists() { if path.exists() {
let repo = match gix::open(&path) { let repo = match gix::open(&path) {
@ -311,6 +313,8 @@ impl PackageSource for PesdePackageSource {
let entries: IndexFile = toml::from_str(&string) let entries: IndexFile = toml::from_str(&string)
.map_err(|e| Self::ResolveError::Parse(specifier.name.to_string(), e))?; .map_err(|e| Self::ResolveError::Parse(specifier.name.to_string(), e))?;
log::debug!("{} has {} possible entries", specifier.name, entries.len());
Ok(( Ok((
PackageNames::Pesde(specifier.name.clone()), PackageNames::Pesde(specifier.name.clone()),
entries entries
@ -358,6 +362,7 @@ impl PackageSource for PesdePackageSource {
let mut response = reqwest.get(url); let mut response = reqwest.get(url);
if let Some(token) = &project.auth_config.pesde_token { if let Some(token) = &project.auth_config.pesde_token {
log::debug!("using token for pesde package download");
response = response.header("Authorization", format!("Bearer {token}")); response = response.header("Authorization", format!("Bearer {token}"));
} }