Skip to content

Bytecode files driver regression when building lens

!14872 (closed) introduced a driver regression when building lens. head.hackage nightly job fails with:

/nix/store/4apajimszc47rxwcpvc3g3rj2icinl71-gcc-wrapper-13.3.0/bin/ar: dist/build/Data/Data/Lens.o: No such file or directory

The previous head.hackage nightly job builds it fine (before !14872 (closed) landed). I noticed this error in a ghc-wasm-meta job that also failed similarly:

wasm32-wasi-clang: error: no such file or directory: 'dist/build/Data/Data/Lens.dyn_o'
`wasm32-wasi-clang' failed in phase `Linker'. (Exit code: 1)
Error: [Cabal-7125]
Failed to build lens-5.2.3 (which is required by jsaddle-wasm-0.1.2.1). See the build log above for details.

A quick look at the CI log reveals something interesting:

[41 of 85] Compiling Control.Lens.Zoom ( src/Control/Lens/Zoom.hs, dist/build/Control/Lens/Zoom.o, dist/build/Control/Lens/Zoom.dyn_o )
[42 of 85] Compiling Data.Data.Lens   ( src/Data/Data/Lens.hs, interpreted )

So it seems the driver is not compiling Data.Data.Lens to disk as it should. The driver also warns:

    Ignoring optimization flags since they are experimental for the byte-code interpreter. Pass -fno-unoptimized-core-for-interpreter to enable this feature.

when making flags consistent: warning: [GHC-74335] [-Winconsistent-flags]
    Byte-code linking does not currently support linking an executable, enabling -no-link

And lens.cabal contains -O2, so that could be relevant.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information