Hotfix/docker local fixes - #5
Merged
Merged
Conversation
- docker-compose.yml: pin the service to linux/amd64 since the Pebble SDK toolchain (qemu-pebble, ARM cross-compiler) is x86_64-only. - Dockerfile: set ERL_FLAGS="+JPperf true" during the Elixir build stage. Erlang's JIT uses dual-mapped RWX memory that QEMU's user-mode emulation mishandles, crashing mid-compile with confusing errors like "undefined function erlang:nif_error/1" in zlib:open_nif/0. Forcing single-mapped JIT memory avoids it (see erlang/otp#6340). - docker/pebble_sdk.sh, docker/entrypoint.sh: ensure the pebble-tool persist dir (~/.pebble-sdk) exists before any pebble command runs. pebble-tool only uses that legacy path if it already exists, otherwise it silently falls back to ~/.local/share/pebble-sdk -- but every hardcoded SDK/QEMU path in this image assumes the legacy location, so the app could never find an SDK installed via the XDG fallback. Also migrates any SDK data that already landed in the wrong location. Co-authored-by: Claude <noreply@anthropic.com>
…_-baked config paths
- internal_packages.ex, project_templates.ex: watch-target elm.json files
never included the internal elm/json source directory (unlike elm/time
and elm/random), causing "Module Main imports Json.Decode, but it was
not found in loaded sources" errors for any watch app that uses
Json.Decode/Encode.
- wasm_emulator.ex: Ide.WasmEmulator.asset_root/0 defaulted to
Path.expand("../../priv/wasm_emulator", __DIR__). __DIR__ is a
compile-time macro, so this baked in the build stage's /app/... path,
which doesn't exist in the runner (/opt/ide) -- crashing
Ide.Release.setup() with a permission error on every boot. Switched to
Application.app_dir/2, which resolves correctly at actual runtime.
- config/runtime.exs: config.exs sets Ide.Settings.settings_path,
Ide.Screenshots.storage_root, and Ide.PublishManifest.output_root via
the same __DIR__ pattern, which breaks the same way in a release
(surfaced as `Prepare release failed: %MatchError{term: {:error,
:eacces}}`). Added prod-time overrides: settings_path now correctly
falls back to the existing SETTINGS_FILE/data_root resolution,
Screenshots.storage_root resolves via Application.app_dir/2 (must stay
under the app's own priv/static since Plug.Static serves the public
screenshot URLs from there), and PublishManifest.output_root moves to
the persistent data root.
Co-authored-by: Claude <noreply@anthropic.com>
Same class of bug as the previous commit: __DIR__ is a compile-time macro, so any path built from it gets frozen to the build stage's absolute path (/app/...) and silently breaks once the compiled release runs from a different location (/opt/ide). These didn't crash, but silently degraded features in production: - pypkjs.ex: the embedded_pypkjs.py wrapper script was never found, so the embedded emulator always fell back to the bare pypkjs binary without it. - cmd_call/core.ex: reading Companion/Types.elm for companion-protocol schema introspection in the debugger always failed with :enoent. - project_template_previews.ex: screenshot_available?/1 always returned false, so the create-project picker never showed template preview thumbnails despite them shipping correctly in priv/static. All three now use Ide.Paths.priv_path/1 or Application.app_dir/2, which resolve correctly at actual runtime regardless of where the release is installed. Verified against the running container: all three paths now resolve and the referenced files are found. Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.