Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack_snapshot ignores stack warning about missing Cabal file in archive overrides #1762

Open
aherrmann opened this issue Jun 15, 2022 · 0 comments
Labels
P2 major: an upcoming release type: bug

Comments

@aherrmann
Copy link
Member

Describe the bug
Using a local snapshot to point to an archive URL or specific Github commit/fork will silently ignore the override and still use the Hackage version of the underlying resolver if the new archive does not include a Cabal file.

Specifically, stack ls dependencies json --global-hints --external will print out a warning of the form

DEPRECATED: The package at Archive from https://github.com/fpco/unliftio/archive/de13c448e4b77e8ce318b78445e17f6c20003325.tar.gz in subdir unliftio does not include a cabal file.
Instead, it includes an hpack package.yaml file for generating a cabal file.
This usage is deprecated; please see https://github.com/commercialhaskell/stack/issues/5210.
Support for this workflow will be removed in the future.

But, it will still return exit code 0 and ignore the archive override and stack_snapshot does not notice that something went wrong.

To Reproduce

  1. Use a local Stackage snapshot of the form
    resolver: nightly-2022-06-10
    packages:
      - github: "fpco/unliftio"
        commit: de13c448e4b77e8ce318b78445e17f6c20003325
        subdirs:
          - unliftio-core
          - unliftio
    
    and add unliftio-core to the packages attribute of stack_snapshot.
  2. Repin the snapshot repository.
  3. Inspect the generated lock-file and observe that unliftio-core is still fetched from Hackage instead of Github at commit de13c448.

Expected behavior
If stack cannot provide the requested override in a custom snapshot, then stack_snapshot fetch/pin should fail with a clear error message, instead of silently ignoring the issue.

Environment

  • OS name + version: Ubuntu 21.10
  • Bazel version: 4.2.1
  • Version of the rules: b8ac6c1

Additional context
commercialhaskell/stack#5210 points out that repositories should contain a Cabal file.

@aherrmann aherrmann added P2 major: an upcoming release type: bug labels Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 major: an upcoming release type: bug
Projects
None yet
Development

No branches or pull requests

1 participant