Skip to content

Irreproducibility: Code rebuilds only the first time I switch resolvers #5381

@nh2

Description

@nh2

When I switch between lts-14.27 and lts-13.26 repeatedly, stack rebuilds my code only on the first such switch.

This is illegitmate because my executable depends on (at least) conduit-extra, and that one's version switches between those LTSs.

Background / how I found this

I'm debugging an issue with my library:

The project for reproing (on Ubuntu 18.04): https://github.com/nh2/lz4-frame-conduit/tree/4616ec594426de2defda6432eec9cff04692bf7c

Command to run:

stack test && while (.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/lz4-frame-conduit-test/lz4-frame-conduit-test); do sleep 0.01; done

When I test after stack clean, my bug (a segfault or GHC panic) occurs with

resolver: lts-13.26

and not with

resolver: lts-14.27

The actual Stack issue

But when I switch between the 2 and run stack test without previous stack clean, most of the time stack doesn't rebuild the code, so then I cannot observe the difference when switching resolvers.

I get this strange behaviour:

stack clean
stack test # builds from scratch
stack test # naturally builds nothing

# I switch resolvers, lts-13.26 -> lts-14.27

stack test
# Rebuilds code; outputs:
#     lz4-frame-conduit-0.1.0.0: unregistering (local file changes: README.md app/Main.hs lz4-frame-conduit.cabal lz4/lib/lz4.c lz4/lib/lz4.h lz4/lib/lz4frame.c lz4/...)
# Why is that? None of these files changed.

# I switch resolvers back, lts-14.27 -> lts-13.26

stack test # Does not rebuild! No further resolver switching rebuilds.

So it rebuilds only the first time I switch resolvers (but for apparently the wrong reason), and then never again.

Metadata

Metadata

Assignees

No one assigned

    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