Skip to content

Errors trying to start the live development server (cabal run app) #28

@mtamc

Description

@mtamc

README gives incorrect command (cabal run):

The run command is for running a single executable at once. The target '' refers to the package miso-ui-0.1.0.0 which includes
- executables: app and prerender

running cabal run app in the default nix dev environment crashes with exception

app: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:

Prelude.undefined

HasCallStack backtrace:
  undefined, called at ffi/ghc/Miso/DSL/FFI.hs:72:15 in miso-1.9.0.0-c6eb519e559e6b7c3e09443f01e6b22d635be9a9d7c5bf461ce9b9b60b2f8209:Miso.DSL.FFI

attempting instead nix develop .#wasm --command bash -c 'cabal update && cabal run app' throws

/nix/store/z3za8hfc24wb117s50p8b10agjkgm039-binutils-2.44/bin/ld: cannot find -lgmp: No such file or directory
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Error: [Cabal-7125]
Failed to build miso-ui-0.1.0.0 (which is required by exe:app from miso-ui-0.1.0.0).

Same for .#ghcjs:

/nix/store/z3za8hfc24wb117s50p8b10agjkgm039-binutils-2.44/bin/ld: cannot find -lgmp: No such file or directory
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Error: [Cabal-7125]
Failed to build miso-ui-0.1.0.0 (which is required by exe:app from miso-ui-0.1.0.0).

After adding gmp to the nix build input for the wasm and ghcjs shells I get a similar exception as the default dev shell

wasm:

app: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:

Prelude.undefined

HasCallStack backtrace:
  undefined, called at ffi/ghc/Miso/DSL/FFI.hs:72:15 in miso-1.9.0.0-1c0e0e01d037df72814986dbeeaeb487b915c613331228fbb60db45922d5722c:Miso.DSL.FFI

ghcjs:

app: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:

Prelude.undefined

HasCallStack backtrace:
  undefined, called at ffi/ghc/Miso/DSL/FFI.hs:72:15 in miso-1.9.0.0-1c0e0e01d037df72814986dbeeaeb487b915c613331228fbb60db45922d5722c:Miso.DSL.FFI

patched flake.nix:

{

  inputs = {
    miso.url = "github:dmjio/miso";
    nixpkgs.follows = "miso/nixpkgs";
  };

  outputs = inputs:
  inputs.miso.inputs.flake-utils.lib.eachDefaultSystem (system:
    let
      pkgs = inputs.nixpkgs.legacyPackages.${system};
      wasmShell = inputs.miso.outputs.devShells.${system}.wasm;
      ghcjsShell = inputs.miso.outputs.devShells.${system}.ghcjs;
    in
    {
      devShells.default = inputs.miso.outputs.devShells.${system}.default;
      devShells.wasm = wasmShell.overrideAttrs (old: {
        buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.gmp ];
      });
      devShells.ghcjs = ghcjsShell.overrideAttrs (old: {
        buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.gmp ];
      });
    });

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions