Merge branch 'push-diff' into 'master'

Implement push update diff

See merge request redox-os/redox!2015
This commit is contained in:
Jeremy Soller 2026-03-19 09:07:40 -06:00
commit 275e5253e4
9 changed files with 450 additions and 278 deletions

368
Cargo.lock generated
View File

@ -25,15 +25,15 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
[[package]]
name = "ansi-to-tui"
version = "7.0.0"
version = "8.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c"
checksum = "e42366bb9d958f042bf58f0a85e1b2d091997c1257ca49bddd7e4827aadc65fd"
dependencies = [
"nom",
"ratatui",
"ratatui-core",
"simdutf8",
"smallvec",
"thiserror 1.0.69",
"thiserror",
]
[[package]]
@ -42,6 +42,12 @@ version = "1.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "arg_parser"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9bcdf9185a4ea0d8afa7c8ad387cc3a93c3ecfa918125e000a57a42e71268d7"
[[package]]
name = "arrayref"
version = "0.3.9"
@ -114,12 +120,6 @@ dependencies = [
"syn",
]
[[package]]
name = "cassowary"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]]
name = "castaway"
version = "0.2.4"
@ -169,9 +169,9 @@ dependencies = [
[[package]]
name = "compact_str"
version = "0.8.1"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32"
checksum = "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a"
dependencies = [
"castaway",
"cfg-if",
@ -310,6 +310,15 @@ dependencies = [
"syn",
]
[[package]]
name = "deranged"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c"
dependencies = [
"powerfmt",
]
[[package]]
name = "digest"
version = "0.10.7"
@ -343,9 +352,9 @@ dependencies = [
[[package]]
name = "dryoc"
version = "0.6.2"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e73e0fee365832cd9b9a53ea62f944cc0d7a4c71f2b9c96a28fc74749517afa"
checksum = "4684d84cc4dc1a8705dcbe8be0e258581dfdbb308477ed604f52797c336bb3d2"
dependencies = [
"bitflags",
"chacha20",
@ -403,9 +412,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foldhash"
version = "0.1.5"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "generic-array"
@ -417,17 +426,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "getrandom"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
"cfg-if",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
]
[[package]]
name = "getrandom"
version = "0.2.16"
@ -436,7 +434,19 @@ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
dependencies = [
"cfg-if",
"libc",
"wasi 0.11.1+wasi-snapshot-preview1",
"wasi",
]
[[package]]
name = "getrandom"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasip2",
]
[[package]]
@ -454,21 +464,15 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.15.5"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash",
]
[[package]]
name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
[[package]]
name = "heck"
version = "0.5.0"
@ -513,7 +517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2"
dependencies = [
"equivalent",
"hashbrown 0.16.1",
"hashbrown",
]
[[package]]
@ -549,9 +553,9 @@ dependencies = [
[[package]]
name = "itertools"
version = "0.13.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"
dependencies = [
"either",
]
@ -562,6 +566,17 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
[[package]]
name = "kasuari"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bde5057d6143cc94e861d90f591b9303d6716c6b9602309150bd068853c10899"
dependencies = [
"hashbrown",
"portable-atomic",
"thiserror",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
@ -582,7 +597,15 @@ checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb"
dependencies = [
"bitflags",
"libc",
"redox_syscall",
]
[[package]]
name = "line-clipping"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f4de44e98ddbf09375cbf4d17714d18f39195f4f4894e8524501726fd9a8a4a"
dependencies = [
"bitflags",
]
[[package]]
@ -593,11 +616,11 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
[[package]]
name = "lru"
version = "0.12.5"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593"
dependencies = [
"hashbrown 0.15.5",
"hashbrown",
]
[[package]]
@ -626,12 +649,6 @@ dependencies = [
"windows-sys 0.45.0",
]
[[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.8.9"
@ -644,12 +661,26 @@ dependencies = [
[[package]]
name = "nom"
version = "7.1.3"
version = "8.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "num_threads"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
dependencies = [
"libc",
]
[[package]]
@ -660,13 +691,13 @@ checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f"
[[package]]
name = "object"
version = "0.36.7"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
checksum = "271638cd5fa9cca89c4c304675ca658efc4e64a66c716b7cfe1afb4b9611dbbc"
dependencies = [
"crc32fast",
"flate2",
"hashbrown 0.15.5",
"hashbrown",
"indexmap",
"memchr",
"ruzstd",
@ -678,12 +709,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "pbr"
version = "1.1.1"
@ -698,20 +723,20 @@ dependencies = [
[[package]]
name = "pkgar"
version = "0.2.1"
source = "git+https://gitlab.redox-os.org/redox-os/pkgar.git#b544d6b6612b58524de2ea9d857c5a349f1c99e2"
source = "git+https://gitlab.redox-os.org/redox-os/pkgar.git#8835aab69a164a5610737e6f595b9681db9fba0b"
dependencies = [
"blake3",
"bytemuck",
"lzma-rust2",
"pkgar-core",
"pkgar-keys",
"thiserror 2.0.17",
"thiserror",
]
[[package]]
name = "pkgar-core"
version = "0.2.1"
source = "git+https://gitlab.redox-os.org/redox-os/pkgar.git#b544d6b6612b58524de2ea9d857c5a349f1c99e2"
source = "git+https://gitlab.redox-os.org/redox-os/pkgar.git#8835aab69a164a5610737e6f595b9681db9fba0b"
dependencies = [
"bitflags",
"blake3",
@ -722,7 +747,7 @@ dependencies = [
[[package]]
name = "pkgar-keys"
version = "0.2.1"
source = "git+https://gitlab.redox-os.org/redox-os/pkgar.git#b544d6b6612b58524de2ea9d857c5a349f1c99e2"
source = "git+https://gitlab.redox-os.org/redox-os/pkgar.git#8835aab69a164a5610737e6f595b9681db9fba0b"
dependencies = [
"dirs",
"hex",
@ -731,10 +756,22 @@ dependencies = [
"seckey",
"serde",
"termion",
"thiserror 2.0.17",
"thiserror",
"toml",
]
[[package]]
name = "portable-atomic"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "proc-macro2"
version = "1.0.103"
@ -754,33 +791,80 @@ dependencies = [
]
[[package]]
name = "rand_core"
version = "0.6.4"
name = "r-efi"
version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rand_core"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
dependencies = [
"getrandom 0.2.16",
"getrandom 0.3.4",
]
[[package]]
name = "ratatui"
version = "0.29.0"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
checksum = "d1ce67fb8ba4446454d1c8dbaeda0557ff5e94d39d5e5ed7f10a65eb4c8266bc"
dependencies = [
"instability",
"ratatui-core",
"ratatui-termion",
"ratatui-widgets",
]
[[package]]
name = "ratatui-core"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ef8dea09a92caaf73bff7adb70b76162e5937524058a7e5bff37869cbbec293"
dependencies = [
"bitflags",
"cassowary",
"compact_str",
"hashbrown",
"indoc",
"itertools",
"kasuari",
"lru",
"strum",
"thiserror",
"unicode-segmentation",
"unicode-truncate",
"unicode-width",
]
[[package]]
name = "ratatui-termion"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cade85a8591fbc911e147951422f0d6fd40f4948b271b6216c7dc01838996f8"
dependencies = [
"instability",
"ratatui-core",
"termion",
]
[[package]]
name = "ratatui-widgets"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7dbfa023cd4e604c2553483820c5fe8aa9d71a42eea5aa77c6e7f35756612db"
dependencies = [
"bitflags",
"hashbrown",
"indoc",
"instability",
"itertools",
"lru",
"paste",
"line-clipping",
"ratatui-core",
"strum",
"termion",
"time",
"unicode-segmentation",
"unicode-truncate",
"unicode-width 0.2.0",
"unicode-width",
]
[[package]]
@ -796,13 +880,13 @@ dependencies = [
[[package]]
name = "redox-pkg"
version = "0.3.0"
source = "git+https://gitlab.redox-os.org/redox-os/pkgutils.git#80e0196ef0ef940ca2b243d3c10ffecbd37f11cc"
source = "git+https://gitlab.redox-os.org/redox-os/pkgutils.git#e46f60d7be2341ccee2ea3cae6e7a4ac27aa8744"
dependencies = [
"hex",
"ignore",
"serde",
"serde_derive",
"thiserror 1.0.69",
"thiserror",
"toml",
]
@ -835,26 +919,16 @@ dependencies = [
[[package]]
name = "redox_installer"
version = "0.2.37"
source = "git+https://gitlab.redox-os.org/redox-os/installer.git#990d9d343eefbcdc4cecc5f204164b69cc70de41"
version = "0.2.42"
source = "git+https://gitlab.redox-os.org/redox-os/installer.git#0ace1223e41f08602d5622957d017b1ab3deac68"
dependencies = [
"anyhow",
"libc",
"libredox",
"arg_parser",
"serde",
"serde_derive",
"toml",
]
[[package]]
name = "redox_syscall"
version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
dependencies = [
"bitflags",
]
[[package]]
name = "redox_users"
version = "0.5.2"
@ -863,13 +937,13 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
dependencies = [
"getrandom 0.2.16",
"libredox",
"thiserror 2.0.17",
"thiserror",
]
[[package]]
name = "redoxer"
version = "0.2.62"
source = "git+https://gitlab.redox-os.org/redox-os/redoxer.git#4a68a03d517015b2776284a99609d01d3373fa28"
version = "0.2.63"
source = "git+https://gitlab.redox-os.org/redox-os/redoxer.git#67af2b7543ff8fb2eaba6699ac9d331dfe2d0f8c"
dependencies = [
"anyhow",
"dirs",
@ -922,9 +996,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "ruzstd"
version = "0.7.3"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fad02996bfc73da3e301efe90b1837be9ed8f4a462b6ed410aa35d00381de89f"
checksum = "e5ff0cc5e135c8870a775d3320910cd9b564ec036b4dc0b8741629020be63f01"
dependencies = [
"twox-hash",
]
@ -955,11 +1029,10 @@ dependencies = [
[[package]]
name = "seckey"
version = "0.11.2"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33b371a3e46636d13277af1daacbecb6f5acbe653bd378a4822ecd1c67790fbb"
checksum = "cd64b8649b6038d9ea27fde99aeded1c5571c00af18a6bc54ed6c1e01d7d2083"
dependencies = [
"getrandom 0.1.16",
"memsec",
]
@ -1056,23 +1129,22 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "strum"
version = "0.26.3"
version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf"
dependencies = [
"strum_macros",
]
[[package]]
name = "strum_macros"
version = "0.26.4"
version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7"
dependencies = [
"heck",
"proc-macro2",
"quote",
"rustversion",
"syn",
]
@ -1103,33 +1175,13 @@ dependencies = [
"numtoa",
]
[[package]]
name = "thiserror"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [
"thiserror-impl 1.0.69",
]
[[package]]
name = "thiserror"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
dependencies = [
"thiserror-impl 2.0.17",
]
[[package]]
name = "thiserror-impl"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
"syn",
"thiserror-impl",
]
[[package]]
@ -1143,6 +1195,27 @@ dependencies = [
"syn",
]
[[package]]
name = "time"
version = "0.3.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d"
dependencies = [
"deranged",
"libc",
"num-conv",
"num_threads",
"powerfmt",
"serde",
"time-core",
]
[[package]]
name = "time-core"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b"
[[package]]
name = "toml"
version = "0.8.23"
@ -1186,13 +1259,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
[[package]]
name = "twox-hash"
version = "1.6.3"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [
"cfg-if",
"static_assertions",
]
checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c"
[[package]]
name = "typenum"
@ -1214,21 +1283,15 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]]
name = "unicode-truncate"
version = "1.1.0"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf"
checksum = "16b380a1238663e5f8a691f9039c73e1cdae598a30e9855f541d29b08b53e9a5"
dependencies = [
"itertools",
"unicode-segmentation",
"unicode-width 0.1.14",
"unicode-width",
]
[[package]]
name = "unicode-width"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
[[package]]
name = "unicode-width"
version = "0.2.0"
@ -1260,18 +1323,21 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
name = "wasip2"
version = "1.0.2+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
dependencies = [
"wit-bindgen",
]
[[package]]
name = "winapi"
version = "0.3.9"
@ -1393,6 +1459,12 @@ dependencies = [
"memchr",
]
[[package]]
name = "wit-bindgen"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
[[package]]
name = "zeroize"
version = "1.8.2"

View File

@ -35,7 +35,7 @@ blake3 = "1"
globset = "0.4"
libc = "0.2"
ignore = "0.4"
object = { version = "0.36", features = ["build_core"] }
object = { version = "0.38", features = ["build_core"] }
pbr = "1.0.2"
pkgar = { git = "https://gitlab.redox-os.org/redox-os/pkgar.git" }
pkgar-core = { git = "https://gitlab.redox-os.org/redox-os/pkgar.git" }
@ -48,11 +48,11 @@ serde = { version = "=1.0.197", features = ["derive"] }
termion = "4"
toml = "0.8"
walkdir = "2.3.1"
ansi-to-tui = { version = "7.0.0", optional = true }
ansi-to-tui = { version = "8", optional = true }
strip-ansi-escapes = { version = "0.2.1", optional = true }
[dependencies.ratatui]
version = "0.29.0"
version = "0.30"
default-features = false
features = ["termion"]
optional = true

View File

@ -26,7 +26,7 @@ image-tree: $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@$(REPO_BIN) push-tree $(COOKBOOK_OPTS) --with-package-deps
@$(REPO_BIN) push-tree $(COOKBOOK_OPTS)
endif
# Clean specific target to all recipes, similar to repo_clean but more specific
@ -133,10 +133,6 @@ ifeq ($(ALLOW_FSTOOLS),1)
fi
endif
# Push compiled package with their package dependencies
pp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) p.$*,--with-package-deps
# Show what to push
pt.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
@ -145,10 +141,6 @@ else
$(REPO_BIN) push-tree $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
endif
# Show what to push (with deps)
ppt.%: prefix $(FSTOOLS_TAG) FORCE
$(MAKE) pt.$*,--with-package-deps
# Push all recipes specified by the filesystem config
push: $(FSTOOLS_TAG) FORCE
ifeq ($(ALLOW_FSTOOLS),1)
@ -170,6 +162,12 @@ ifeq ($(ALLOW_FSTOOLS),1)
fi
endif
# Rebuild and push all recipes specified by the filesystem config
rebuild-push: $(FSTOOLS_TAG) FORCE
rm -f $(REPO_TAG)
$(MAKE) repo
$(MAKE) push
# Invoke unfetch for one or more targets separated by comma
u.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
@ -217,17 +215,17 @@ endif
# Invoke repo.sh and push for one of more targets separated by comma
# Don't use podman here, as the p target cannot mount inside podman
rp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) r.$*
$(MAKE) r.$*,--with-package-deps
$(MAKE) p.$*
# Invoke clean, repo.sh and push for one of more targets separated by comma
crp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) cr.$*
$(MAKE) cr.$*,--with-package-deps
$(MAKE) p.$*
# Invoke unfetch. clean, repo.sh and push for one of more targets separated by comma
ucrp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) ucr.$*
$(MAKE) ucr.$*,--with-package-deps
$(MAKE) p.$*
export DEBUG_BIN?=

View File

@ -5,13 +5,13 @@ use cookbook::cook::cook_build::{build, get_stage_dirs, remove_stage_dir};
use cookbook::cook::fetch::{fetch, fetch_offline};
use cookbook::cook::fs::{create_target_dir, run_command};
use cookbook::cook::ident;
use cookbook::cook::package::package;
use cookbook::cook::package::{package, package_handle_push};
use cookbook::cook::pty::{PtyOut, UnixSlavePty, flush_pty, setup_pty};
use cookbook::cook::script::KILL_ALL_PID;
use cookbook::cook::tree::{self, WalkTreeEntry};
use cookbook::log_to_pty;
use cookbook::recipe::{CookRecipe, recipes_flatten_package_names, recipes_mark_as_deps};
use pkg::PackageName;
use pkg::{PackageName, PackageState};
use ratatui::Terminal;
use ratatui::layout::{Constraint, Direction, Layout, Position, Rect};
use ratatui::prelude::TermionBackend;
@ -57,7 +57,7 @@ const REPO_HELP_STR: &str = r#"
--repo=<repo_dir> the "repo" folder, default to $PWD/repo
--sysroot=<sysroot_dir> the "root" folder used for "push" command
For Redox, defaults to "/", else default to $PWD/sysroot
--with-package-deps include package deps
--with-package-deps include package deps (always implied in push command)
--all apply to all recipes in <cookbook_dir>
--category=<category> apply to all recipes in <cookbook_dir>/<category>
--filesystem=<filesystem> override recipes config using installer file
@ -348,7 +348,7 @@ fn repo_inner(
let (status_tx, status_rx) = mpsc::channel::<StatusUpdate>();
let (mut stdout_writer, mut stderr_writer) = setup_logger(&status_tx, &recipe.name);
let mut app = TuiApp::new(vec![recipe.clone()]);
app.dump_logs_anyway = config.cook.verbose || !config.cook.nonstop;
app.dump_logs_anyway = config.cook.verbose;
let dump_fail_logs = !app.dump_logs_anyway;
let th = thread::spawn(move || {
while let Ok(update) = status_rx.recv() {
@ -480,11 +480,6 @@ fn parse_args(args: Vec<String>) -> anyhow::Result<(CliConfig, CliCommand, Vec<C
fs::create_dir_all(c.join(redoxer::target())).map_err(|e| anyhow!(e))?;
fs::create_dir_all(c.join(redoxer::host_target())).map_err(|e| anyhow!(e))?;
}
if override_filesystem_repo_binary {
if let Some(conf) = config.filesystem.as_mut() {
conf.general.repo_binary = Some(true);
}
}
let command = command.ok_or(anyhow!("Error: No command specified."))?;
let command: CliCommand = str::parse(&command)?;
@ -552,7 +547,7 @@ fn parse_args(args: Vec<String>) -> anyhow::Result<(CliConfig, CliCommand, Vec<C
}
let mut recipes = if let Some(conf) = config.filesystem.as_ref() {
let repo_binary = conf.general.repo_binary == Some(true);
let repo_binary = override_filesystem_repo_binary;
// Expand deps for "source" + "local" and "binary"
// This is the complete map from filesystem config
@ -606,48 +601,46 @@ fn parse_args(args: Vec<String>) -> anyhow::Result<(CliConfig, CliCommand, Vec<C
}
}
if config.with_package_deps {
if config.with_package_deps || command.is_pushing() {
source_recipe_names =
CookRecipe::get_package_deps_recursive(&source_recipe_names, true)?;
binary_recipe_names =
CookRecipe::get_package_deps_recursive(&binary_recipe_names, true)?;
}
let mut recipes =
if command.is_building() || (command.is_pushing() && config.with_package_deps) {
// Pushing do not need dev deps, so does binary recipes at building
let include_dev = command.is_building();
if include_dev && default_rule == "source" {
// let's cover a very specific case, binary -> source -> binary -> dev
// in this case, we need to move that "source" to "binary", because
// that would include dev from its binary child, which is unnecessary
let mut i = 0;
while i < source_recipe_names.len() {
let name = &source_recipe_names[i];
match special_rules.get(name) {
Some(s) if s.as_str() == "source" => {
if binary_names.contains(name) {
let bin = source_recipe_names.remove(i);
binary_recipe_names.push(bin);
continue;
}
let mut recipes = if command.is_building() || command.is_pushing() {
// Pushing do not need dev deps, so does binary recipes at building
let include_dev = command.is_building();
if include_dev && default_rule == "source" {
// let's cover a very specific case, binary -> source -> binary -> dev
// in this case, we need to move that "source" to "binary", because
// that would include dev from its binary child, which is unnecessary
let mut i = 0;
while i < source_recipe_names.len() {
let name = &source_recipe_names[i];
match special_rules.get(name) {
Some(s) if s.as_str() == "source" => {
if binary_names.contains(name) {
let bin = source_recipe_names.remove(i);
binary_recipe_names.push(bin);
continue;
}
_ => {}
}
i += 1;
_ => {}
}
i += 1;
}
CookRecipe::get_build_deps_recursive(&source_recipe_names, include_dev)?
} else {
CookRecipe::from_list(source_recipe_names.clone())?
};
}
CookRecipe::get_build_deps_recursive(&source_recipe_names, include_dev)?
} else {
CookRecipe::from_list(source_recipe_names.clone())?
};
let binary_recipes =
if command.is_building() || (command.is_pushing() && config.with_package_deps) {
CookRecipe::get_build_deps_recursive(&binary_recipe_names, false)?
} else {
CookRecipe::from_list(binary_recipe_names.clone())?
};
let binary_recipes = if command.is_building() || command.is_pushing() {
CookRecipe::get_build_deps_recursive(&binary_recipe_names, false)?
} else {
CookRecipe::from_list(binary_recipe_names.clone())?
};
let ignore_recipes = CookRecipe::from_list(ignore_recipe_names.clone())?;
@ -682,10 +675,10 @@ fn parse_args(args: Vec<String>) -> anyhow::Result<(CliConfig, CliCommand, Vec<C
recipes
} else {
if config.with_package_deps {
if config.with_package_deps || command.is_pushing() {
recipe_names = CookRecipe::get_package_deps_recursive(&recipe_names, true)?;
}
if command.is_building() || (command.is_pushing() && config.with_package_deps) {
if command.is_building() || command.is_pushing() {
let include_dev = command.is_building();
CookRecipe::get_build_deps_recursive(&recipe_names, include_dev)?
} else {
@ -693,7 +686,7 @@ fn parse_args(args: Vec<String>) -> anyhow::Result<(CliConfig, CliCommand, Vec<C
}
};
if command.is_pushing() || !config.with_package_deps {
if !config.with_package_deps || command.is_informational() {
// In CliCommand::Cook, is_deps==true will make it skip checking source
recipes_mark_as_deps(&recipe_names, &mut recipes);
}
@ -794,82 +787,67 @@ fn handle_push(recipes: &Vec<CookRecipe>, config: &CliConfig) -> anyhow::Result<
let recipe_map: HashMap<&PackageName, &CookRecipe> =
recipes.iter().map(|r| (&r.name, r)).collect();
let mut total_size: u64 = 0;
let mut total_count: u64 = 0;
let mut visited: HashSet<PackageName> = HashSet::new();
let roots: Vec<&CookRecipe> = recipes.iter().filter(|r| !r.is_deps).collect();
let num_roots = roots.len();
let num_recipes = recipes.len();
PUSH_SYSROOT_DIR.set(config.sysroot_dir.clone()).unwrap();
let handle_push_inner = move |package_name: &PackageName,
_prefix: &str,
_is_last: bool,
entry: &WalkTreeEntry|
-> anyhow::Result<()> {
let public_path = "build/id_ed25519.pub.toml";
-> anyhow::Result<bool> {
let r = match entry {
WalkTreeEntry::Built(archive_path, _) => {
let sysroot_dir = PUSH_SYSROOT_DIR.get().unwrap();
pkgar::extract(public_path, archive_path.as_path(), sysroot_dir).context(format!(
"failed to install '{}' in '{}'",
archive_path.display(),
sysroot_dir.display(),
))
let install_path = PUSH_SYSROOT_DIR.get().unwrap();
let mut state =
PackageState::from_sysroot(install_path).map_err(|e| anyhow!("{e:?}"))?;
let r = package_handle_push(&mut state, archive_path, &install_path, false)
.map_err(|e| anyhow!("{e:?}"));
if matches!(r, Ok(false)) {
state.to_sysroot(install_path)?;
}
r
}
WalkTreeEntry::NotBuilt => Err(anyhow!(
"Package {} has not been built",
package_name.name()
)),
WalkTreeEntry::Deduped | WalkTreeEntry::Missing => {
return Ok(());
// does not matter
return Ok(false);
}
};
match r {
Ok(()) => {
Ok(true) => {
print_cached(&CliCommand::Push, Some(package_name));
Ok(true)
}
Ok(false) => {
print_success(&CliCommand::Push, Some(package_name));
Ok(())
Ok(false)
}
Err(e) => {
print_failed(&CliCommand::Push, package_name);
if get_config().cook.nonstop {
Ok(())
Ok(true)
} else {
Err(e)
}
}
}
};
if config.with_package_deps {
for (i, root) in roots.iter().enumerate() {
tree::walk_tree_entry(
&root.name,
&recipe_map,
"",
i == num_roots - 1,
false,
&mut visited,
&mut total_size,
handle_push_inner,
)?;
}
} else {
for (i, root) in roots.iter().enumerate() {
let archive_path = config
.repo_dir
.join(redoxer::target())
.join(format!("{}.pkgar", root.name));
let metadata = std::fs::metadata(&archive_path);
handle_push_inner(
&root.name,
"",
i == num_roots - 1,
&match metadata {
Ok(m) => {
total_size += m.len();
visited.insert(root.name.clone());
WalkTreeEntry::Built(&archive_path, m.len())
}
Err(_) => WalkTreeEntry::NotBuilt,
},
)?;
}
for (i, recipe) in recipes.iter().enumerate() {
tree::walk_tree_entry(
&recipe.name,
&recipe_map,
"",
i == num_recipes - 1,
false,
&mut visited,
&mut total_size,
&mut total_count,
handle_push_inner,
)?;
}
if config.cook.verbose {
@ -877,8 +855,8 @@ fn handle_push(recipes: &Vec<CookRecipe>, config: &CliConfig) -> anyhow::Result<
println!(
"Pushed {} of {} {}",
tree::format_size(total_size),
visited.len(),
if visited.len() == 1 {
total_count,
if total_count == 1 {
"package"
} else {
"packages"
@ -897,6 +875,7 @@ fn handle_tree(
let recipe_map: HashMap<&PackageName, &CookRecipe> =
recipes.iter().map(|r| (&r.name, r)).collect();
let mut total_size: u64 = 0;
let mut total_count: u64 = 0;
let mut visited: HashSet<PackageName> = HashSet::new();
let roots: Vec<&CookRecipe> = recipes.iter().filter(|r| !r.is_deps).collect();
let num_roots = roots.len();
@ -909,6 +888,7 @@ fn handle_tree(
is_build_tree,
&mut visited,
&mut total_size,
&mut total_count,
)?;
}

View File

@ -12,6 +12,7 @@ use walkdir::{DirEntry, WalkDir};
use crate::{
config::translate_mirror,
cook::pty::{PtyOut, spawn_to_pipe},
wrap_io_err,
};
//TODO: pub(crate) for all of these functions
@ -314,6 +315,10 @@ pub fn download_wget(url: &str, dest: &PathBuf, logger: &PtyOut) -> Result<(), S
Ok(())
}
pub fn read_to_string(path: &Path) -> crate::Result<String> {
fs::read_to_string(path).map_err(wrap_io_err!(path, "Reading file to string"))
}
/// get commit rev and return if it's detached or not
pub fn get_git_head_rev(dir: &PathBuf) -> Result<(String, bool), String> {
let git_head = dir.join(".git/HEAD");

View File

@ -3,7 +3,7 @@ use std::{
path::{Path, PathBuf},
};
use pkg::{Package, PackageName, PackagePrefix};
use pkg::{InstallState, Package, PackageName, PackagePrefix, PackageState};
use pkgar::ext::PackageSrcExt;
use pkgar_core::HeaderFlags;
@ -158,7 +158,7 @@ pub fn package_toml(
.map_err(|e| format!("Unable to get lzma entry: {e}"))?;
for entry in entries {
let data_reader = package
.data_reader(entry)
.data_reader(&entry)
.map_err(|e| format!("Unable to read lzma entry: {e}"))?;
size += data_reader.unpacked_size;
package
@ -252,3 +252,48 @@ fn get_package_name_inner(name: &str, package: Option<&str>) -> String {
}
prefix_name
}
pub fn package_handle_push(
state: &mut PackageState,
archive_path: &Path,
sysroot_dir: &Path,
reinstall: bool,
) -> crate::Result<bool> {
let archive_toml = archive_path.with_extension("toml");
let pkey_path = "build/id_ed25519.pub.toml";
let pkg_toml = Package::from_file(&archive_toml)?;
match state.installed.get(&pkg_toml.name) {
Some(s) if !reinstall && pkg_toml.blake3 == s.blake3 => Ok(true),
Some(s) => {
// "local" is what remote name from installer is hardcoded into
let remote_name = "local".to_string();
let install_state =
InstallState::from_package(&pkg_toml, remote_name, s.manual, s.dependents.clone());
// TODO: use pkgar::replace unless forced reinstall
pkgar::extract(pkey_path, &archive_path, sysroot_dir)?;
state.installed.insert(pkg_toml.name.clone(), install_state);
Ok(false)
}
None => {
// "local" is what remote name from installer is hardcoded into
let remote_name = "local".to_string();
// TODO: Handle manual & depedents
let install_state =
InstallState::from_package(&pkg_toml, remote_name, true, BTreeSet::new());
pkgar::extract(pkey_path, &archive_path, sysroot_dir)?;
// TODO: Inject dependencies
// TODO: Check if we need to inject remote key
state.installed.insert(pkg_toml.name.clone(), install_state);
Ok(false)
}
}
}

View File

@ -24,6 +24,7 @@ pub fn display_tree_entry(
is_build_tree: bool,
visited: &mut HashSet<PackageName>,
total_size: &mut u64,
total_count: &mut u64,
) -> anyhow::Result<()> {
walk_tree_entry(
package_name,
@ -33,6 +34,7 @@ pub fn display_tree_entry(
is_build_tree,
visited,
total_size,
total_count,
display_pkg_fn,
)
}
@ -45,7 +47,8 @@ pub fn walk_tree_entry(
is_build_tree: bool,
visited: &mut HashSet<PackageName>,
total_size: &mut u64,
op: fn(&PackageName, &str, bool, &WalkTreeEntry) -> anyhow::Result<()>,
total_count: &mut u64,
op: fn(&PackageName, &str, bool, &WalkTreeEntry) -> anyhow::Result<bool>,
) -> anyhow::Result<()> {
let cook_recipe = match recipe_map.get(package_name) {
Some(r) => r,
@ -65,21 +68,24 @@ pub fn walk_tree_entry(
(Err(_), _) => WalkTreeEntry::NotBuilt,
};
op(package_name, prefix, is_last, &entry)?;
let cached = op(package_name, prefix, is_last, &entry)?;
if deduped {
if deduped || cached {
return Ok(());
}
visited.insert(package_name.clone());
if is_build_tree {
if matches!(entry, WalkTreeEntry::NotBuilt) {
*total_size += 1;
}
} else {
if let WalkTreeEntry::Built(_p, pkg_size) = &entry {
*total_size += pkg_size;
if !cached {
if is_build_tree {
if matches!(entry, WalkTreeEntry::NotBuilt) {
*total_size += 1;
}
} else {
if let WalkTreeEntry::Built(_p, pkg_size) = &entry {
*total_size += pkg_size;
}
}
*total_count += 1;
}
let pkg_meta: Package;
@ -112,6 +118,7 @@ pub fn walk_tree_entry(
is_build_tree,
visited,
total_size,
total_count,
op,
)?;
}
@ -124,7 +131,7 @@ pub fn display_pkg_fn(
prefix: &str,
is_last: bool,
entry: &WalkTreeEntry,
) -> anyhow::Result<()> {
) -> anyhow::Result<bool> {
let size_str = match entry {
WalkTreeEntry::Built(_path_buf, size) => format!("[{}]", format_size(*size)),
WalkTreeEntry::NotBuilt => "(not built)".to_string(),
@ -133,7 +140,8 @@ pub fn display_pkg_fn(
};
let line_prefix = if is_last { "└── " } else { "├── " };
println!("{}{}{} {}", prefix, line_prefix, package_name, size_str);
Ok(())
// TODO: check dirty build by checking source ident
Ok(false)
}
pub fn walk_file_tree(dir: &PathBuf, prefix: &str, buffer: &mut String) -> std::io::Result<u64> {

View File

@ -15,3 +15,70 @@ pub const REMOTE_PKG_SOURCE: &str = "https://static.redox-os.org/pkg";
pub fn is_redox() -> bool {
cfg!(target_os = "redox")
}
// Errors
use std::io;
use std::path::PathBuf;
#[derive(Debug)]
pub enum Error {
Io {
source: io::Error,
path: Option<PathBuf>,
context: &'static str,
},
Package(pkg::PackageError),
Pkgar(pkgar::Error),
Other(String),
}
macro_rules! wrap_io_err {
($context:expr) => {
|source| crate::Error::Io {
source,
path: None,
context: $context,
}
};
($path:expr, $context:expr) => {
|source| crate::Error::Io {
source,
path: Some($path.to_path_buf()),
context: $context,
}
};
}
impl From<String> for Error {
fn from(value: String) -> Self {
Error::Other(value)
}
}
impl From<pkg::PackageError> for Error {
fn from(value: pkg::PackageError) -> Self {
Error::Package(value)
}
}
impl From<pkgar::Error> for Error {
fn from(value: pkgar::Error) -> Self {
match value {
pkgar::Error::Io {
source,
path,
context,
} => Error::Io {
source,
path,
context,
},
_ => Error::Pkgar(value),
}
}
}
pub(crate) type Result<T> = std::result::Result<T, Error>;
pub(crate) use wrap_io_err;

View File

@ -7,10 +7,7 @@ use std::{
use pkg::{PackageError, PackageName, recipes};
use regex::Regex;
use serde::{
Deserialize, Serialize,
de::{Error as DeErrorT, value::Error as DeError},
};
use serde::{Deserialize, Serialize};
use crate::{WALK_DEPTH, cook::package as cook_package};
@ -198,9 +195,9 @@ impl Recipe {
return Err(PackageError::FileMissing(file.clone()));
}
let toml = fs::read_to_string(&file)
.map_err(|err| PackageError::Parse(DeError::custom(err), Some(file.clone())))?;
let recipe: Recipe = toml::from_str(&toml)
.map_err(|err| PackageError::Parse(DeError::custom(err), Some(file.clone())))?;
.map_err(|err| PackageError::FileError(err.raw_os_error(), file.clone()))?;
let recipe: Recipe =
toml::from_str(&toml).map_err(|err| PackageError::Parse(err, Some(file.clone())))?;
Ok(recipe)
}