Merge pull request #6351 from thuanquang/fix/layout-relative-output

fix(relinker): list converted modules correctly for a relative output path
This commit is contained in:
Adrià authored and GitHub committed 2026-10-19 02:40:55 +02:00
commit d265c58e40
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -456,7 +456,7 @@ int Run(const int argc, char* argv[]) {
}
std::vector<std::string> modulePaths;
for (const auto& artifact : guestArtifacts) {
std::string relative = Io::Utf8Path(artifact.Path.lexically_relative(Io::NativePath(absPath).parent_path() / "app0"));
std::string relative = Io::Utf8Path(artifact.Path.lexically_relative(Io::NativePath(absPath).parent_path().lexically_normal() / "app0"));
std::replace(relative.begin(), relative.end(), '\\', '/');
modulePaths.push_back(std::move(relative));
}
@@ -114,7 +114,12 @@ def main():
artifact = case / "app0" / "sce_module" / "needed.prx.guest.prx"
assert artifact.read_bytes().startswith(b"MZ" if windows else b"\x7fELF"), artifact
assert list((case / "app0").rglob("*.guest.prx")) == [artifact]
assert " |-- sce_module/\n |-- needed.prx.guest.prx\n" in result.stdout, result.stdout
layout = " |-- sce_module/\n |-- needed.prx.guest.prx\n"
assert layout in result.stdout, result.stdout
for spelling in (os.path.join(".", output.name), os.path.join("..", case.name, output.name)):
relative = subprocess.run([str(relinker), *(["--windows"] if windows else []), "input.elf", spelling], cwd=case,
capture_output=True, text=True, timeout=30)
assert relative.returncode == 0 and layout in relative.stdout, (spelling, relative.stdout, relative.stderr)
if windows and os.name == "nt":
run = subprocess.run([str(output)], capture_output=True, text=True, timeout=30)
assert run.returncode == 42, (run.returncode, run.stdout, run.stderr)