-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
maintainers/scripts/haskell/exclude.nu: init #441204
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
Open
wolfgangwalther
wants to merge
4
commits into
NixOS:haskell-updates
Choose a base branch
from
wolfgangwalther:haskell-updates-excluded
base: haskell-updates
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
83fbc34
.editorconfig: nu scripts should have 4 spaces indent
wolfgangwalther c8407c9
maintainers/scripts/haskell/exclude.nu: init
wolfgangwalther 94704a0
haskellPackages: exclude old, broken packages
wolfgangwalther 4be76c1
haskellPackages: mark previously transitively broken as broken
wolfgangwalther File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #! /usr/bin/env nix-shell | ||
| #! nix-shell -i nu -p nushell flock gnused -I nixpkgs=. | ||
|
|
||
| # This script will add all packages that match the following criteria to the exclusion list: | ||
| # - Is either marked directly or transitively broken. | ||
| # - Has not been updated on hackage in the last 5 years. | ||
| # - Is not listed in the Stackage snapshot. | ||
| # hackage2nix will not create expressions for excluded packages. | ||
|
|
||
| use std log | ||
|
|
||
| let broken_config = "pkgs/development/haskell-modules/configuration-hackage2nix/broken.yaml" | ||
| let transitive_broken_config = "pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml" | ||
| let stackage_config = "pkgs/development/haskell-modules/configuration-hackage2nix/stackage.yaml" | ||
| let excluded_config = "pkgs/development/haskell-modules/configuration-hackage2nix/excluded.json" | ||
|
|
||
| def main [] { | ||
| let broken = $broken_config | open | get broken-packages | ||
| let transitive_broken = $transitive_broken_config | open | get dont-distribute-packages | ||
| let stackage = $stackage_config | open | get default-package-overrides | parse "{name} {constraint}" | ||
|
|
||
| $broken ++ $transitive_broken | ||
| | where ($it not-in $stackage.name) | ||
| | par-each {|package| | ||
| try { | ||
| let updated = http get $"https://hackage.haskell.org/package/($package)/upload-time" | into datetime | ||
| if $updated < ("5 years ago" | date from-human) { | ||
| log info $"($package): last updated at ($updated)" | ||
| # This is not efficient at all, but will: | ||
| # - keep comments in broken.yaml | ||
| # - allow to cancel the script at any time without losing progress | ||
| ^flock -x $broken_config -c $"sed -i -e '/^ - ($package) /d' ($broken_config)" | ||
| ^flock -x $transitive_broken_config -c $"sed -i -e '/^ - ($package)$/d' ($transitive_broken_config)" | ||
| ^flock -x $excluded_config -c $"sed -i -e '/"__insert-target-for-script__"/a\\ "($package)",' ($excluded_config)" | ||
| } | ||
| } catch {|err| | ||
| # "Network failure" happens for 404 responses, for example for versioned attributes like aeson_1_5_6_0 | ||
| log warning $"($package): ($err.msg)" | ||
| } | ||
| } | ||
|
|
||
| ^treefmt $excluded_config | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.