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

[ignore] #10088

Conversation

frasertweedale
Copy link
Contributor


Template Α: This PR modifies cabal behaviour

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • Manual QA notes have been included.
  • Tests have been added. (Ask for help if you don’t know how to write them! Ask for an exemption if tests are too complex for too little coverage!)

Template Β: This PR does not modify cabal behaviour (documentation, tests, refactoring, etc.)

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

alt-romes and others added 30 commits March 4, 2024 10:30
We must consider the path to the installed build-tool before the path to
existing versions of the build tool in paths such as `extra-prog-path`
or in the system path.

This was previously fixed by haskell#8972 but undone by haskell#9527.

This also renames `appendProgramSearchPath` to
`prependProgramSearchPath` to describe correctly what that function
does.

Fixes haskell#9756

(cherry picked from commit 84c30c2)
Find build-tool installed programs before programs in path (backport haskell#9762)
`extra-doc-files` and `no-autogen-paths` warnings.

(cherry picked from commit 28daab1)
- generated with
     git log --pretty=oneline --no-color cabal-install-v3.10.1.0..HEAD > 3.12.prlog
- deduped
- stored WIP “release notes” file for future `cabal-install` release
* Add tests for haskell#9742

`main-is` not picked up when inside a multibranch CondNode.

* Fix comments

* Add simplifyBranch to Distribution.Types.CondTree

Goes hand in hand with with simplifyCondTree.

* Make `check` deal correctly with multiple branches

`cabal check` had a problem recognising fields in presence of
multiple branches. This patch fixes the problem and does not
meaningfully increases CI time of particularly taxing tests
(like “duplicate flagged dependencies” from MemoryUsage).

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 74b1f21)
Make `check` recognise `main-is` in conditional branches (backport haskell#9768)
* Bump version numbers for 3.12.0.0

Version fields, constraints, licences, and bootstrap.

☞ N.B.:
- This commit removes 8.10.7 from bootstrap list.
- This release only deals with Cabal, not cabal-install.

* Update index state in cabal.project.release

This is needed since we need the new (0.6.2.5) release of
hackage-security.

* Regenerate bootstrap .json files
This provides temporary life support to the `validate-old-ghcs` action
until node16 will be finally axed by GHA in May 2024.

Workaround for:
- haskell#9858

(cherry picked from commit 2da8b2f)
Bump time upper bound to acccomodate 1.14 (backport haskell#9848)
`cabal init` text for BSD-2-Clause and BSD-3-Clause licence differed
slightly from the one published at SPDX. [1] [2]

This caused some problems to users when dealing with licence-recognition
software. [3]

[1] https://spdx.org/licenses/BSD-2-Clause.html
[2] https://spdx.org/licenses/BSD-3-Clause.html
[3] https://discourse.haskell.org/t/non-standard-license-generated-by-stack-new/9059

(cherry picked from commit 1e86730)
Conform BSD-2-Clause and BSD-3-Clause text to SPDX (backport haskell#9813)
Extra-packages listed in a cabal project are to be fetched from hackage,
and will be in memory as 'NamedPackages' rather than resolved to
'SpecificSourcePackage'.

On install, we need to make source-dists for all the specific source
packages, and fetch other packages from hackage. Since extra-packages
are already 'NamedPackages', we simply return them along the sdistize-d
specific source packages and the hackage source packages -- they will be
correctly fetched from Hackage from install.

Previously, cabal install <tgt> on a project with extra-packages would
fail because the branch of 'NamedPackage' for 'PackageSpecifier' was
simply unimplemented.

Fixes haskell#8848

(cherry picked from commit c671f0e)
With this change to the solver message rendering, I also fix some bugs around project imports, adding tests for those cases. Reviewers asked that the Y-shaped import checks (using IORef) be made on a separate pull request. Removing those lead to cascading deletions.

- Regenerate expected .out files
- Show tree provenance of import constraint
- Add trimmed down PackageTests/VersionPriority
- Add changelog entry
- Use NonEmpty
- Fix check for cyclical import
- Use primes for next iteration
- Remove unused LANGUAGE pragmas
- Rename to projectConfigPathRoot
- Docs for ProjectConfigPath and showProjectConfigPath
- Renaming
- Add cyclical import tests with 1 and 2 hops in cycle
- Use full path for cyclical error message
- Expected output has project with full project path
- Add fullPath local function
- Project directory as FilePath, not Maybe FilePath
- Use (_, projectFileName) binding splitFileName
- Need full path to project parsing legacy
- Inline seenImports conversion
- Add cyclical checks with same file names and hops
- Add noncyclical tests that hop over folders
- Add a project testing skipping in and out of a folder
- Update expectations of cyclical tests
- Use canonicalizePath for collapsing .. when possible
- Capture trace for later
- Add module for ProjectConfigPath
- Move functions for ProjectConfigPath to its module
- Fetch URI is not prefixed with ./https://etc
- Document normaliseConfigPath
- Add doctests for normaliseConfigPath
- Add doctest of canonicalizeConfigPath
- Show an example of canonical paths
- Use importer and importee in canonicalizeConfigPaths
- Add logging
Fix `<more complex packages>` link lost in doc/cabal-package-description-file.rs (backport haskell#9765)
(cherry picked from commit 23a6840)
Fix cabal install in the presence of extra-packages (backport haskell#9719)
Update setupMinCabalVersionConstraint for GHC 9.10 (backport haskell#9882)
* Redesign 'cabal path' command to account for projects

Previously, `cabal path` was only able to query from the global
configuration file, e.g., `~/.cabal/config` or the XDG equivalent.
Adding support for cabal project is a huge boost to usability.

We take the foundations and turn them into `cabal v2-path` which takes
project configuration, such as `cabal.project` into account.
Note, the command is still named `cabal path`, but for the sake of
disambiguation, we refer to this new iteration of the command as `cabal
v2-path`.

In addition, we add support for multiple output formats, such as
key-value pairs and json.

The key-value pair output prints a line for each queried key and its
respective value:

    key1: value2
    key2: value2

If only a single key is queried, we print only the
value, for example:

    value1

The json output format is versioned by the cabal-install version which
is part of the json object.
Thus, all result objects contain at least the key "cabal-install-version".

We expand the `cabal v2-path` to also produce information of the
compiler that is going to be used in a `cabal build` or `cabal repl` invocation.
To do that, we rebuild the install plan and query for the configured
compiler program.
This is helpful for downstream tools, such as HLS, to figure out the GHC
version required to compile a project with.

We also add an exhaustive test suite for 'cabal path' cmd

We test that each query honours cabal.project files, cli parameters, and
is composable with the other query flags.

We extend the test output normalisers for ghc compiler location and
cabal-install version, as the 'cabal path' command outputs the exact ghc
and ghc-pkg location. In addition, the json output format is versioned
on the cabal-install version.

Currently, we query the cabal-install version on each test normalisation
run. This might be unnecessary expensive, and could be avoided by
introducing a 'cabalProgram' that specifies how the program version can
be found. This way, we can cache the version query.

Add '--cache-home' flag thats shows the cabal's cache root

Rename '--cache-dir' to the more correct '--remote-repo-dir'.

* Update 'cabal path' documentation

* Add changelog.d entry

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 4a8a7c5)
mergify bot and others added 24 commits May 22, 2024 00:37
…l#10028)

* Recommend using latest cabal-install

- Shorten the suggestion to use cabal.release.project
- Move up cabal.release.project for initial build
- Put the --project-file option after as suggested by the command help
- Usage: cabal build [TARGETS] [FLAGS]
- Use the latest markup for note
- $ prefix for command line

(cherry picked from commit de89ffe)

# Conflicts:
#	CONTRIBUTING.md

* !fixup resolve conflict

---------

Co-authored-by: Phil de Joux <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…ckport haskell#9845) (haskell#10041)

* Fix haskell#9815: switch quick-jobs CI to XDG

Fix haskell#9815:
- Cache `~/.local/state/cabal` instead of `~/.cabal/store`
- `~/.local/bin` is used instead of `~/.cabal/bin` and is already in the PATH
  (verify this by calling `alex` after installing it)

As I am passing by:
- bump cache action to v4
- double-quote `$USER` to keep actionlint happy
- move `if` from shell-level to job-level
- allow newest `alex`

(cherry picked from commit e916cb5)

* CI quick-jobs: use preinstalled GHC and Cabal

(cherry picked from commit c209a82)

* Makefile: remove dead target 'lexer', use '.PHONY' systematically

The `lexer` target was removed in
haskell#8980

(cherry picked from commit e600087)

* CI "Meta checks": correct cache key

(cherry picked from commit 56426e4)

* CI "Meta checks": print Haskell versions

(cherry picked from commit 9a311bd)

* CI "Doctest Cabal": daily refresh of cache

(cherry picked from commit ba6f6ff)

* CI "Check Field Syntax Reference": correct cache key

(cherry picked from commit 5949e3f)

* Update generated Cabal/src/Distribution/Simple/Build/Macros/Z.hs

Not sure why this was not up to date on master and still CI passed.
Maybe the content of this file is dependent on the GHC version we are
using to build the `get-cabal-macros` tool?

(cherry picked from commit 947860a)

* CI quick-jobs: entirely wipe ghcup directory rights workaround

(cherry picked from commit 5aa8afd)

* !fixup

---------

Co-authored-by: Andreas Abel <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
…askell#10040)

* Rename projects to cabal.*.project

- Rename cabal.bootstrap.project
- Rename cabal.meta.project
- Rename cabal.validate-libonly.project
- Rename cabal.validate.project
- Rename cabal.release.project

(cherry picked from commit d8147f6)

# Conflicts:
#	.github/workflows/quick-jobs.yml
#	Makefile
#	cabal.bootstrap.project

* Fix conflict with haskell#9990

---------

Co-authored-by: Phil de Joux <[email protected]>
Co-authored-by: brandon s allbery kf8nh <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
RejectFutureIndexStates and UpdateIndexState are marked "skip", but it's
under withRemoteRepo, which causes flakiness before skip is called.
…3.12

[3.12] PackageTests/NewUpdate: fix skipping flaky tests
…#9505) (haskell#10059)

* testsuite: Refactor withShorterPathForNewBuildStore

This makes `withShorterPathForNewBuildStore` fit more nicely into the
rest of the testing infrastructure.

* Move `withShorterPathForNewBuildStore` to `TestM` monad
* Move responsibility for passing `--store-dir` to `cabalGArgs` function
* Move `findDependencyInStore` into `TestM`, and remove requirement to
  pass path to store directory.
* Introduce `testStoreDir` function which returns the store location
  (and honours `withShorterPathForNewBuildStore`)
* Migrate tests which use `withShorterPathForNewBuildStore`.

(cherry picked from commit 2a2d0b3)

# Conflicts:
#	Cabal-tests/Cabal-tests.cabal
#	Cabal-tests/lib/Test/Utils/TempTestDir.hs

* !fixup resolve conflicts

* fixup! always import `(</>)`

---------

Co-authored-by: Matthew Pickering <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
Co-authored-by: brandon s allbery kf8nh <[email protected]>
(cherry picked from commit 225d2b1)

Co-authored-by: Pierre Le Marre <[email protected]>
) (haskell#10067)

* More consistently pass --package-db flag to tests

Previously `--package-db` was only passed to test which used the `v2-`
prefix.

Now we pass `--package-db` to things which use the `v2-` prefix, not
things which use the `v1-` prefix and by default assume that unprefixed
commands are v2 commands.

(cherry picked from commit 2b44677)

# Conflicts:
#	cabal-testsuite/PackageTests/CustomTestCoverage/cabal.out

* fixup! resolve conflicts

---------

Co-authored-by: Matthew Pickering <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
* CI: add GHC 9.10

* GHC 9.10 compat in testsuite: CPP symbols don't get passed to CC as
eagearly

Discussion: haskell#9914 (comment)

Related GHC issue: https://gitlab.haskell.org/ghc/ghc/-/issues/21291

* GHC 9.10 compat in tests: disable tests regressing due to haskell#9940

(cherry picked from commit 3a8c69c)

Co-authored-by: Artem Pelenitsyn <[email protected]>
…#10073)

Also uses 'stanza' consistently in that context.

(cherry picked from commit 2e8d728)

Co-authored-by: Mike Pilgrem <[email protected]>
* Regenerate HLint counts with hlint-3.5

(cherry picked from commit 1cdb4b9)

* Bump to hlint-3.8 and regenerate counts

(cherry picked from commit 46391f7)

* fix hlint warning

---------

Co-authored-by: Phil de Joux <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
closes haskell#7986

(cherry picked from commit 0f1e17d)

Co-authored-by: Zoe Zuser <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…l#10053)

* CI: install changelog-d from bindist (haskell#10048)

This will avoid build problems when the GHC in the CI environment
is updated sooner than expected.
Previous breakage: haskell#9177 (comment)

(cherry picked from commit d1a6ced)

# Conflicts:
#	.github/workflows/changelogs.yml

* !fixup resolve conflicts

---------

Co-authored-by: Francesco Gazzetta <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…0056) (haskell#10079)

* Fix --program-{prefix,suffix} resulting in invalid installation

Currently the options `--program-{prefix,suffix}` for cabal install
affects the name of the file in the install directory *and* the
executable name in the store. The installation fails:

- If using `--install-method=symlink`, the *target* of the symlink is
  not affected by the affix options and it results in an invalid symlink.
- If using `--install-method=copy`, the copy fails because the source
  is not found.

Another issue is that it affects the computation of the hash of the
build directory in the store, resulting in needless rebuild when using
successively different affix options.

Fixed by making the name of the executable in the store canonical, i.e.
always ignoring the program affix options.

Added a test for all the combinations of `--install-method` and program
affixes options.

(cherry picked from commit 8593474)

# Conflicts:
#	cabal-install/src/Distribution/Client/CmdInstall.hs

* fixup! resolve conflicts

---------

Co-authored-by: Pierre Le Marre <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…#9926) (haskell#10076)

* Downgrade NoLibraryFound from an error to a warning

This makes Setup copy/install succeed if there's
nothing to do because the package doesn't contain
a library or executable.

This allows downstream users of Cabal to avoid having to
add workarounds for this edge case.

Resolves haskell#6750

(cherry picked from commit 312a412)

# Conflicts:
#	Cabal/src/Distribution/Simple/Install.hs

* fixup! fix conflicts

---------

Co-authored-by: Teo Camarasu <[email protected]>
Co-authored-by: Artem Pelenitsyn <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…eld (haskell#10078)

(cherry picked from commit dc9a7a0)

Co-authored-by: Mike Pilgrem <[email protected]>
Disallowing whitespace while parsing target selectors incorrectly
disallows file targets with whitespace in the paths, which can issues
when users pass absolute paths.

fixes haskell#8875

(cherry picked from commit 564b4fe)

Co-authored-by: Zoe Zuser <[email protected]>
- Use real-life example from Cabal project in doctest

(cherry picked from commit 325ff22)

Co-authored-by: Phil de Joux <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add extra ghc options to multi-repl file

These options are configured into the program by Cabal, so we also need
to extract these and put them into the mutli-file.

Fixes haskell#10015

(cherry picked from commit 539cb7b)

* Fix rendering of `-j` option in multi-repl

Before this was rendered as..

```
/run/current-system/sw/bin/ghc --interactive -package-env - -j 'NumJobs (Just 8)' ...
```

Due to this place not being updated when support for semaphores was
added.

(cherry picked from commit c3708d2)

---------

Co-authored-by: Matthew Pickering <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Extract a bunch of string equality checks for the URI scheme to
top-level functions.
"They're the same picture".  Thus, refactor the *transport supports
https* checks.
Allow the curl transport to use Basic authentication, if and only if
the url scheme is HTTPS (i.e. TLS will be used).  Retain the
existing behaviour (force Digest scheme) for insecure requests.

This change is required to support upcoming hackage-server changes.
The wget transport already supports Basic authentication.
@frasertweedale
Copy link
Contributor Author

Targeted wrong branch. Closing. Sorry for the noise.

Copy link
Contributor

mergify bot commented Jun 9, 2024

⚠️ The sha of the head commit of this PR conflicts with #10089. Mergify cannot evaluate rules on this PR. ⚠️

@frasertweedale frasertweedale changed the title Please read [Github PR Conventions](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#github-pull-request-conventions) and then fill in *one* of these two templates. [ignore] Jun 9, 2024
Copy link
Contributor

mergify bot commented Jun 9, 2024

⚠️ The sha of the head commit of this PR conflicts with #10089. Mergify cannot evaluate rules on this PR. ⚠️

1 similar comment
Copy link
Contributor

mergify bot commented Jun 11, 2024

⚠️ The sha of the head commit of this PR conflicts with #10089. Mergify cannot evaluate rules on this PR. ⚠️

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.