From 75124670d63cb3c392aca44a4230d88f9d7d2b02 Mon Sep 17 00:00:00 2001 From: Rob Hand <146272+sinon@users.noreply.github.com> Date: Mon, 15 Sep 2025 22:15:20 +0100 Subject: [PATCH] Initial buck2 adoption, get CLI building --- .buckconfig | 26 + .buckroot | 0 .gitignore | 4 +- BUCK | 11 + crates/pngme/BUCK | 12 + third-party/rust/BUCK | 722 ++++++++++++++++++ third-party/rust/Cargo.lock | 312 ++++++++ third-party/rust/Cargo.toml | 31 + .../rust/fixups/proc-macro2/fixups.toml | 1 + .../fixups/windows_x86_64_gnu/fixups.toml | 1 + .../fixups/windows_x86_64_msvc/fixups.toml | 1 + third-party/rust/reindeer.toml | 24 + toolchains/BUCK | 5 + 13 files changed, 1149 insertions(+), 1 deletion(-) create mode 100644 .buckconfig create mode 100644 .buckroot create mode 100644 BUCK create mode 100644 crates/pngme/BUCK create mode 100644 third-party/rust/BUCK create mode 100644 third-party/rust/Cargo.lock create mode 100644 third-party/rust/Cargo.toml create mode 100644 third-party/rust/fixups/proc-macro2/fixups.toml create mode 100644 third-party/rust/fixups/windows_x86_64_gnu/fixups.toml create mode 100644 third-party/rust/fixups/windows_x86_64_msvc/fixups.toml create mode 100644 third-party/rust/reindeer.toml create mode 100644 toolchains/BUCK diff --git a/.buckconfig b/.buckconfig new file mode 100644 index 0000000..0b3f81e --- /dev/null +++ b/.buckconfig @@ -0,0 +1,26 @@ +[cells] + root = . + prelude = prelude + toolchains = toolchains + none = none + +[cell_aliases] + config = prelude + ovr_config = prelude + fbcode = none + fbsource = none + fbcode_macros = none + buck = none + +# Uses a copy of the prelude bundled with the buck2 binary. You can alternatively delete this +# section and vendor a copy of the prelude to the `prelude` directory of your project. +[external_cells] + prelude = bundled + +[parser] + target_platform_detector_spec = target:root//...->prelude//platforms:default \ + target:prelude//...->prelude//platforms:default \ + target:toolchains//...->prelude//platforms:default + +[build] + execution_platforms = prelude//platforms:default diff --git a/.buckroot b/.buckroot new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore index 579fd5a..cc1a439 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,6 @@ target/ .venv/ __pycache__/ -.pytest_cache/ \ No newline at end of file +.pytest_cache/ + +buck-out/ \ No newline at end of file diff --git a/BUCK b/BUCK new file mode 100644 index 0000000..7bad8ad --- /dev/null +++ b/BUCK @@ -0,0 +1,11 @@ +# A list of available rules and their signatures can be found here: https://buck2.build/docs/prelude/globals/ + +rust_binary( + name = "cli", + srcs = glob(["crates/pngme-cli/src/*.rs"]), + crate_root = "crates/pngme-cli/src/main.rs", + deps = [ + "root//crates/pngme:library", + "//third-party/rust:clap", + ], +) \ No newline at end of file diff --git a/crates/pngme/BUCK b/crates/pngme/BUCK new file mode 100644 index 0000000..b9afa1d --- /dev/null +++ b/crates/pngme/BUCK @@ -0,0 +1,12 @@ +rust_library( + name = "library", + crate = "pngme_lib", + srcs = glob(["src/**/*.rs"]), + crate_root = "src/lib.rs", + visibility = ["PUBLIC"], + deps = [ + "//third-party/rust:snafu", + "//third-party/rust:nom", + "//third-party/rust:crc", + ], +) \ No newline at end of file diff --git a/third-party/rust/BUCK b/third-party/rust/BUCK new file mode 100644 index 0000000..9dc8d57 --- /dev/null +++ b/third-party/rust/BUCK @@ -0,0 +1,722 @@ +## +## @generated by `reindeer buckify` +## Do not edit by hand. +## + +load("@prelude//rust:cargo_buildscript.bzl", "buildscript_run") +load("@prelude//rust:cargo_package.bzl", "cargo") + +http_archive( + name = "anstream-0.6.20.crate", + sha256 = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192", + strip_prefix = "anstream-0.6.20", + urls = ["https://static.crates.io/crates/anstream/0.6.20/download"], + visibility = [], +) + +cargo.rust_library( + name = "anstream-0.6.20", + srcs = [":anstream-0.6.20.crate"], + crate = "anstream", + crate_root = "anstream-0.6.20.crate/src/lib.rs", + edition = "2021", + features = [ + "auto", + "default", + "wincon", + ], + platform = { + "windows-gnu": dict( + deps = [":anstyle-wincon-3.0.10"], + ), + "windows-msvc": dict( + deps = [":anstyle-wincon-3.0.10"], + ), + }, + visibility = [], + deps = [ + ":anstyle-1.0.11", + ":anstyle-parse-0.2.7", + ":anstyle-query-1.1.4", + ":colorchoice-1.0.4", + ":is_terminal_polyfill-1.70.1", + ":utf8parse-0.2.2", + ], +) + +http_archive( + name = "anstyle-1.0.11.crate", + sha256 = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd", + strip_prefix = "anstyle-1.0.11", + urls = ["https://static.crates.io/crates/anstyle/1.0.11/download"], + visibility = [], +) + +cargo.rust_library( + name = "anstyle-1.0.11", + srcs = [":anstyle-1.0.11.crate"], + crate = "anstyle", + crate_root = "anstyle-1.0.11.crate/src/lib.rs", + edition = "2021", + features = [ + "default", + "std", + ], + visibility = [], +) + +http_archive( + name = "anstyle-parse-0.2.7.crate", + sha256 = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2", + strip_prefix = "anstyle-parse-0.2.7", + urls = ["https://static.crates.io/crates/anstyle-parse/0.2.7/download"], + visibility = [], +) + +cargo.rust_library( + name = "anstyle-parse-0.2.7", + srcs = [":anstyle-parse-0.2.7.crate"], + crate = "anstyle_parse", + crate_root = "anstyle-parse-0.2.7.crate/src/lib.rs", + edition = "2021", + features = [ + "default", + "utf8", + ], + visibility = [], + deps = [":utf8parse-0.2.2"], +) + +http_archive( + name = "anstyle-query-1.1.4.crate", + sha256 = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2", + strip_prefix = "anstyle-query-1.1.4", + urls = ["https://static.crates.io/crates/anstyle-query/1.1.4/download"], + visibility = [], +) + +cargo.rust_library( + name = "anstyle-query-1.1.4", + srcs = [":anstyle-query-1.1.4.crate"], + crate = "anstyle_query", + crate_root = "anstyle-query-1.1.4.crate/src/lib.rs", + edition = "2021", + platform = { + "windows-gnu": dict( + deps = [":windows-sys-0.60.2"], + ), + "windows-msvc": dict( + deps = [":windows-sys-0.60.2"], + ), + }, + visibility = [], +) + +http_archive( + name = "anstyle-wincon-3.0.10.crate", + sha256 = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a", + strip_prefix = "anstyle-wincon-3.0.10", + urls = ["https://static.crates.io/crates/anstyle-wincon/3.0.10/download"], + visibility = [], +) + +cargo.rust_library( + name = "anstyle-wincon-3.0.10", + srcs = [":anstyle-wincon-3.0.10.crate"], + crate = "anstyle_wincon", + crate_root = "anstyle-wincon-3.0.10.crate/src/lib.rs", + edition = "2021", + visibility = [], + deps = [ + ":anstyle-1.0.11", + ":once_cell_polyfill-1.70.1", + ":windows-sys-0.60.2", + ], +) + +alias( + name = "clap", + actual = ":clap-4.5.47", + visibility = ["PUBLIC"], +) + +http_archive( + name = "clap-4.5.47.crate", + sha256 = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931", + strip_prefix = "clap-4.5.47", + urls = ["https://static.crates.io/crates/clap/4.5.47/download"], + visibility = [], +) + +cargo.rust_library( + name = "clap-4.5.47", + srcs = [":clap-4.5.47.crate"], + crate = "clap", + crate_root = "clap-4.5.47.crate/src/lib.rs", + edition = "2021", + features = [ + "color", + "default", + "derive", + "error-context", + "help", + "std", + "suggestions", + "usage", + ], + visibility = [], + deps = [ + ":clap_builder-4.5.47", + ":clap_derive-4.5.47", + ], +) + +http_archive( + name = "clap_builder-4.5.47.crate", + sha256 = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6", + strip_prefix = "clap_builder-4.5.47", + urls = ["https://static.crates.io/crates/clap_builder/4.5.47/download"], + visibility = [], +) + +cargo.rust_library( + name = "clap_builder-4.5.47", + srcs = [":clap_builder-4.5.47.crate"], + crate = "clap_builder", + crate_root = "clap_builder-4.5.47.crate/src/lib.rs", + edition = "2021", + features = [ + "color", + "error-context", + "help", + "std", + "suggestions", + "usage", + ], + visibility = [], + deps = [ + ":anstream-0.6.20", + ":anstyle-1.0.11", + ":clap_lex-0.7.5", + ":strsim-0.11.1", + ], +) + +http_archive( + name = "clap_derive-4.5.47.crate", + sha256 = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c", + strip_prefix = "clap_derive-4.5.47", + urls = ["https://static.crates.io/crates/clap_derive/4.5.47/download"], + visibility = [], +) + +cargo.rust_library( + name = "clap_derive-4.5.47", + srcs = [":clap_derive-4.5.47.crate"], + crate = "clap_derive", + crate_root = "clap_derive-4.5.47.crate/src/lib.rs", + edition = "2021", + features = ["default"], + proc_macro = True, + visibility = [], + deps = [ + ":heck-0.5.0", + ":proc-macro2-1.0.101", + ":quote-1.0.40", + ":syn-2.0.106", + ], +) + +http_archive( + name = "clap_lex-0.7.5.crate", + sha256 = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675", + strip_prefix = "clap_lex-0.7.5", + urls = ["https://static.crates.io/crates/clap_lex/0.7.5/download"], + visibility = [], +) + +cargo.rust_library( + name = "clap_lex-0.7.5", + srcs = [":clap_lex-0.7.5.crate"], + crate = "clap_lex", + crate_root = "clap_lex-0.7.5.crate/src/lib.rs", + edition = "2021", + visibility = [], +) + +http_archive( + name = "colorchoice-1.0.4.crate", + sha256 = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75", + strip_prefix = "colorchoice-1.0.4", + urls = ["https://static.crates.io/crates/colorchoice/1.0.4/download"], + visibility = [], +) + +cargo.rust_library( + name = "colorchoice-1.0.4", + srcs = [":colorchoice-1.0.4.crate"], + crate = "colorchoice", + crate_root = "colorchoice-1.0.4.crate/src/lib.rs", + edition = "2021", + visibility = [], +) + +alias( + name = "crc", + actual = ":crc-3.3.0", + visibility = ["PUBLIC"], +) + +http_archive( + name = "crc-3.3.0.crate", + sha256 = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675", + strip_prefix = "crc-3.3.0", + urls = ["https://static.crates.io/crates/crc/3.3.0/download"], + visibility = [], +) + +cargo.rust_library( + name = "crc-3.3.0", + srcs = [":crc-3.3.0.crate"], + crate = "crc", + crate_root = "crc-3.3.0.crate/src/lib.rs", + edition = "2021", + visibility = [], + deps = [":crc-catalog-2.4.0"], +) + +http_archive( + name = "crc-catalog-2.4.0.crate", + sha256 = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5", + strip_prefix = "crc-catalog-2.4.0", + urls = ["https://static.crates.io/crates/crc-catalog/2.4.0/download"], + visibility = [], +) + +cargo.rust_library( + name = "crc-catalog-2.4.0", + srcs = [":crc-catalog-2.4.0.crate"], + crate = "crc_catalog", + crate_root = "crc-catalog-2.4.0.crate/src/lib.rs", + edition = "2018", + visibility = [], +) + +http_archive( + name = "heck-0.5.0.crate", + sha256 = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea", + strip_prefix = "heck-0.5.0", + urls = ["https://static.crates.io/crates/heck/0.5.0/download"], + visibility = [], +) + +cargo.rust_library( + name = "heck-0.5.0", + srcs = [":heck-0.5.0.crate"], + crate = "heck", + crate_root = "heck-0.5.0.crate/src/lib.rs", + edition = "2021", + visibility = [], +) + +http_archive( + name = "is_terminal_polyfill-1.70.1.crate", + sha256 = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf", + strip_prefix = "is_terminal_polyfill-1.70.1", + urls = ["https://static.crates.io/crates/is_terminal_polyfill/1.70.1/download"], + visibility = [], +) + +cargo.rust_library( + name = "is_terminal_polyfill-1.70.1", + srcs = [":is_terminal_polyfill-1.70.1.crate"], + crate = "is_terminal_polyfill", + crate_root = "is_terminal_polyfill-1.70.1.crate/src/lib.rs", + edition = "2021", + features = ["default"], + visibility = [], +) + +http_archive( + name = "memchr-2.7.5.crate", + sha256 = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0", + strip_prefix = "memchr-2.7.5", + urls = ["https://static.crates.io/crates/memchr/2.7.5/download"], + visibility = [], +) + +cargo.rust_library( + name = "memchr-2.7.5", + srcs = [":memchr-2.7.5.crate"], + crate = "memchr", + crate_root = "memchr-2.7.5.crate/src/lib.rs", + edition = "2021", + features = [ + "alloc", + "std", + ], + visibility = [], +) + +http_archive( + name = "minimal-lexical-0.2.1.crate", + sha256 = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a", + strip_prefix = "minimal-lexical-0.2.1", + urls = ["https://static.crates.io/crates/minimal-lexical/0.2.1/download"], + visibility = [], +) + +cargo.rust_library( + name = "minimal-lexical-0.2.1", + srcs = [":minimal-lexical-0.2.1.crate"], + crate = "minimal_lexical", + crate_root = "minimal-lexical-0.2.1.crate/src/lib.rs", + edition = "2018", + features = ["std"], + visibility = [], +) + +alias( + name = "nom", + actual = ":nom-7.1.3", + visibility = ["PUBLIC"], +) + +http_archive( + name = "nom-7.1.3.crate", + sha256 = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a", + strip_prefix = "nom-7.1.3", + urls = ["https://static.crates.io/crates/nom/7.1.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "nom-7.1.3", + srcs = [":nom-7.1.3.crate"], + crate = "nom", + crate_root = "nom-7.1.3.crate/src/lib.rs", + edition = "2018", + features = [ + "alloc", + "default", + "std", + ], + visibility = [], + deps = [ + ":memchr-2.7.5", + ":minimal-lexical-0.2.1", + ], +) + +http_archive( + name = "once_cell_polyfill-1.70.1.crate", + sha256 = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad", + strip_prefix = "once_cell_polyfill-1.70.1", + urls = ["https://static.crates.io/crates/once_cell_polyfill/1.70.1/download"], + visibility = [], +) + +cargo.rust_library( + name = "once_cell_polyfill-1.70.1", + srcs = [":once_cell_polyfill-1.70.1.crate"], + crate = "once_cell_polyfill", + crate_root = "once_cell_polyfill-1.70.1.crate/src/lib.rs", + edition = "2021", + features = ["default"], + visibility = [], +) + +http_archive( + name = "proc-macro2-1.0.101.crate", + sha256 = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de", + strip_prefix = "proc-macro2-1.0.101", + urls = ["https://static.crates.io/crates/proc-macro2/1.0.101/download"], + visibility = [], +) + +cargo.rust_library( + name = "proc-macro2-1.0.101", + srcs = [":proc-macro2-1.0.101.crate"], + crate = "proc_macro2", + crate_root = "proc-macro2-1.0.101.crate/src/lib.rs", + edition = "2021", + env = { + "OUT_DIR": "$(location :proc-macro2-1.0.101-build-script-run[out_dir])", + }, + features = [ + "default", + "proc-macro", + ], + rustc_flags = ["@$(location :proc-macro2-1.0.101-build-script-run[rustc_flags])"], + visibility = [], + deps = [":unicode-ident-1.0.19"], +) + +cargo.rust_binary( + name = "proc-macro2-1.0.101-build-script-build", + srcs = [":proc-macro2-1.0.101.crate"], + crate = "build_script_build", + crate_root = "proc-macro2-1.0.101.crate/build.rs", + edition = "2021", + features = [ + "default", + "proc-macro", + ], + visibility = [], +) + +buildscript_run( + name = "proc-macro2-1.0.101-build-script-run", + package_name = "proc-macro2", + buildscript_rule = ":proc-macro2-1.0.101-build-script-build", + features = [ + "default", + "proc-macro", + ], + version = "1.0.101", +) + +http_archive( + name = "quote-1.0.40.crate", + sha256 = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d", + strip_prefix = "quote-1.0.40", + urls = ["https://static.crates.io/crates/quote/1.0.40/download"], + visibility = [], +) + +cargo.rust_library( + name = "quote-1.0.40", + srcs = [":quote-1.0.40.crate"], + crate = "quote", + crate_root = "quote-1.0.40.crate/src/lib.rs", + edition = "2018", + features = [ + "default", + "proc-macro", + ], + visibility = [], + deps = [":proc-macro2-1.0.101"], +) + +alias( + name = "snafu", + actual = ":snafu-0.8.9", + visibility = ["PUBLIC"], +) + +http_archive( + name = "snafu-0.8.9.crate", + sha256 = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2", + strip_prefix = "snafu-0.8.9", + urls = ["https://static.crates.io/crates/snafu/0.8.9/download"], + visibility = [], +) + +cargo.rust_library( + name = "snafu-0.8.9", + srcs = [":snafu-0.8.9.crate"], + crate = "snafu", + crate_root = "snafu-0.8.9.crate/src/lib.rs", + edition = "2018", + features = [ + "alloc", + "default", + "rust_1_61", + "rust_1_65", + "std", + ], + visibility = [], + deps = [":snafu-derive-0.8.9"], +) + +http_archive( + name = "snafu-derive-0.8.9.crate", + sha256 = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451", + strip_prefix = "snafu-derive-0.8.9", + urls = ["https://static.crates.io/crates/snafu-derive/0.8.9/download"], + visibility = [], +) + +cargo.rust_library( + name = "snafu-derive-0.8.9", + srcs = [":snafu-derive-0.8.9.crate"], + crate = "snafu_derive", + crate_root = "snafu-derive-0.8.9.crate/src/lib.rs", + edition = "2018", + features = ["rust_1_61"], + proc_macro = True, + visibility = [], + deps = [ + ":heck-0.5.0", + ":proc-macro2-1.0.101", + ":quote-1.0.40", + ":syn-2.0.106", + ], +) + +http_archive( + name = "strsim-0.11.1.crate", + sha256 = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f", + strip_prefix = "strsim-0.11.1", + urls = ["https://static.crates.io/crates/strsim/0.11.1/download"], + visibility = [], +) + +cargo.rust_library( + name = "strsim-0.11.1", + srcs = [":strsim-0.11.1.crate"], + crate = "strsim", + crate_root = "strsim-0.11.1.crate/src/lib.rs", + edition = "2015", + visibility = [], +) + +http_archive( + name = "syn-2.0.106.crate", + sha256 = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6", + strip_prefix = "syn-2.0.106", + urls = ["https://static.crates.io/crates/syn/2.0.106/download"], + visibility = [], +) + +cargo.rust_library( + name = "syn-2.0.106", + srcs = [":syn-2.0.106.crate"], + crate = "syn", + crate_root = "syn-2.0.106.crate/src/lib.rs", + edition = "2021", + features = [ + "clone-impls", + "default", + "derive", + "full", + "parsing", + "printing", + "proc-macro", + ], + visibility = [], + deps = [ + ":proc-macro2-1.0.101", + ":quote-1.0.40", + ":unicode-ident-1.0.19", + ], +) + +http_archive( + name = "unicode-ident-1.0.19.crate", + sha256 = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d", + strip_prefix = "unicode-ident-1.0.19", + urls = ["https://static.crates.io/crates/unicode-ident/1.0.19/download"], + visibility = [], +) + +cargo.rust_library( + name = "unicode-ident-1.0.19", + srcs = [":unicode-ident-1.0.19.crate"], + crate = "unicode_ident", + crate_root = "unicode-ident-1.0.19.crate/src/lib.rs", + edition = "2018", + visibility = [], +) + +http_archive( + name = "utf8parse-0.2.2.crate", + sha256 = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821", + strip_prefix = "utf8parse-0.2.2", + urls = ["https://static.crates.io/crates/utf8parse/0.2.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "utf8parse-0.2.2", + srcs = [":utf8parse-0.2.2.crate"], + crate = "utf8parse", + crate_root = "utf8parse-0.2.2.crate/src/lib.rs", + edition = "2018", + features = ["default"], + visibility = [], +) + +http_archive( + name = "windows-sys-0.60.2.crate", + sha256 = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb", + strip_prefix = "windows-sys-0.60.2", + urls = ["https://static.crates.io/crates/windows-sys/0.60.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "windows-sys-0.60.2", + srcs = [":windows-sys-0.60.2.crate"], + crate = "windows_sys", + crate_root = "windows-sys-0.60.2.crate/src/lib.rs", + edition = "2021", + features = [ + "Win32", + "Win32_Foundation", + "Win32_System", + "Win32_System_Console", + "default", + ], + visibility = [], + deps = [":windows-targets-0.53.3"], +) + +http_archive( + name = "windows-targets-0.53.3.crate", + sha256 = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91", + strip_prefix = "windows-targets-0.53.3", + urls = ["https://static.crates.io/crates/windows-targets/0.53.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "windows-targets-0.53.3", + srcs = [":windows-targets-0.53.3.crate"], + crate = "windows_targets", + crate_root = "windows-targets-0.53.3.crate/src/lib.rs", + edition = "2021", + platform = { + "windows-gnu": dict( + deps = [":windows_x86_64_gnu-0.53.0"], + ), + "windows-msvc": dict( + deps = [":windows_x86_64_msvc-0.53.0"], + ), + }, + visibility = [], +) + +http_archive( + name = "windows_x86_64_gnu-0.53.0.crate", + sha256 = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba", + strip_prefix = "windows_x86_64_gnu-0.53.0", + urls = ["https://static.crates.io/crates/windows_x86_64_gnu/0.53.0/download"], + visibility = [], +) + +cargo.rust_library( + name = "windows_x86_64_gnu-0.53.0", + srcs = [":windows_x86_64_gnu-0.53.0.crate"], + crate = "windows_x86_64_gnu", + crate_root = "windows_x86_64_gnu-0.53.0.crate/src/lib.rs", + edition = "2021", + visibility = [], +) + +http_archive( + name = "windows_x86_64_msvc-0.53.0.crate", + sha256 = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486", + strip_prefix = "windows_x86_64_msvc-0.53.0", + urls = ["https://static.crates.io/crates/windows_x86_64_msvc/0.53.0/download"], + visibility = [], +) + +cargo.rust_library( + name = "windows_x86_64_msvc-0.53.0", + srcs = [":windows_x86_64_msvc-0.53.0.crate"], + crate = "windows_x86_64_msvc", + crate_root = "windows_x86_64_msvc-0.53.0.crate/src/lib.rs", + edition = "2021", + visibility = [], +) diff --git a/third-party/rust/Cargo.lock b/third-party/rust/Cargo.lock new file mode 100644 index 0000000..f633658 --- /dev/null +++ b/third-party/rust/Cargo.lock @@ -0,0 +1,312 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anstream" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "clap" +version = "4.5.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eac00902d9d136acd712710d71823fb8ac8004ca445a89e73a41d45aa712931" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad9bbf750e73b5884fb8a211a9424a1906c1e156724260fdae972f31d70e1d6" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "crc" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[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 = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "snafu" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" +dependencies = [ + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "third-party" +version = "0.0.0" +dependencies = [ + "clap", + "crc", + "nom", + "snafu", +] + +[[package]] +name = "unicode-ident" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" diff --git a/third-party/rust/Cargo.toml b/third-party/rust/Cargo.toml new file mode 100644 index 0000000..069c15c --- /dev/null +++ b/third-party/rust/Cargo.toml @@ -0,0 +1,31 @@ +# Definitions of third-party libraries used for buck2 builds of rue +# +# Note: This file is **not** used by a regular Cargo build of rue + +[workspace] + +[package] +# Pseudo-package whose dependencies are imported and buckified +name = "third-party" +version = "0.0.0" +publish = false +edition = "2024" + +# Do-nothing target to keep Cargo happy +[[bin]] +name = "top" +path = "top/main.rs" + +# BEGIN: DEPENDENCIES + +[workspace.package] +edition = "2024" +version = "0.1.0" + +[dependencies] +nom = "7.1.3" +crc = "3.2.1" +snafu = { version = "0.8.5" } +clap = { version = "4.5.21", features = ["derive"] } + +# END: DEPENDENCIES diff --git a/third-party/rust/fixups/proc-macro2/fixups.toml b/third-party/rust/fixups/proc-macro2/fixups.toml new file mode 100644 index 0000000..89f3cd5 --- /dev/null +++ b/third-party/rust/fixups/proc-macro2/fixups.toml @@ -0,0 +1 @@ +buildscript.run = true diff --git a/third-party/rust/fixups/windows_x86_64_gnu/fixups.toml b/third-party/rust/fixups/windows_x86_64_gnu/fixups.toml new file mode 100644 index 0000000..e555b01 --- /dev/null +++ b/third-party/rust/fixups/windows_x86_64_gnu/fixups.toml @@ -0,0 +1 @@ +buildscript.run = false diff --git a/third-party/rust/fixups/windows_x86_64_msvc/fixups.toml b/third-party/rust/fixups/windows_x86_64_msvc/fixups.toml new file mode 100644 index 0000000..e555b01 --- /dev/null +++ b/third-party/rust/fixups/windows_x86_64_msvc/fixups.toml @@ -0,0 +1 @@ +buildscript.run = false diff --git a/third-party/rust/reindeer.toml b/third-party/rust/reindeer.toml new file mode 100644 index 0000000..705bf51 --- /dev/null +++ b/third-party/rust/reindeer.toml @@ -0,0 +1,24 @@ +# Reindeer configuration for rue + +# Build dependencies through http_archive downloaded from crates.io, rather than +# vendoring sources into this repo. +vendor = false + +# Parse Rust code to work out the precise set of source files for each crate. +# This uses `srcfiles` which only works on Rust 2018 and without some macro +# constructions. It works in almost all cases, but you may need to have a +# fixups.toml adding extra srcs if it fails. +precise_srcs = true + +# Include an explicit public top-level target which depends on all other library +# targets, so that you can to a test/check build. +include_top_level = true + +[buck] + +generated_file_header = """ +## +## \u0040generated by `reindeer buckify` +## Do not edit by hand. +## +""" diff --git a/toolchains/BUCK b/toolchains/BUCK new file mode 100644 index 0000000..b3ac5bc --- /dev/null +++ b/toolchains/BUCK @@ -0,0 +1,5 @@ +load("@prelude//toolchains:demo.bzl", "system_demo_toolchains") + +# All the default toolchains, suitable for a quick demo or early prototyping. +# Most real projects should copy/paste the implementation to configure them. +system_demo_toolchains() \ No newline at end of file