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

Add fits-parse #7109

Closed
wants to merge 1 commit into from
Closed

Add fits-parse #7109

wants to merge 1 commit into from

Conversation

krakrjak
Copy link
Contributor

@krakrjak krakrjak commented Sep 8, 2023

Checklist:

  • Meaningful commit message, eg add my-cool-package (please don't mention build-constraints.yml)
  • At least 30 minutes have passed since uploading to Hackage
  • [ --N/A-- ] If applicable, required system libraries are added to 02-apt-get-install.sh or 03-custom-install.sh
  • (optional) Package is compatible with the latest version of all dependencies (Run cabal update && cabal outdated)
  • (optional) Package have been verified to work with the latest nightly snapshot, e.g by running the verify-package script

The script runs virtually the following commands in a clean directory:

  stack unpack $package-$version # `-$version` is optional
  cd $package-$version
  rm -f stack.yaml && stack init --resolver nightly --ignore-subdirs
  stack build --resolver nightly --haddock --test --bench --no-run-benchmarks

The script was tested against the stack sdist for version 0.3.4 that was uploaded to Hackage on or about 9:30pm CDT. A few testing weaknesses were found using version 0.3.3 (and earlier versions). Therefore, I'm asking to include version 0.3.4 and newer uploads for the fits-parse package to be included in future stackage releases.

@alaendle
Copy link
Member

alaendle commented Sep 8, 2023

Sure you've tested against the nightly resolver? Some dependencies in your package doesn't match the versions defined by current stackage nightly.

megaparsec-9.4.1 (changelog) is out of bounds for:

mtl-2.3.1 (changelog) is out of bounds for:

optparse-applicative-0.18.1.0 (changelog) (Grandfathered dependencies) is out of bounds for:

@krakrjak
Copy link
Contributor Author

krakrjak commented Sep 9, 2023

Maybe I'm doing something wrong. All those constraints get generated by stack sdist when generating the cabal file. If I follow the script (and deviate just a little), here's what I get.

stack unpack fits-parse
cd fits-parse-0.3.4
rm -f stack.yaml* fits-parse.cabal 
stack init --resolver nightly --ignore-subdirs
stack build --resolver nightly --haddock --test --bench --no-run-benchmarks

Then the script works perfectly for me. I did delete three files in the cleanup from the sdist for this to work. I deleted the stack.yaml, stack.yaml.lock, and the fits-parse.cabal file. This leaves a perfectly valid, no package version bounds hpack package.yaml and when stack generates the new cabal file with nightly, everything is fine.

If I stack unpack fits-parse then only remove stack.yaml, I get an error and no stack.yaml gets generated.

❯ stack init --resolver nightly --ignore-subdirs
Looking for Cabal or package.yaml files to use to initialise Stack's project-level YAML configuration file.

Using the Cabal packages:
* ./

Specified file "stack.yaml" for extra-source-files does not exist
/Users/krakrjak/src/pkgtesting/fits-parse-0.3.4/fits-parse.cabal was modified manually. Ignoring /Users/krakrjak/src/pkgtesting/fits-parse-0.3.4/package.yaml in favor of the Cabal file.
If you want to use the package.yaml file instead of the Cabal file,
then please delete the Cabal file.
Selected resolver: nightly-2023-09-09.
Selected the snapshot nightly-2023-09-09.

Error: [S-2422]
       Snapshot nightly-2023-09-09 does not have all the packages to match your requirements.
       
           megaparsec version 9.4.1 found
               - fits-parse requires <9.4
           mtl version 2.3.1 found
               - fits-parse requires <2.3
           optparse-applicative version 0.18.1.0 found
               - fits-parse requires <0.18
           Using package flags:
               - fits-parse: FlagName "examples" = False
           
       This may be resolved by:
       * Using --omit-packages to exclude mismatching package(s).
       * Using --resolver to specify a matching snapshot/resolver

I'm not sure what I'm doing wrong.

@Daniel-Diaz
Copy link
Contributor

@krakrjak

It is the .cabal file that is restricting the versions your package can build with. For example, you have megaparsec <9.4 in the cabal file, but current nightly snapshot has 9.4.1. Therefore, your package can't be built against the nightly snapshot.

I haven't checked, but I guess a similar problem affects mtl and optparse-applicative.

@krakrjak
Copy link
Contributor Author

OK, then how do I fix it? The .cabal file is generated by stack. I'm sure it's setting all those version boundaries based on the LTS the stack.yml is configured for. Do you have a suggestion as to how I can generate an sdist that will be suitable for both uploading to Hackage and will work for getting this package adopted/passing checks?

@Daniel-Diaz
Copy link
Contributor

OK, then how do I fix it? The .cabal file is generated by stack. I'm sure it's setting all those version boundaries based on the LTS the stack.yml is configured for. Do you have a suggestion as to how I can generate an sdist that will be suitable for both uploading to Hackage and will work for getting this package adopted/passing checks?

I see. I'm not sure as I have never worked like that. I manually edit my .cabal files. I guess you could just edit it after it was generated?

@alaendle
Copy link
Member

@krakrjak Maybe you haven't used a resolver in conjunction with the sdist command? I did a quick check on your code using

stack sdist . --pvp-bounds=both --resolver=nightly

and the Cabal file shows the up-to-date bounds.

@juhp juhp changed the title ➕ Add fits-parse package to build-constraints.yaml Add fits-parse Sep 12, 2023
@DanBurton
Copy link
Contributor

Kindly reopen when the issue with package constraints has been addressed.

@DanBurton DanBurton closed this Sep 18, 2023
@krakrjak krakrjak mentioned this pull request Sep 27, 2023
4 tasks
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

Successfully merging this pull request may close these issues.

4 participants