Skip to content

Commit a80d364

Browse files
[#99401] loader: Add ability to load non-SingleFile packages
1 parent 1e67ee9 commit a80d364

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/pyrenode3/loader.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,22 @@ def from_net_bin(cls, path: "Union[str, pathlib.Path]"):
281281
renode_bin = pathlib.Path(path)
282282
renode_dir = renode_bin.parent
283283

284-
# As a side effect, executing the binary causes the embedded dlls to be extracted to:
285-
# ~/.net/<executable name>/<executable hash>/
286-
# The location gets printed to stderr (or selected file) if suitable environment variables are set.
287-
out = check_output([renode_bin, "--version"], stderr=STDOUT, env=os.environ | {"COREHOST_TRACE": "1", "COREHOST_TRACEFILE": ""}, text=True)
284+
# From 18.06.2026 Renode packages are not built as a 'SingleFile' package.
285+
# This means that .dll files are now located inside the package directory
286+
# instead of being packed into 'renode' executable.
287+
# To determine which package we are working with we can check if a common .dll is present.
288+
289+
binaries = None
290+
if pathlib.Path(renode_dir / "System.dll").is_file():
291+
binaries = renode_dir
292+
else:
293+
# As a side effect, executing the binary causes the embedded dlls to be extracted to:
294+
# ~/.net/<executable name>/<executable hash>/
295+
# The location gets printed to stderr (or selected file) if suitable environment variables are set.
296+
out = check_output([renode_bin, "--version"], stderr=STDOUT, env=os.environ | {"COREHOST_TRACE": "1", "COREHOST_TRACEFILE": ""}, text=True)
288297

289-
binaries = re.search(r"will be extracted to \[(.*)\] directory", out).group(1)
290-
binaries = pathlib.Path(binaries)
298+
binaries = re.search(r"will be extracted to \[(.*)\] directory", out).group(1)
299+
binaries = pathlib.Path(binaries)
291300

292301
# There should be *some* way to specify a dll PATH, but it does not 'just work' e.g. in runtimeconfig.json.
293302
# As a workaround, we create a directory hierarchy (can be anywhere, but we use ~/.net/...) like

0 commit comments

Comments
 (0)