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

Document Stackage use with remote project config #8083

Merged
merged 2 commits into from
Apr 7, 2022
Merged

Document Stackage use with remote project config #8083

merged 2 commits into from
Apr 7, 2022

Conversation

ysangkok
Copy link
Member

@ysangkok ysangkok commented Apr 5, 2022

This may be a bit too opinionated, and I'd be happy to water it down. But I think it would be nice to explain how to use Stackage, and how it compares.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great.


If you use the following ``cabal.project`` file, the packages of the snapshot
would be constrained to specific versions. The Cabal solver is then liberated
from determining which versions to use, since it has already been determined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if liberated would be appropiate here. In fact the solver is constrained to use those versions, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have removed this part in the new version of the PR which is af9cb08

::

packages: .
import https://www.stackage.org/lts-19.2/cabal.config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it would be too much info but you could leverage if's to import several lts on ghc version in the same cabal.project

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's defer this to a future PR. I think it is nice to have a simple example.

which specifies all of your dependencies' versions.

A disadvantage of this approach is that consumers who don't use Stackage may
suffer from the lacking bounds on your package. If published to Hackage, people
Copy link
Member

@jneira jneira Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage of lts does not imply necessarily not using bounds in .cabal files. In fact i would recommend use them anyways, in the form ^>=1.0 || ^>=2.1 || ... if you want to support several ghcs/lts's. So you will have the lts and .cabal files checked one against the other and no stackage users will be happy.

I think lts usage should not be seen as a way to avoid set cabal bounds but a way to ensure your build is reproducible. And .cabal bounds would help to accomplish it too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This discussion as a whole is too gentle. Hackage uploads, by hackage policy, should conform to the pvp, full stop: https://hackage.haskell.org/upload

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section should simply point out that project files, including imports of other project files, do not get bundled in cabal package tarballs, and so project files are intended for use in local development environments, not for distribution. And it should point out that packages intended for distribution should have pvp compliant version bounds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have added the suggestion by @gbaz in 79d84d5.

:ref:`remote project configuration file<conditionals and imports>`:.
This frees you from having to determine the acceptable version bounds for your
dependencies, as described in the previous section.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't free you from anything. It just lets you further constrain things.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed in the revised PR.

@gbaz
Copy link
Collaborator

gbaz commented Apr 5, 2022

Adding a reference to stackage is reasonable, I suppose. However, I don't think that any of this material belongs in the quickstart section -- this is a feature of project files, and project files don't belong in quickstart at all. They're an advanced feature, and quickstart is supposed to describe a simple, minimal workflow.

@ysangkok
Copy link
Member Author

ysangkok commented Apr 5, 2022

All right, lots of problems with this it seems, so I'll close

@ysangkok ysangkok closed this Apr 5, 2022
@ysangkok ysangkok deleted the janus/explain-stackage branch April 5, 2022 13:57
@Mikolaj
Copy link
Member

Mikolaj commented Apr 5, 2022

Hey, what about my enthusiastic review? :D

I'm sure this can be scavenged (but no pressure).

@ysangkok ysangkok restored the janus/explain-stackage branch April 5, 2022 19:40
@ysangkok ysangkok reopened this Apr 5, 2022
Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, many thanks for the rework
i would like to know @gbaz thoughts before merge though

@jneira jneira requested a review from gbaz April 7, 2022 10:44
Copy link
Collaborator

@gbaz gbaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@jneira jneira merged commit f90d541 into haskell:master Apr 7, 2022
@ysangkok ysangkok deleted the janus/explain-stackage branch April 7, 2022 17:49
@fgaz fgaz mentioned this pull request Nov 18, 2022
10 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