Skip to content

ghcjs: app does not get built unless i --force-dirty #1797

Closed

Description

@emmanueltouzery

I have a use-case with GHCJS, in fact the source is there: https://github.com/emmanueltouzery/cigale-timesheet/

the main app is at the root, and I have an install.sh to set things up. The ghcjs part is under src/WebGui.

The problem that I have is that once the ghcjs app is build, if I go in src/WebGui, modify for instance Config.hs, in a way to make absolutely sure that the source shouldn't build anymore, then I run stack build, the code is not rebuilt. Stack simply outputs some warnings about ignoring some different package versions (as it does when it builds the app) and then does nothing.

If I use --force-dirty it does rebuild it, but it's a major pain because it also rebuilds (or at least reinstalls) many dependencies of the app and the build time is very slow.

I broke the compilation on purpose, and ran stack build -v, it didn't build, and this is the output:
https://www.dropbox.com/s/nkj7axpi0vx3jl2/stack-no-build.txt?dl=0

Then without any other changes, I ran stack build --force-dirty -v, it did build, and this is the output:
https://www.dropbox.com/s/ijrv4izagmrr0jr/stack-dirty-build.txt?dl=0

Activity

  1. mgsloan commented on Feb 17, 2016

    @mgsloan
    Contributor

    The dirtiness checking probably isn't working because other-modules: isn't specified in the cabal file. When things do compile properly, it should warn you that the modules aren't listed.

  2. added this to the Support milestone on Feb 17, 2016
  3. emmanueltouzery commented on Feb 17, 2016

    @emmanueltouzery
    Author

    Thank you for the answer! I'll check tonight and update the bug.

  4. emmanueltouzery commented on Feb 17, 2016

    @emmanueltouzery
    Author

    so I think there's such a warning for the root project, but not for the ghcjs project, which is under src/WebGui/web-gui.cabal (and that's the problematic one with the dirty check).

    no warning output, but it really seems that adding:

    other-modules:
    Config,
    Common,
    EventsView,
    FilePicker

    to the cabal does fix the issue. I thought other-modules was needed only for libraries :-(

    not sure whether to close the issue or leave it open due to the non-warning about 'other-modules'.

  5. mgsloan commented on Feb 18, 2016

    @mgsloan
    Contributor

    Are you sure there are no warnings? They look like this:

    ...
    Preprocessing executable 'exe' for pkg-0.1.1.0...
    Warning: module not listed in pkg.cabal for 'exe' component (add to other-modules): Modu
    pkg-0.1.1.0: copy/register
    ...
    

    They're kinda jammed in the middle of output, so it's hard to notice them. This is discussed a little here

  6. mgsloan commented on Feb 18, 2016

    @mgsloan
    Contributor

    Closing since the main issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions