Skip to content

Commit bf3282f

Browse files
committed
Add wcurl in Rust
To have a compiled binary free of dependancies Signed-off-by: Eric Curtin <[email protected]>
1 parent 376b405 commit bf3282f

File tree

5 files changed

+603
-1
lines changed

5 files changed

+603
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
- name: 'REUSE check'
6161
run: |
6262
source ~/venv/bin/activate
63+
rm wcurl-rs/Cargo.lock
6364
reuse lint
6465
6566
- name: Run zizmor

tests/tests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828

2929
ROOTDIR=$(CDPATH=$(cd -- "$(dirname -- "$0")/.." && pwd))
3030
readonly ROOTDIR
31-
export PATH="${ROOTDIR}:${PATH}"
31+
32+
# Determine which binary to use
33+
if [ -x "${ROOTDIR}/wcurl-rs/target/release/wcurl" ]; then
34+
export PATH="${ROOTDIR}/wcurl-rs/target/release:${PATH}"
35+
else
36+
export PATH="${ROOTDIR}:${PATH}"
37+
fi
3238

3339
readonly WCURL_CMD="wcurl --dry-run "
3440

wcurl-rs/Cargo.lock

Lines changed: 102 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcurl-rs/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# SPDX-FileCopyrightText: 2025 Eric Curtin <[email protected]>
2+
#
3+
# SPDX-License-Identifier: curl
4+
5+
[package]
6+
name = "wcurl"
7+
version = "2025.11.4"
8+
edition = "2021"
9+
description = "A simple wrapper around curl to easily download files"
10+
license = "curl"
11+
authors = [
12+
"Eric Curtin <[email protected]>"
13+
]
14+
15+
[dependencies]
16+
clap = { version = "4.0", features = ["derive", "std"], default-features = false }
17+
percent-encoding = "2.0"
18+
19+
# Using a minimal URL parsing alternative to reduce dependencies
20+
# We'll implement basic URL parsing manually where needed to avoid the heavy url crate
21+
22+
[profile.release]
23+
lto = true
24+
codegen-units = 1
25+
strip = true
26+
panic = "abort"
27+
opt-level = "s" # Optimize for size
28+
debug = false

0 commit comments

Comments
 (0)