Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Commit 9fd98d1

Browse files
committed
Add zstd-sys-2.0.14-zstd.1.5.7
Signed-off-by: Quanyi Ma <eli@patch.sh>
1 parent 8678658 commit 9fd98d1

File tree

126 files changed

+85601
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+85601
-21
lines changed

.devcontainer/devcontainer.json

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
{
2-
"name": "Buck2 for Rust Dev Container",
3-
"extensions": [],
2+
"name": "r2cn - Codespaces",
43
"dockerFile": "Dockerfile",
5-
"settings": {
6-
"editor.formatOnSave": true,
7-
"terminal.integrated.shell.linux": "/usr/bin/bash",
8-
"files.exclude": {
9-
"**/CODE_OF_CONDUCT.md": true,
10-
"**/LICENSE": true
11-
}
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"rust-lang.rust-analyzer",
8+
"vadimcn.vscode-lldb",
9+
"tamasfe.even-better-toml",
10+
"ms-vscode.cpptools"
11+
],
12+
"settings": {
13+
"editor.formatOnSave": true,
14+
"terminal.integrated.shell.linux": "/usr/bin/bash",
15+
"files.exclude": {
16+
"**/CODE_OF_CONDUCT.md": true,
17+
"**/LICENSE": true
18+
}
19+
}
20+
}
1221
},
1322
"hostRequirements": {
1423
"cpus": 16,
15-
"memory": "64GB",
16-
"storage": "128GB"
24+
"memory": "64gb",
25+
"storage": "128gb"
1726
}
1827
}

.devcontainer/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ curl https://sh.rustup.rs -sSf | sh -s -- -y
2424
source /root/.cargo/env
2525

2626
## Install Buck2
27-
wget https://github.com/facebook/buck2/releases/download/2025-03-01/buck2-aarch64-apple-darwin.zst
27+
wget https://github.com/facebook/buck2/releases/download/2025-03-01/buck2-x86_64-unknown-linux-musl.zst
2828
zstd -d /home/buck2-x86_64-unknown-linux-musl.zst
2929
mv /home/buck2-x86_64-unknown-linux-musl /home/buck2
3030
chmod +x /home/buck2

BUCK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cargo.rust_binary(
88
deps = [
99
# zstd-sys
1010
"//third-party/rust/crates/zstd-sys/2.0.13+zstd.1.5.6:zstd-sys",
11-
"//third-party/rust/crates/zstd-sys/2.0.13+zstd.1.5.6:zstd-sys-experimental",
11+
"//third-party/rust/crates/zstd-sys/2.0.14+zstd.1.5.7:zstd-sys",
1212
# ---
1313

1414
# zstd-safe

third-party/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,26 @@ For now, I am trying to generate `BUCK` with `Cargo.toml` with Claude, and the p
8888
* BUCK 文件中没有 `version``licenses` 字段;
8989
* BUCK 文件中 `edition` 字段固定使用 `2021`
9090
* 如果有依赖存在,请使用 `//third-party/rust/crates/<crate_name>/<crate_version>:<crate_name>` 来替换;
91-
* 如果有 Feature, 使用如下的方式来设计
91+
* 如果有 Feature, 采用通过 `--config` 传入构建参数,加入以下函数设计
9292
```
93-
FEATURES = {
94-
"debug": [],
95-
"default": ["legacy", "zdict_builder"],
96-
}
93+
def get_rust_features():
94+
features_config = read_config("rust", "features", "")
95+
96+
if features_config == "":
97+
return []
98+
return [f.strip() for f in features_config.split(",") if f.strip()]
9799
```
98100
* 请在基础模板下进行修改:
99101
```
100-
load("@prelude//rust:cargo_package.bzl", "cargo")
102+
load("@prelude//toolchains:rust.bzl", "system_rust_toolchain")
103+
load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain")
101104
102-
cargo.rust_library(
105+
rust_library(
103106
name = "",
104107
edition = "2021",
105108
srcs = glob(["src/**/*.rs"]),
106109
crate_root = "src/lib.rs",
107-
features = FEATURES["default"],
110+
features = get_rust_features(),
108111
rustc_flags = [],
109112
env = {},
110113
deps = [],
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[cells]
2+
root = .
3+
prelude = prelude
4+
toolchains = toolchains
5+
none = none
6+
7+
[cell_aliases]
8+
config = prelude
9+
ovr_config = prelude
10+
fbcode = none
11+
fbsource = none
12+
fbcode_macros = none
13+
buck = none
14+
15+
# Uses a copy of the prelude bundled with the buck2 binary. You can alternatively delete this
16+
# section and vendor a copy of the prelude to the `prelude` directory of your project.
17+
[external_cells]
18+
prelude = bundled
19+
20+
[parser]
21+
target_platform_detector_spec = target:root//...->prelude//platforms:default
22+
23+
[build]
24+
execution_platforms = prelude//platforms:default
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"git": {
3+
"sha1": "c25e64fdf2594dc7083ebc0b6e4baa502ebff58d"
4+
},
5+
"path_in_vcs": "zstd-safe/zstd-sys"
6+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
load("@prelude//toolchains:rust.bzl", "system_rust_toolchain")
2+
load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain")
3+
4+
load("//third-party/rust/crates/zstd-sys/2.0.14+zstd.1.5.7:build.bzl", "get_rust_features")
5+
6+
7+
# C library for zstd
8+
cxx_library(
9+
name = "zstd_c",
10+
srcs = glob([
11+
"zstd/lib/common/**/*.c",
12+
"zstd/lib/compress/**/*.c",
13+
"zstd/lib/decompress/**/*.c",
14+
"zstd/lib/dictBuilder/**/*.c",
15+
"zstd/lib/legacy/**/*.c",
16+
"zstd/contrib/seekable_format/**/*.c",
17+
"zstd/lib/decompress/huf_decompress_amd64.S",
18+
]),
19+
headers = glob([
20+
"zstd/lib/**/*.h",
21+
"wasm-shim/**/*.h",
22+
]),
23+
# Use header_namespace and exported_headers instead of include_dirs
24+
header_namespace = "",
25+
exported_headers = glob([
26+
"zstd/lib/**/*.h",
27+
"wasm-shim/**/*.h",
28+
]),
29+
compiler_flags = [
30+
"-DZSTD_LIB_DEPRECATED=0",
31+
"-DXXH_PRIVATE_API",
32+
"-DZSTDLIB_VISIBILITY=",
33+
"-DZSTDERRORLIB_VISIBILITY=",
34+
"-DZDICTLIB_VISIBILITY=",
35+
"-fvisibility=hidden",
36+
"-ffunction-sections",
37+
"-fdata-sections",
38+
"-fmerge-all-constants",
39+
# Add include path flags directly as compiler flags
40+
"-Izstd/lib/",
41+
"-Izstd/lib/common",
42+
],
43+
# We're creating a static library
44+
preferred_linkage = "static",
45+
visibility = [],
46+
)
47+
48+
# Main Rust library
49+
rust_library(
50+
name = "zstd-sys",
51+
edition = "2021",
52+
srcs = glob(["src/**/*.rs"]),
53+
crate_root = "src/lib.rs",
54+
features = get_rust_features(),
55+
rustc_flags = [
56+
# Add any necessary rustc flags here
57+
],
58+
env = {
59+
# Environment variables needed for build
60+
},
61+
deps = [
62+
# Internal C library dependency
63+
":zstd_c",
64+
# External dependencies would go here
65+
# "//third-party/rust/crates/bindgen/0.71.0:bindgen",
66+
# "//third-party/rust/crates/cc/1.0.45:cc",
67+
# "//third-party/rust/crates/pkg-config/0.3.28:pkg-config",
68+
],
69+
visibility = ["PUBLIC"],
70+
)
71+
72+
# For use as a build target
73+
alias(
74+
name = "zstd_sys",
75+
actual = ":zstd-sys",
76+
visibility = ["PUBLIC"],
77+
)
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
2+
#
3+
# When uploading crates to the registry Cargo will automatically
4+
# "normalize" Cargo.toml files for maximal compatibility
5+
# with all versions of Cargo and also rewrite `path` dependencies
6+
# to registry (e.g., crates.io) dependencies.
7+
#
8+
# If you are reading this file be aware that the original Cargo.toml
9+
# will likely look very different (and much more reasonable).
10+
# See Cargo.toml.orig for the original contents.
11+
12+
[package]
13+
edition = "2018"
14+
rust-version = "1.64"
15+
name = "zstd-sys"
16+
version = "2.0.14+zstd.1.5.7"
17+
authors = ["Alexandre Bury <alexandre.bury@gmail.com>"]
18+
build = "build.rs"
19+
links = "zstd"
20+
include = [
21+
"/LICENSE*",
22+
"!/*.sh",
23+
"/build.rs",
24+
"/*.h",
25+
"/src/",
26+
"/wasm-shim/**/*.h",
27+
"/zstd/LICENSE",
28+
"/zstd/COPYING",
29+
"/zstd/lib/**/*.c",
30+
"/zstd/lib/**/*.h",
31+
"/zstd/lib/**/*.S",
32+
]
33+
autolib = false
34+
autobins = false
35+
autoexamples = false
36+
autotests = false
37+
autobenches = false
38+
description = "Low-level bindings for the zstd compression library."
39+
readme = "Readme.md"
40+
keywords = [
41+
"zstd",
42+
"zstandard",
43+
"compression",
44+
]
45+
categories = [
46+
"api-bindings",
47+
"compression",
48+
]
49+
license = "MIT/Apache-2.0"
50+
repository = "https://github.com/gyscos/zstd-rs"
51+
52+
[package.metadata.docs.rs]
53+
features = ["experimental"]
54+
55+
[features]
56+
debug = []
57+
default = [
58+
"legacy",
59+
"zdict_builder",
60+
]
61+
experimental = []
62+
fat-lto = []
63+
legacy = []
64+
no_asm = []
65+
no_wasm_shim = []
66+
non-cargo = []
67+
pkg-config = []
68+
seekable = []
69+
std = []
70+
thin = []
71+
thin-lto = []
72+
zdict_builder = []
73+
zstdmt = []
74+
75+
[lib]
76+
name = "zstd_sys"
77+
path = "src/lib.rs"
78+
doctest = false
79+
80+
[build-dependencies.bindgen]
81+
version = "0.71"
82+
features = [
83+
"runtime",
84+
"which-rustfmt",
85+
]
86+
optional = true
87+
default-features = false
88+
89+
[build-dependencies.cc]
90+
version = "1.0.45"
91+
features = ["parallel"]
92+
93+
[build-dependencies.pkg-config]
94+
version = "0.3.28"
95+
96+
[lints.rust]
97+
non_upper_case_globals = "allow"

third-party/rust/crates/zstd-sys/2.0.14+zstd.1.5.7/Cargo.toml.orig

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MIT or Apache-2.0

0 commit comments

Comments
 (0)