Commit Graph
12 Commits
Author SHA1 Message Date
NikoandClaude Opus 5.5 3abfe906bd test(relinker): run the file writer's replacement test on a copy of itself
The running-executable replacement test copied /bin/sleep under the
names "running" and "leftover" and started the copy. On Ubuntu 26.04
/bin/sleep is the uutils multi-call coreutils binary, which picks the
utility from the file name of the path it was started through, not
from argv[0], so the copy printed "coreutils: unknown program
'running'" and exited, and file_writer_binary and file_writer_text
failed without ever replacing a running executable. The test now
copies its own executable and starts it with a "wait" argument that
sleeps, so it no longer depends on how a system binary reads its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:31:32 +02:00
Adrià 5561db28ea Merge pull request #5018 from SandstromPL/fix/relinker-replace-outputs
fix(relinker): replace output files instead of rewriting them in place
2026-10-14 19:53:07 +02:00
SandstromPLandClaude Opus 5.5 26c62cc63d fix(relinker): give the output's temporary file a unique name
A relink killed between writing <output>.tmp and renaming it left that
file behind, and every later relink of the output then fell back to the
in-place write, bringing back the failure on a running build. The
temporary file is now created under a new name beside the output with
O_CREAT | O_EXCL and the previous permission bits, and written through
that descriptor, so a file left by an earlier run never blocks a
replacement and is never touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 07:27:54 +05:30
boykopovar b42aa8c540 feat(relinker): expose in-memory conversion through a portable core library 2026-10-13 12:57:53 +03:00
SandstromPLandClaude Opus 5.5 92618d25c3 fix(relinker): replace output files instead of rewriting them in place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 13:56:15 +05:30
aplatogg b74774f713 fix(relinker): support non-ASCII input paths on Windows
The MinGW CRT delivers argv to main as ANSI code page bytes, and every narrow string became a filesystem path through the same code page, so a game in a directory with characters outside the code page failed to open (#2692). Read the command line as Unicode (wmain via -municode), keep paths as UTF-8 strings, convert at the filesystem boundaries through Io::NativePath and Io::Utf8Path, and run the --autorun output through CreateProcessW.

(cherry picked from commit 30a5181f8a)
2026-10-10 17:22:07 +00:00
Cursor Agent eba1dec764 fix(relinker): reject non-regular input files
A directory opens and tellg reports an enormous size, so the relinker
tried to allocate it and failed with std::bad_alloc. Require a regular
file and a non-negative size before allocating the input buffer.
2026-10-10 08:26:32 +02:00
Tomás Ortellado 9f9e4e28b8 fix(relinker): reject invalid and overflowing alignment 2026-10-05 08:44:55 -03:00
DiulioAires b6c97084ed fix(relinker): check byte writer bounds 2026-10-04 20:17:21 -03:00
RomainROCH b6ff4a2116 fix(relinker): reject overflowing buffer offsets 2026-09-30 18:07:26 +02:00
Darko Gjorgjijoski 42594eecd4 fix(relinker): report buffered output write failures 2026-09-28 00:25:42 +02:00
boykopovar 4b643c6655 refactor(core): seprated folders for relinker and libs 2026-09-11 14:53:01 +03:00