Skip to content

Gs/fix servant asset serve dir redirect - #5

Open
augyg wants to merge 3 commits into
gs/servant-routingfrom
gs/fix-servant-asset-serve-dir-redirect
Open

Gs/fix servant asset serve dir redirect#5
augyg wants to merge 3 commits into
gs/servant-routingfrom
gs/fix-servant-asset-serve-dir-redirect

Conversation

@augyg

@augyg augyg commented Jul 31, 2026

Copy link
Copy Markdown

I have:

  • Based work on latest develop branch
  • Followed the contribution guide
  • Looked for lint in my changes with hlint . (lint found code you did not write can be left alone)
  • Run the test suite: $(nix-build -A selftest --no-out-link)
  • Updated the changelog
  • (Optional) Run CI tests locally: nix-build release.nix -A build.x86_64-linux --no-out-link (or x86_64-darwin on macOS)

augyg added 3 commits July 29, 2026 22:30
Re-enable multi-repl: True in skeleton/cabal.project. The prior
disable comment blamed a GHC 9.14 "LinkInMemory" panic; the real
trigger is buildable unit files with no exposed-modules of their
own (only reexported-modules or similar). GHC's multi-repl driver
routes empty units through Pipeline.hs's LinkInMemory path even
when the interpreter is enabled, and panics. See GHC issues
#25366 and #26073.

frontend-wasm and frontend-js were the offenders: both only
reexport Frontend, no own exposed-modules. Added a one-line
Placeholder module + hs-source-dirs to each so the unit files
have at least one target. cabal repl --enable-multi-repl now
loads 20 modules across common + frontend + backend + landing-page
+ frontend-wasm in one GHCi session on GHC 9.14.1.
serveStaticDir was using Snap.serveDirectory for static asset dirs,
which does trailing-slash canonicalization on directory-shaped paths.
Every hashed-asset entry (produced by jenga-asset-manifest) is a
directory containing type/target/encodings metadata files, so
requests like /ghcjs/all.js got 302'd to /ghcjs/all.js/ and then
fell through to the SPA HTML — the browser tried to parse HTML as JS
and errored.

Swap to Jenga.Asset.Serve.Snap.serveAssets, which reads the
type file, follows the target redirect to the hashed filename, and
serves with proper caching + encoding negotiation. Matches
obelisk-v1's serveStaticAssets shape.

Verified end-to-end on a NixOS VBox deploy: /ghcjs/all.js now
returns 302 -> hashed target -> 200 text/javascript with
immutable caching, and the reflex-dom frontend actually loads.
The obelisk-oauth-common.cabal had `extra-source-files: CHANGELOG.md`
referencing a file that never existed in the common/ subdir at any
rev. Older cabal / haskell.nix silently ignored the missing file;
newer haskell.nix errors with Cabal-6661 during plan generation,
breaking any `jenga deploy push` invocation that touches this dep.

Fix committed upstream on gs/jenga-port; bumping submodule to pick
it up.
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.

1 participant