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

WIP/RFC: LTS build constraints #6359

Closed
wants to merge 10 commits into from
Closed

WIP/RFC: LTS build constraints #6359

wants to merge 10 commits into from

Conversation

bergmark
Copy link
Member

@bergmark bergmark commented Dec 12, 2021

Warning for ugly code.

Requires: commercialhaskell/curator#25

From that PR:

I think this would simplify the LTS workflow as we can handle LTS like nightly. Maintainers can file PRs instead of curators having to make manual changes to the intermediary files.

This is a first attempt to combine the latest nightly snapshot with the latest build-constraints.yaml to generate a lts-build-consttraints.yaml with major version bounds based on versions in nightly. Essentially we treat every version in the snapshot as ^>= v and intersect that with what's in build-constraints.

lts-build-constraints.yaml was generated using this new binary, so you can check it out to see what the new files would look like. I chose to not parse as actual yaml, it simplified things since I wanted to keep all formatting intact. I could probably use HsYAML for that but it seemed like a lot of extra work

where
(a, b) = takeDropWhile_ p s

takeDropWhile_ :: (Char -> Bool) -> Text -> (Text, Text)
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this just a suboptimal Data.Text.span?


takePrefix :: Text -> Text -> Maybe (Text, Text)
takePrefix p s =
if p `T.isPrefixOf` s
Copy link
Contributor

Choose a reason for hiding this comment

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

Data.Text.stripPrefix?

@juhp juhp mentioned this pull request Sep 12, 2023
@jkachmar jkachmar force-pushed the master branch 5 times, most recently from 9a02ea3 to dc3a771 Compare October 9, 2023 04:19
@bergmark bergmark force-pushed the lts-build-constraints branch from 98bda85 to 8f209c3 Compare December 15, 2023 16:31
@bergmark
Copy link
Member Author

bergmark commented Dec 18, 2023

$ ./check-lts 22.1
$ commenter diff-snapshot ../stackage-snapshots/lts/22/0.yaml snapshot.yaml
^ stack-clean-old-0.5 -> 0.5.1
^ streamly-core-0.2.0 -> 0.2.1

@juhp
Copy link
Contributor

juhp commented Dec 22, 2023

One question: shouldn't this (the workflow) use the appropriate lts branch.

Well I suppose the code doesn't need to be branch aware necessarily...

@bergmark
Copy link
Member Author

Hmm I don't think so? We use the branches to trigger docker builds, but the nightly build-constraints is still on master. Are you thinking about maintaining multiple LTSes? If so, we could have lts-22-build-constraints.yaml etc. Are there any other considerations?

@juhp
Copy link
Contributor

juhp commented Dec 22, 2023

I feel the workflows will be cleaner if we separate lts and nightly commits to separate branches if possible

@bergmark bergmark force-pushed the lts-build-constraints branch from 58b2706 to f242352 Compare December 22, 2023 15:34
@mihaimaruseac
Copy link
Contributor

I think multiple branches will make it harder to copy chunks from one build-constraints file to another. But I think it would be self-documenting and allowing for multiple LTSes if we have multiple yaml files, one for nightly and one for each LTS that we migrate to this

@juhp
Copy link
Contributor

juhp commented Dec 23, 2023

I still have a hope that when we come to make lts-23 we can just fork the master branch and build minor releases off that. That still seems the most clean and consistent workflow to me.
But let's see :-) It is also possible that using the separate repo for lts-haskell will create less confusion for everyone.

@juhp juhp self-requested a review December 23, 2023 03:27
@juhp
Copy link
Contributor

juhp commented Dec 23, 2023

You can tweak the curator hash in build.sh now to pull in your new code.

check-lts Outdated
Copy link
Contributor

@juhp juhp Dec 23, 2023

Choose a reason for hiding this comment

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

I think it makes sense to move this to lts-haskell if that is where the constraints will live for now?

We will want to run it in CI anyway.

@juhp
Copy link
Contributor

juhp commented Dec 23, 2023

Where or when does lts-constraints get run or used?

@juhp juhp closed this Jan 18, 2024
@juhp
Copy link
Contributor

juhp commented Jan 18, 2024

@bergmark I closed this since I believe you implemented most if it in curator and lts-haskell instead, right?

Is the lts-constraints tool still useful?

@juhp
Copy link
Contributor

juhp commented Dec 9, 2024

merged into master at e666743

@juhp juhp closed this Dec 9, 2024
@juhp juhp deleted the lts-build-constraints branch December 9, 2024 10:51
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