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

SetupHooks: make Location a separate data type #9992

Merged
merged 1 commit into from May 18, 2024

Conversation

sheaf
Copy link
Collaborator

@sheaf sheaf commented May 9, 2024

This commit updates the Hooks API, making Location a separate data type:

data Location where
  Location
    :: SymbolicPath Pkg (Dir baseDir)
    -> RelativePath baseDir File
    -> Location

instead of being a type synonym for (FilePath, FilePath).

We noted during testing of the Hooks API that it was all too easy to give an incorrect location for rule outputs, e.g. by omitting an extension or using an absolute path.
This change allows us to improve the API documentation, as well as clarifying the types to avoid any ambiguities about what kind of file path is expected (FilePath vs SymbolicPath).


Template Α: This PR modifies behaviour or interface.

  • Patch conforms to the coding conventions.
  • Changes noted in the changelog: this change will be part of the first Hooks API, so no changelog entry is needed.
  • The documentation has been updated.
  • The Hooks tests have been updated in consequence.

@ffaf1
Copy link
Collaborator

ffaf1 commented May 9, 2024

I have a question which is not strictly related to the pr

[x] Changes noted in the changelog: this change will be part of the first Hooks API, so no changelog entry is needed.

Is there a development branch where I can see the changelog files? Are the changelog files being written somewhere public? Are they already in master?

@sheaf
Copy link
Collaborator Author

sheaf commented May 9, 2024

Is there a development branch where I can see the changelog files? Are the changelog files being written somewhere public? Are they already in master?

The first version of the Cabal library with support for "build-type: Hooks" will be 3.14, and the Haddocks for the Distribution.Simple.SetupHooks module constitutes the bulk of the documentation for the API. As (I expect and intend) this PR to land before the 3.14 branch is cut, there is no changelog to speak of (the change will be part of the first released version of the API).

Does that answer your question?

@ffaf1
Copy link
Collaborator

ffaf1 commented May 9, 2024

It does, thank you.

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

Looks like a clear win to me!

@sheaf sheaf added merge me Tell Mergify Bot to merge and removed attention: needs-review labels May 14, 2024
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label May 16, 2024
@alt-romes
Copy link
Collaborator

@mergify rebase

Copy link
Contributor

mergify bot commented May 17, 2024

rebase

❌ Unable to rebase: user alt-romes is unknown.

Please make sure alt-romes has logged in Mergify dashboard.

@Mikolaj
Copy link
Member

Mikolaj commented May 17, 2024

@mergify rebase

Copy link
Contributor

mergify bot commented May 17, 2024

rebase

✅ Branch has been successfully rebased

@Mikolaj
Copy link
Member

Mikolaj commented May 17, 2024

Let me restart https://github.com/haskell/cabal/actions/runs/9125479546/job/25091745764?pr=9992. It may or may not be transient.

@Mikolaj
Copy link
Member

Mikolaj commented May 17, 2024

This does seem to be transient, but common, so let me restart until it passes.

@Mikolaj
Copy link
Member

Mikolaj commented May 17, 2024

@mergify rebase

Copy link
Contributor

mergify bot commented May 17, 2024

rebase

✅ Branch has been successfully rebased

@Mikolaj
Copy link
Member

Mikolaj commented May 17, 2024

@mergify rebase

Copy link
Contributor

mergify bot commented May 17, 2024

rebase

✅ Branch has been successfully rebased

@Mikolaj
Copy link
Member

Mikolaj commented May 17, 2024

@mergify rebase

Copy link
Contributor

mergify bot commented May 17, 2024

rebase

✅ Branch has been successfully rebased

@Mikolaj
Copy link
Member

Mikolaj commented May 18, 2024

@mergify rebase

This commit makes Location a separate data type:

  data Location where
    Location
      :: SymbolicPath Pkg (Dir baseDir)
      -> RelativePath baseDir File
      -> Location

instead of being a type synonym for (FilePath, FilePath).

We noted during testing of the Hooks API that it was all too easy to
give an incorrect location for rule outputs, e.g. by omitting an
extension or using an absolute path.
This change allows us to improve the API documentation, as well as
clarifying the types to avoid any ambiguities about what kind of file
path is expected (FilePath vs SymbolicPath).
Copy link
Contributor

mergify bot commented May 18, 2024

rebase

✅ Branch has been successfully rebased

@mergify mergify bot merged commit f9e242f into haskell:master May 18, 2024
51 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants