Skip to content

Pin ruff version and fix sporadic double unlink in tests - #287

Merged
nunoplopes merged 2 commits into
Cpp2Rust:masterfrom
lucic71:pin-ruff
Jul 25, 2026
Merged

Pin ruff version and fix sporadic double unlink in tests#287
nunoplopes merged 2 commits into
Cpp2Rust:masterfrom
lucic71:pin-ruff

Conversation

@lucic71

@lucic71 lucic71 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

ruff got suddenly updated and our python linting broke. Pin ruff to a fixed version so linting is stable.

@lucic71

lucic71 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

While fixing the ruff version I encountered another problem: C++/unsafe/refcount all work with the same file declared in tmp, for example const char *path = "/tmp/cpp2rust_lseek_test.tmp";. This can lead to double unlinks which make tests fail sporadically.

To fix this, I moved all files from /tmp into the temporary build directory of each test, the second argument is cwd:

-        self.cpp_result = RunResult(*lit.util.executeCommand(str(self.cpp_bin)))
+        self.cpp_result = RunResult(
+           *lit.util.executeCommand(str(self.cpp_bin), str(self.tmp_dir))
+        )

@lucic71 lucic71 changed the title Pin ruff version Pin ruff version and fix sporadic double unlink in tests Jul 24, 2026
@nunoplopes
nunoplopes merged commit c892f64 into Cpp2Rust:master Jul 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants