Skip to content

Preserve Doorstop injection for Valheim macOS Rosetta launches - #22

Closed
No898 wants to merge 1 commit into
AzumattDev:v5-ltsfrom
No898:fix/macos-rosetta-dyld-start-script
Closed

Preserve Doorstop injection for Valheim macOS Rosetta launches#22
No898 wants to merge 1 commit into
AzumattDev:v5-ltsfrom
No898:fix/macos-rosetta-dyld-start-script

Conversation

@No898

@No898 No898 commented Apr 25, 2026

Copy link
Copy Markdown

Summary

Fixes #21.

This is a small macOS workaround for current Valheim/BepInExPack users on Apple Silicon.

When the Valheim start script runs the x86_64 game slice through Rosetta, Doorstop can fail to inject because the DYLD_* variables used for libdoorstop_x64.dylib are not present in the final Valheim process. The result is confusing for users: Valheim launches normally, but BepInEx never creates BepInEx/LogOutput.log and no plugins load.

This patch keeps the change limited to scripts/Start scripts/start_game_bepinex.sh:

  • adds a full doorstop_path
  • for macOS x64 launches, enters an x86_64 shell first
  • sets DYLD_LIBRARY_PATH and DYLD_INSERT_LIBRARIES inside that shell
  • then execs the Valheim executable

This is intentionally narrower than #20. It does not attempt native arm64 support or broader runtime changes; it is just a compatibility workaround for the current packaged Valheim launch path.

Local validation

Validated on:

  • macOS 26.3.1 (25D2128)
  • Apple M4
  • Valheim 0.221.12 (network version 36)
  • BepInExPack_Valheim 5.4.2333

Before the workaround:

  • Valheim launched.
  • BepInEx/LogOutput.log was not created.
  • No plugins loaded.

After the workaround:

[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 11 plugins to load
[Message:   BepInEx] Chainloader startup complete

Notes

I opened this as a small PR because the broader Apple Silicon work in #20 is still draft. If you would rather fold this into that PR, I am fine with closing this.

This patch was prepared with AI assistance from Codex and validated locally on the machine above.

@arrowmaster

Copy link
Copy Markdown
Contributor

Changes to the shell script should be submitted upstream to https://github.com/neighTools/UnityDoorstop/ where they can propagate to upstream BepInEx and then eventually all game specific repacks.

@No898 No898 closed this Jul 16, 2026
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.

macOS Apple Silicon: Valheim starts but BepInEx does not load when Doorstop injection is lost through Rosetta launch

2 participants