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 no longer detects newest snapshot with default configuration #6516

Closed
konn opened this issue Mar 11, 2024 · 6 comments
Closed

Stack no longer detects newest snapshot with default configuration #6516

konn opened this issue Mar 11, 2024 · 6 comments

Comments

@konn
Copy link

konn commented Mar 11, 2024

General summary/comments (optional)

stack new no longer keeps track with the latest Stackage snapshots unless we specify urls.latest-snapshot in ~/.stack/config.yaml.

Steps to reproduce

For example:

  1. Run stack new --resolver nightly myproj

Expected

When run at 2024-03-11 15:35 JST, it must pick nightly-2024-03-11 as the full snapshot name.

Actual

It picks older one:

Selected resolver: nightly-2024-02-12.
Selected the snapshot nightly-2024-02-12.
Initialising Stack's project-level YAML configuration file using snapshot nightly-2024-02-12.

If you suspect that a Stack command misbehaved, please include the output of
that command in --verbose mode. If the output is larger than a page please
paste the output in a Gist.

$ stack new --resolver nightly myproj --verbose
Version 2.15.1, Git revision 2828cc5326e27f16db480b1a7826a91004dcc2bc x86_64 hpack-0.36.0
2024-03-11 15:37:04.421476: [debug] No project config file found, using defaults.
2024-03-11 15:37:04.423694: [debug] Use of Casa server enabled: (CasaRepoPrefix "https://casa.stackage.org", 1280).
2024-03-11 15:37:04.427287: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2024-03-10 06:37:04.427214965 UTC]
2024-03-11 15:37:04.428258: [debug] Opening local template: "new-template.hsfiles"
2024-03-11 15:37:04.428469: [info] Downloading template new-template to create project myproj in directory myproj/...
2024-03-11 15:37:04.428602: [debug] Downloading /repos/commercialhaskell/stack-templates/contents/new-template.hsfiles
2024-03-11 15:37:04.783371: [info] /home/konn/.stack/templates/new-template.hsfiles: download has begun
2024-03-11 15:37:04.783739: [info] /home/konn/.stack/templates/new-template.hsfiles:    6.71 KiB downloaded...
2024-03-11 15:37:04.784110: [info] Downloaded /home/konn/.stack/templates/new-template.hsfiles.
2024-03-11 15:37:04.784167: [debug] Opening local template: "/home/konn/.stack/templates/new-template.hsfiles"
2024-03-11 15:37:04.786834: [info] 
Note: The following parameters were needed by the template but not provided: author-email,
      author-name, category, copyright and github-username.
      
      You can provide them in Stack's global YAML configuration file (/home/konn/.stack/config.yaml)
      like this:
      
      templates:
        params:
          author-email: value
          author-name: value
          category: value
          copyright: value
          github-username: value
      
      Or you can pass each one on the command line as parameters like this:
      
      stack new myproj new-template -p "author-email:value" -p "author-name:value" -p
      "category:value" -p "copyright:value" -p "github-username:value"
      
2024-03-11 15:37:04.788333: [info] Looking for Cabal or package.yaml files to use to initialise Stack's project-level YAML
configuration file.

2024-03-11 15:37:04.788697: [info] Using the Cabal packages:
* myproj/

2024-03-11 15:37:04.790122: [debug] Running Hpack on /home/konn/myproj/package.yaml
2024-03-11 15:37:04.793482: [debug] Hpack generated a modified version of /home/konn/myproj/myproj.cabal
2024-03-11 15:37:04.796270: [debug] Downloading snapshot versions file from https://s3.amazonaws.com/haddock.stackage.org/snapshots.json
2024-03-11 15:37:05.698587: [debug] Done downloading and parsing snapshot versions file
2024-03-11 15:37:05.698724: [info] Selected resolver: nightly-2024-02-12.
2024-03-11 15:37:05.976457: [info] Selected the snapshot nightly-2024-02-12.
2024-03-11 15:37:05.977138: [info] Initialising Stack's project-level YAML configuration file using snapshot nightly-2024-02-12.
2024-03-11 15:37:05.977224: [info] Considered 1 user package.
2024-03-11 15:37:05.977253: [info] Writing configuration to myproj/stack.yaml.
2024-03-11 15:37:05.977889: [info] Stack's project-level YAML configuration file has been initialised.

On the other hand, if we add the following to ~/.stack/config.yaml, it picks the right one:

urls:
  latest-snapshot: https://www.stackage.org/download/snapshots.json

It seems that the default storage on S3 (http://s3.amazonaws.com/haddock.stackage.org/snapshots.json) is no longer up to date with the stackage. If this is not as intended (by Stackage maintainers), this might be a bug of Stackage, not Stack.

Stack version

$ stack --version
Version 2.15.1, Git revision 2828cc5326e27f16db480b1a7826a91004dcc2bc x86_64 hpack-0.36.0

Method of installation

  • Via GHCup

Platform

Ubuntu 20.04.6 and macOS

@mpilgrem
Copy link
Member

@konn, thanks for reporting. I think Stack's default is: https://s3.amazonaws.com/haddock.stackage.org/snapshots.json and that does not seem to be up to date. Perhaps the handover of Stackage from FP Complete to the Haskell Foundation means that default needs to change. I'll make some enquiries.

@mpilgrem
Copy link
Member

The current default was introduced in 2016:

@mpilgrem
Copy link
Member

@chreekat, may I ask you to look at my comments above and the Reddit post.

mpilgrem added a commit that referenced this issue Mar 11, 2024
@mpilgrem
Copy link
Member

@chreekat gave me some input on Matrix: the default URL does need to change, and https://stackage-haddock.haskell.org/snapshots.json will likely be the most reliable one.

mpilgrem added a commit that referenced this issue Mar 11, 2024
@mpilgrem
Copy link
Member

@konn, this should be fixed in Stack's master branch. If you are not using GHCup to manage versions of Stack: stack upgrade --source-only --git.

@konn
Copy link
Author

konn commented Mar 11, 2024

Thanks! I installed stack via ghcup as noted above and not in a hurry, so I will wait for new release.

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

No branches or pull requests

2 participants