Skip to content

Commit 3ca0248

Browse files
committed
Merge upstream/main into dd-odirect-buffer-alignment
2 parents 968ea57 + 4977964 commit 3ca0248

106 files changed

Lines changed: 1611 additions & 1122 deletions

File tree

Some content is hidden

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

.vscode/cspell.dictionaries/workspace.wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ uutils
363363
sendfile
364364
execfn
365365
fadvise
366+
ficlone
366367
fstatfs
367368
getcwd
368369
mkfifoat

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ unexpected_cfgs = { level = "warn", check-cfg = [
524524
unused_qualifications = "warn"
525525

526526
[workspace.lints.clippy]
527-
collapsible_if = { level = "allow", priority = 127 } # remove me
528527
# The counts were generated with this command:
529528
# cargo clippy --all-targets --workspace --message-format=json --quiet \
530529
# | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' \
@@ -554,7 +553,6 @@ float_cmp = "allow" # 12
554553
return_self_not_must_use = "allow" # 8
555554
inline_always = "allow" # 6
556555
fn_params_excessive_bools = "allow" # 6
557-
used_underscore_items = "allow" # 2
558556
should_panic_without_expect = "allow" # 2
559557

560558
doc_markdown = "allow"
@@ -731,10 +729,6 @@ rstest_reuse.workspace = true
731729
rustix.workspace = true
732730
selinux = { workspace = true, optional = true }
733731

734-
# this breaks clippy linting with: "tests/by-util/test_factor_benches.rs: No such file or directory (os error 2)"
735-
# factor_benches = { optional = true, version = "0.0.0", package = "uu_factor_benches", path = "tests/benches/factor" }
736-
737-
#
738732
# * pinned transitive dependencies
739733
# Not needed for now. Keep as examples:
740734
#pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`)

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ make CARGOFLAGS='--no-fail-fast' UTILS='UTILITY_1 UTILITY_2' nextest
196196

197197
### Run Busybox Tests
198198

199-
This testing functionality is only available on *nix operating systems and
199+
This testing functionality is only available on Unix-like operating systems and
200200
requires `make`.
201201

202202
To run busybox tests for all utilities for which busybox has tests

docs/compiles_table.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python3
2-
import multiprocessing
3-
import subprocess
42
import argparse
53
import csv
4+
import multiprocessing
5+
import subprocess
66
import sys
77
from collections import defaultdict
88
from pathlib import Path
@@ -52,6 +52,10 @@
5252
]
5353

5454

55+
class MissingToolchainError(Exception):
56+
"""A toolchain or SDK needed to check a target is not installed."""
57+
58+
5559
class Target(str):
5660
def __new__(cls, content):
5761
obj = super().__new__(cls, content)
@@ -105,36 +109,38 @@ def check(self, binary):
105109
f"--target={self}",
106110
]
107111

108-
res = subprocess.run(args, capture_output=True)
112+
res = subprocess.run(args, capture_output=True, check=False)
109113
return res.returncode
110114

111115
# Validate that the dependencies for running this target are met
112116
def is_installed(self):
113117
# check IOS sdk is installed, raise exception otherwise
114118
if "ios" in self:
115-
res = subprocess.run(["which", "xcrun"], capture_output=True)
119+
res = subprocess.run(["which", "xcrun"], capture_output=True, check=False)
116120
if len(res.stdout) == 0:
117-
raise Exception(
121+
raise MissingToolchainError(
118122
"Error: IOS sdk does not seem to be installed. Please do that manually"
119123
)
120124
if not self.requires_nightly():
121125
# check std toolchains are installed
122126
toolchains = subprocess.run(
123-
["rustup", "target", "list"], capture_output=True
127+
["rustup", "target", "list"], capture_output=True, check=False
124128
)
125129
toolchains = toolchains.stdout.decode("utf-8").split("\n")
126130
if "installed" not in next(filter(lambda x: self in x, toolchains)):
127-
raise Exception(
131+
raise MissingToolchainError(
128132
f"Error: the {self} target is not installed. Please do that manually"
129133
)
130134
else:
131135
# check nightly toolchains are installed
132136
toolchains = subprocess.run(
133-
["rustup", "+nightly", "target", "list"], capture_output=True
137+
["rustup", "+nightly", "target", "list"],
138+
capture_output=True,
139+
check=False,
134140
)
135141
toolchains = toolchains.stdout.decode("utf-8").split("\n")
136142
if "installed" not in next(filter(lambda x: self in x, toolchains)):
137-
raise Exception(
143+
raise MissingToolchainError(
138144
f"Error: the {self} nightly target is not installed. Please do that manually"
139145
)
140146
return True
@@ -143,13 +149,12 @@ def is_installed(self):
143149
def install_targets():
144150
cmd = ["rustup", "target", "add"] + TARGETS
145151
print(" ".join(cmd))
146-
ret = subprocess.run(cmd)
152+
ret = subprocess.run(cmd, check=False)
147153
assert ret.returncode == 0
148154

149155

150156
def get_all_bins():
151-
bins = map(lambda x: x.name, BINS_PATH.iterdir())
152-
return sorted(list(bins))
157+
return sorted(path.name for path in BINS_PATH.iterdir())
153158

154159

155160
def get_targets(selection):
@@ -180,7 +185,7 @@ def test_all_targets(targets, bins):
180185

181186
def save_csv(file, table):
182187
targets = get_targets(table.keys()) # preserve order in CSV
183-
bins = list(list(table.values())[0].keys())
188+
bins = list(next(iter(table.values())).keys())
184189
with open(file, "w") as csvfile:
185190
header = ["target"] + bins
186191
writer = csv.DictWriter(csvfile, fieldnames=header)
@@ -215,8 +220,8 @@ def merge_tables(old, new):
215220

216221

217222
def render_md(fd, table, headings: str, row_headings: Target):
218-
def print_row(lst, lens=[]):
219-
lens = lens + [0] * (len(lst) - len(lens))
223+
def print_row(lst, lens=None):
224+
lens = (lens or []) + [0] * (len(lst) - len(lens or []))
220225
for e, lmd in zip(lst, lens):
221226
fmt = "|{}" if lmd == 0 else "|{:>%s}" % len(header[0])
222227
fd.write(fmt.format(e))
@@ -227,20 +232,20 @@ def cell_render(target, bin):
227232

228233
# add some 'hard' padding to specific columns
229234
lens = [
230-
max(map(lambda x: len(x.os), row_headings)) + 2,
231-
max(map(lambda x: len(x.arch), row_headings)) + 2,
235+
max(len(target.os) for target in row_headings) + 2,
236+
max(len(target.arch) for target in row_headings) + 2,
232237
]
233238
header = Target.get_heading()
234239
header[0] = ("{:#^%d}" % lens[0]).format(header[0])
235240
header[1] = ("{:#^%d}" % lens[1]).format(header[1])
236241

237242
header += headings
238243
print_row(header)
239-
lines = list(map(lambda x: "-" * len(x), header))
244+
lines = ["-" * len(column) for column in header]
240245
print_row(lines)
241246

242247
for t in row_headings:
243-
row = list(map(lambda b: cell_render(t, b), headings))
248+
row = [cell_render(t, b) for b in headings]
244249
row = t.get_row_heading() + row
245250
print_row(row)
246251

0 commit comments

Comments
 (0)