Skip to content

Commit 96cfca1

Browse files
konstinzanieb
andauthored
Move static feature out of perf features (astral-sh#13265)
astral-sh#5577 fixed a bug on macos due to dynamically linking lzma/xz through static linking. In astral-sh#7686, this feature was moved to the performance category. This PR moves the `xz2/static` back to the general default features, and, inspired by Homebrew/homebrew-core#222211, it structures and documents the feature flags cleaner. We need to take care that this feature does not accidentally disable features we want. --------- Co-authored-by: Zanie Blue <[email protected]>
1 parent b442aae commit 96cfca1

File tree

6 files changed

+34
-27
lines changed

6 files changed

+34
-27
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2250,7 +2250,7 @@ jobs:
22502250
cargo run --bin uv -- pip compile scripts/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
22512251
22522252
- name: "Build benchmarks"
2253-
run: cargo codspeed build --profile profiling --features "codspeed,performance" -p uv-bench
2253+
run: cargo codspeed build --profile profiling --features codspeed -p uv-bench
22542254

22552255
- name: "Run benchmarks"
22562256
uses: CodSpeedHQ/action@0010eb0ca6e89b80c88e8edaaa07cfe5f3e6664d # v3.5.0

crates/uv-bench/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,4 @@ ignored = ["uv-extract"]
5858

5959
[features]
6060
codspeed = ["codspeed-criterion-compat"]
61-
performance = [
62-
"uv-extract/performance"
63-
]
61+
static = ["uv-extract/static"]

crates/uv-dev/Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,10 @@ name = "uv-dev"
6666
required-features = ["dev"]
6767

6868
[features]
69-
default = ["performance"]
69+
default = ["performance", "uv-extract/static"]
7070
# Actually build the dev CLI.
7171
dev = []
72-
performance = [
73-
"performance-memory-allocator",
74-
"uv-extract/performance"
75-
]
72+
performance = ["performance-memory-allocator"]
7673
performance-memory-allocator = ["dep:uv-performance-memory-allocator"]
7774
render = ["poloto", "resvg", "tagu"]
7875

crates/uv-distribution/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ insta = { version = "1.40.0", features = ["filters", "json", "redactions"] }
6363

6464
[features]
6565
default = []
66-
performance = ["uv-extract/performance"]
66+
static = ["uv-extract/static"]

crates/uv-extract/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ zip = { workspace = true }
4040

4141
[features]
4242
default = []
43-
performance = ["xz2/static"]
43+
# Avoid a liblzma.so dependency
44+
static = ["xz2/static"]
4445

4546
[package.metadata.cargo-shear]
4647
ignored = ["xz2"]

crates/uv/Cargo.toml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,33 +136,44 @@ ignored = [
136136
]
137137

138138
[features]
139-
default = ["python", "python-managed", "pypi", "git", "performance", "crates-io", "slow-tests", "test-ecosystem"]
139+
default = ["performance", "uv-distribution/static", "default-tests"]
140140
# Use better memory allocators, etc.
141-
performance = [
142-
"performance-memory-allocator",
143-
"uv-distribution/performance",
144-
]
141+
performance = ["performance-memory-allocator"]
145142
performance-memory-allocator = ["dep:uv-performance-memory-allocator"]
143+
144+
# Adds self-update functionality. This feature is only enabled for uv's cargo-dist installer
145+
# and should be left unselected when building uv for package managers.
146+
self-update = ["axoupdater", "uv-cli/self-update"]
147+
148+
# Features for development only.
146149
tracing-durations-export = ["dep:tracing-durations-export", "uv-resolver/tracing-durations-export"]
147150

148-
# Introduces a dependency on a local Python installation.
151+
# Features that only apply when running tests, no-ops otherwise.
152+
default-tests = [
153+
"crates-io",
154+
"git",
155+
"pypi",
156+
"python",
157+
"python-managed",
158+
"slow-tests",
159+
"test-ecosystem"
160+
]
161+
# Introduces a testing dependency on crates.io.
162+
crates-io = []
163+
# Introduces a testing dependency on Git.
164+
git = []
165+
# Introduces a testing dependency on PyPI.
166+
pypi = []
167+
# Introduces a testing dependency on a local Python installation.
149168
python = []
150-
# Introduces a dependency on a local Python installation with specific patch versions.
169+
# Introduces a testing dependency on a local Python installation with specific patch versions.
151170
python-patch = []
152-
# Introduces a dependency on managed Python installations.
171+
# Introduces a testing dependency on managed Python installations.
153172
python-managed = []
154-
# Introduces a dependency on PyPI.
155-
pypi = []
156-
# Introduces a dependency on Git.
157-
git = []
158-
# Introduces a dependency on crates.io.
159-
crates-io = []
160173
# Include "slow" test cases.
161174
slow-tests = []
162175
# Includes test cases that require ecosystem packages
163176
test-ecosystem = []
164-
# Adds self-update functionality.
165-
self-update = ["axoupdater", "uv-cli/self-update"]
166177

167178
[package.metadata.dist]
168179
dist = true

0 commit comments

Comments
 (0)