Skip to content

Build with Nix#57

Draft
georgefst wants to merge 14 commits into
masterfrom
nix-2025
Draft

Build with Nix#57
georgefst wants to merge 14 commits into
masterfrom
nix-2025

Conversation

@georgefst

@georgefst georgefst commented Nov 5, 2025

Copy link
Copy Markdown
Owner

A re-attempt of #44, motivated no longer just by cross-compiling, but by developing on my NixOS machines.

Currently nix build basically works, but I haven't really thought about how to get a decent development workflow with incremental builds.

Comment thread flake.nix
# TODO apply this only on Windows targets somehow?
# unclear how to do that here, or correct syntax for putting `configureFlags` in `cabal.project`
# if possible we should just avoid `basement` due to abandonment and memory safety issues
# we only rely on it due to TLS stuff in Dhall

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, TLS stuff in Dhall is easily disabled, but it seems we have other paths to basement.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, even with all this, the build hangs later on: [6/3/21 built] building streamly-core-lib-streamly-core-x86_64-w64-mingw32-0.2.3 (buildPhase): Listening on port 9307

It turns out files under `extra-source-files` are not found at compile time (`file-embed`) unless they're in `rsc` (and not as symlinks), and known to Git (staging makes a difference, which confused me for a while, e.g. in georgefst/hello-hs@fa41589).

We ran:
```sh
cp js/main.js haskell/rsc/main.js
cp css/common.css haskell/rsc/common.css
cp css/login.css haskell/rsc/login.css
cp css/app.css haskell/rsc/app.css
(cd elm && elm make src/Main.elm --output /tmp/monpad-elm.js --optimize && cd ..) && closure-compiler /tmp/monpad-elm.js --js_output_file haskell/rsc/elm.js
echo '(./dhall/lib/map-layout.dhall).toLinux (./dhall/default.dhall)' | dhall > haskell/rsc/default.dhall
```
We've had various issues with Windows, so we're dropping it for now until everything else has solidified. These snippets may be worth reviving:

```
modules = [{ packages.basement.configureFlags = [ "--gcc-option=-Wno-error=int-conversion" ]; }];
```

```
-- TODO this just avoids a transient Haskell.Nix issue, where it tries to apply a redundant patch to 0.2.3.1
if os(windows)
  constraints:
    streaming-commons==0.2.3.0
```
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