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

Include package version in --promised-dependency flag #10248

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

mpickering
Copy link
Collaborator

@mpickering mpickering commented Aug 5, 2024

In the original implementation of promised dependencies I accidentally left over the hard coded currentCabalId in the configureDependencies function.

This led to several errors happening later when the package name and version would be incorrect if you looked at this field (package arguments are not computed using it), it is used when generating cabal macros and something in the haddock options.

The solution is to pass the package version in the --promised-depenency flag so the format is now

NAME-VER[:COMPONENT_NAME]=CID`

rather than

NAME[:COMPONENT_NAME]=CID

Fixes #10166

Please read Github PR Conventions and then fill in one of these two templates.


Template Α: This PR modifies behaviour or interface

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!)

| Just cid <- Map.lookup (dep_pkgname, CLibName lib) promisedIndex =
return $ PromisedDependency (PromisedComponent dep_pkgname (AnnotatedId currentCabalId (CLibName lib) cid))
| Just pc <- Map.lookup (dep_pkgname, CLibName lib) promisedIndex =
return $ PromisedDependency (ConfiguredPromisedComponent dep_pkgname (AnnotatedId (promisedComponentPackage pc) (CLibName lib) (promisedComponentId pc)))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the main relevant change, removing currentCabalId.

@mpickering mpickering force-pushed the wip/t10166 branch 2 times, most recently from 8fc8b9b to 05b1fa9 Compare August 14, 2024 08:21
Cabal/src/Distribution/Simple/Setup/Config.hs Outdated Show resolved Hide resolved
@mpickering mpickering force-pushed the wip/t10166 branch 3 times, most recently from 654dd18 to a64244e Compare August 27, 2024 16:39
@mpickering mpickering added the merge me Tell Mergify Bot to merge label Aug 28, 2024
@mpickering
Copy link
Collaborator Author

Can I merge this without a delay? I want to get this and #10256 landed before I go on holiday next week but they both update the structured hashes so it will be a minimum of 5ish days to land both.

@Mikolaj Mikolaj added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Aug 28, 2024
In the original implementation of promised dependencies I accidentally
left over the hard coded `currentCabalId` in the `configureDependencies`
function.

This led to several errors happening later when the package name and
version would be incorrect if you looked at this field (package
arguments are not computed using it), it is used when generating cabal
macros and something in the haddock options.

The solution is to pass the package version in the
`--promised-depenency` flag so the format is now

```
NAME-VER[:COMPONENT_NAME]=CID`
```

rather than

```
NAME[:COMPONENT_NAME]=CID
```

Fixes haskell#10166
@mergify mergify bot added the ready and waiting Mergify is waiting out the cooldown period label Aug 28, 2024
@mergify mergify bot merged commit 1e93e57 into haskell:master Aug 28, 2024
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cabal-4569 happens when running cabal repl --enable-multi-repl all
4 participants