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

Implement v2-outdated command #9373

Draft
wants to merge 207 commits into
base: master
Choose a base branch
from
Draft

Conversation

erikd
Copy link
Member

@erikd erikd commented Oct 26, 2023

Implement a v2-outdated command which is simply the v2 version of the outdated command.

It does all the v2 style setup in order to extract a PackageVersionConstraint list and then calls into the v1 version of the command for the logic and IO for the results.

Include the following checklist in your PR:

Bonus points for added automated tests!

Note: The diff on the file CmdOutput.hs is rather weird because this PR renames CmsOutdated.hs to Outdated.hs and then creates a new file CmdOutput.hs.

QA Notes

  • The v2-outdated command should work in an old project directory layout (a single top level <package>.cabal file) and a new project directory with just a cabal.project file.

@erikd erikd requested review from andreabedini and fendor October 26, 2023 00:17
@erikd erikd force-pushed the erikd/v2-outdated branch 7 times, most recently from c9ad027 to 4bd7f60 Compare October 26, 2023 00:45
toPackageVersionConstraint (Dependency name versionRange _) =
PackageVersionConstraint name (simplifyVersionRange versionRange)

genericPackageDependencies :: GenericPackageDescription -> [Dependency]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we can preserve the structure of the conditionals when presenting the results to the user. E.g. we can map CondTree ConfVar [Dependency] component into CondTree ConfVar [OurResultForDependency] Library` and use that to form the final report.

@erikd erikd marked this pull request as draft October 26, 2023 07:07
@erikd erikd force-pushed the erikd/v2-outdated branch 3 times, most recently from 342c092 to 6c083a9 Compare October 27, 2023 04:39
@erikd erikd force-pushed the erikd/v2-outdated branch from 6c083a9 to 48ccdf8 Compare November 14, 2023 02:25
@erikd erikd force-pushed the erikd/v2-outdated branch 6 times, most recently from cc3602f to 598c651 Compare November 27, 2023 04:32
ulysses4ever and others added 8 commits October 24, 2024 13:43
…askell#10014)

* add the applicable new (versions 9.2 - 9.10) GHC flags to normaliseGhcArgs

Actionable flags are:
- fdiagnostics-as-json (changes the format GHC outputs its diagnostics)
- fprint-error-index-lists (changes the way GHC displays compile time)
- fbreak-points (enables/disables break-points in GHCi)
- dipe-stats (dumps information about which info tables have IPE
  information)
- ffamily-application-cache (only changes the speed of the compiler)
- fprint-redundant-promotion-ticks
- show-error-context
- unoptimized-core-for-interpreter (only applies to GHCi)

* [chore] correct the flag names and add a FUTUREWORK
… (haskell#10093)

GHC 9.10 ships with a new wired-in package, ghc-internal, which cannot
be reinstalled. This commit prevents cabal-install from attempting it.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…#10100)

Issue haskell#10063 points out that cabal exits before the external command
has finished executing. This was a simple oversight to not
waitForProcess on the result of calling createProcess.

This also points out the flaw that there isn't a way for external
commands to signal failure, so we now also propagate the exit code from
the external process.

Fixes haskell#10063
This commit implements the Configure build-type in terms of Hooks,
when build-type: Hooks is available (for Cabal >= 3.13).

This moves Configure away from an implementation in terms of UserHooks,
i.e. away from the Custom build-type.
Be sure to invalidate the cache if building throws an exception!
If not, we'll abort execution with a stale recompilation cache.
See ghc#24926 for an example of how this can go wrong.
9999years and others added 29 commits October 24, 2024 13:43
This seems to fix an error where `long-tests` isn't built?
This change ensures all temporal files are created in the system temp directory
which usually is in a short path. This helps with Windows not being capable of
creating temp files in long directories, like the ones that result from
Backpack.

See how GetTempFileNameW specifies:

> The string cannot be longer than `MAX_PATH–14` characters or `GetTempFileName`
will fail.

And actually there is a TODO in `Win32Utils.c` in GHC:

https://gitlab.haskell.org/ghc/ghc/-/blob/3939a8bf93e27d8151aa1d92bf3ce10bbbc96a72/libraries/ghc-internal/cbits/Win32Utils.c#L259

Closes haskell#10191.
…y ways

In the profiling dynamic patch I made a mistake when computing the
needed ways for a build.

When building an executable, the Haskell modules need to be built

* For the final link way
* For the build way of the compiler if TH is enabled

Before this patch, the modules were being built for all the configured
library ways, which built modules in more configurations than the
previous version of Cabal.

Fixes haskell#10418
Bug copied from `changelog-d`'s `README.md`. A good example of why
copying it into `CONTRIBUTING.md` because we can't reference it
from there is a bad idea. ☹
The `HaddockKeepTmpsCustom` test added in haskell#10392 skewed against haskell#10366,
which changes where temporary files are written.

We can work around this by setting `$TMPDIR` and `$TEMP` while running
tests, so that temporary files are written to the test's temporary
directory rather than the system one.
Running ./setup install will give you an error:

```
fromFlag NoFlag. Use fromFlagOrDefault
CallStack (from HasCallStack):
  error, called at src/Distribution/Simple/Flag.hs:110:19 in Cabal-3.15.0.0-inplace:Distribution.Simple.Flag
  fromFlag, called at src/Distribution/Simple/Register.hs:161:16 in Cabal-3.15.0.0-inplace:Distribution.Simple.Register
```

This seems to not be tested anywhere and most people will use ./setup
register in any case, but we should fix this for the next point release
in 3.14 series. # Please enter the commit message for your changes.
Lines starting

Fixes haskell#10416
GitHub's branch protection rules just don't cut it. (As a result,
neither does GitHub's merge queue.)
This helper function was challenging to understand, so I added
an explicit type signature and documentation comments to it.
* Handle licences starting with a digit

cabal has a devscript that parses a json file (containing SPDX licences)
and returns a number of of Haskell data constructors.

There have been problems when the SPDX short identifier starts with
a digit (e.g. “0BSD”), as that would generate an data constructor
starting with a digit, which is not valid Haskell.
The way to handle such occourrences was in an ad-hoc basis.

This patch prepends “N_” to the beginning of every SPDX licence starting
with a digit, future-proofing the script.

* Regenerate licence files

Useless since we are going to have to do it again before a release,
needed to make CI green (“Check that diff is clean”).
Patches the component build ways for foreign library components.
`validate-old-ghcs` doesn't work on 24.04, which GHA just updated
to; and it uses build artifacts from the earlier steps, so for now
the whole thing needs to be downgraded to get thinsg working. We
must address this properly later.
It's being skipped, not failing to fire, implying the wrong ref?
This subsumes haskell#10415.
by collecting them and adding hlint. Other checks will follow, e.g.
API checking once that lands.
It doesn't do what we really want, nor really does anything else
that isn't an unwieldy-at-best stack of conditions.
It didn't do what was intended, and apparently Mergify is now
tripping over its own feet about it.

This reverts commit d9c2b40.
since Mergify can't do it or we wouldn't need the label
This lets you add custom arguments to `Tasty` test suites. This can be
used to set `--keep-tmp-files` for debugging, or to run a particular
test in `cabal-testsuite`:

    ./validate.sh -v -s build -s cli-suite \
        --tasty-arg PackageTests/HaddockKeepTmpsCustom/cabal.test.hs
By request in Matrix. If anyone else has an opinion, speak now or
forever hold your peace! ☺

The new label is
`Backport #NNN: title`
which with GitHub's prefix and suffix for email is
`[haskell/cabal] Backport #NNN: title (PR #MMM)`
The `Cmd*,hs` naming scheme is usually reserved for v2 commands and
this is a v1 command so renaming this to make way for a v2 version
of this command.

Since the `v2-outdated` command does everything the `v1` version of
the command does, this `Outdated.hs` module should probably be
removed.
@erikd erikd force-pushed the erikd/v2-outdated branch from a1ac243 to a41517e Compare January 9, 2025 06:06
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.