Skip to content

Commit c892f64

Browse files
authored
Pin ruff version and fix sporadic double unlink in tests (#287)
ruff got suddenly updated and our python linting broke. Pin ruff to a fixed version so linting is stable.
1 parent fc5fe57 commit c892f64

27 files changed

Lines changed: 59 additions & 57 deletions

‎.github/workflows/format.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
llvm-version: 22
2727

2828
- name: Setup Python
29-
run: pip install ruff
29+
run: pip install ruff==0.15.22
3030

3131
- name: Configure
3232
run: cmake -GNinja -B build -S .

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ On Ubuntu, install the required dependencies with:
3737

3838
```bash
3939
sudo apt install libclang-22-dev clang++-22 ninja-build cmake
40-
curl -LsSf https://astral.sh/ruff/install.sh | sh
40+
pip install ruff==0.15.22
4141
```
4242

4343

‎tests/lit/lit/formats/Cpp2RustTest.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,18 @@ def build_rust(self):
261261
def run_cpp(self):
262262
if self.skip_run:
263263
return None
264-
self.cpp_result = RunResult(*lit.util.executeCommand(str(self.cpp_bin)))
264+
self.cpp_result = RunResult(
265+
*lit.util.executeCommand(str(self.cpp_bin), str(self.tmp_dir))
266+
)
265267
return None
266268

267269
def run_rust(self):
268270
exp = self.expectations
269271
if self.skip_run:
270272
return None
271-
self.rust_result = RunResult(*lit.util.executeCommand(str(self.rust_bin)))
273+
self.rust_result = RunResult(
274+
*lit.util.executeCommand(str(self.rust_bin), str(self.tmp_dir))
275+
)
272276

273277
if exp.should_panic_ub:
274278
err = str(self.rust_result.stderr)

‎tests/unit/fd_io.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <unistd.h>
55

66
int main(void) {
7-
const char *path = "/tmp/cpp2rust_fd_io_test.tmp";
7+
const char *path = "cpp2rust_fd_io_test.tmp";
88
int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
99
assert(fd >= 0);
1010
assert(write(fd, "hello world", 11) == 11);

‎tests/unit/fstat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <unistd.h>
55

66
int main(void) {
7-
const char *path = "/tmp/cpp2rust_fstat_test.tmp";
7+
const char *path = "cpp2rust_fstat_test.tmp";
88
int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
99
assert(fd >= 0);
1010
assert(write(fd, "hello", 5) == 5);

‎tests/unit/isatty.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <unistd.h>
44

55
int main(void) {
6-
const char *path = "/tmp/cpp2rust_isatty_test.tmp";
6+
const char *path = "cpp2rust_isatty_test.tmp";
77
int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
88
assert(fd >= 0);
99
assert(isatty(fd) == 0);

‎tests/unit/lseek_ftruncate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <unistd.h>
55

66
int main(void) {
7-
const char *path = "/tmp/cpp2rust_lseek_ftruncate_test.tmp";
7+
const char *path = "cpp2rust_lseek_ftruncate_test.tmp";
88
int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
99
assert(fd >= 0);
1010
assert(write(fd, "hello world", 11) == 11);

‎tests/unit/out/refcount/fd_io.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111
}
1212
fn main_0() -> i32 {
1313
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
14-
b"/tmp/cpp2rust_fd_io_test.tmp",
14+
b"cpp2rust_fd_io_test.tmp",
1515
)));
1616
let fd: Value<i32> = Rc::new(RefCell::new({
1717
let __mode = match &[(420).into()].first() {

‎tests/unit/out/refcount/fstat.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111
}
1212
fn main_0() -> i32 {
1313
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
14-
b"/tmp/cpp2rust_fstat_test.tmp",
14+
b"cpp2rust_fstat_test.tmp",
1515
)));
1616
let fd: Value<i32> = Rc::new(RefCell::new({
1717
let __mode = match &[(420).into()].first() {

‎tests/unit/out/refcount/isatty.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111
}
1212
fn main_0() -> i32 {
1313
let path: Value<Ptr<u8>> = Rc::new(RefCell::new(Ptr::from_string_literal(
14-
b"/tmp/cpp2rust_isatty_test.tmp",
14+
b"cpp2rust_isatty_test.tmp",
1515
)));
1616
let fd: Value<i32> = Rc::new(RefCell::new({
1717
let __mode = match &[(420).into()].first() {

0 commit comments

Comments
 (0)