-
Notifications
You must be signed in to change notification settings - Fork 712
glob expand extra-src-files when tracking for rebuild #7608
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,10 @@ | ||
synopsis: Glob expand extra-source-files when tracking for rebuild | ||
packages: cabal-install | ||
prs: #7608 | ||
issues: #4746 | ||
|
||
description: { | ||
|
||
- Since 3.4, extra-source-files have been tracked by cabal-install in the rebuild-checking logic. However, this tracking did not, until this PR, take into account glob-expansion. | ||
|
||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure we don't want to die with an error message? Is there any risk of false positives that would justify that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this setting where we're just tracking setting stuff, dying seems weird.
The only other place this gets glob expanded is in the sdist step, where dying makes sense, because you're sdisting something with missing files. But here we're just checking if we need to trigger a reconfigure...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, if the user thinks the compiler rebuilds his stuff, but in fact it's not, because the glob is incorrect, we should die ASAP, right? Unless false positives are possible. E.g., the user writes too general globs predicting some files/directories that are not all there yet [edit: and so it dies, even though it won't once the files are in]. Is that or any other false positive possible and likely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only error would be if the glob matches nothing. I'm extremely chary of having any sort of death or error reporting on a purely administrative step. I don't think there's anywhere else inside the
Rebuild
monad that we die, so it seems like it would be a significant change from how things now occur. A user will notice if a rebuild happens or not. The behavior no rebuild happening is not substantially different than if they put nothing at all in their extra-src-files, or put in something that matches but doesn't match everything they intended, etc.That it so say, we're not in a good position here to catch if this is correct. The only way to catch if it is correct is to see if the tarball generated by sdist actually builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about sdist tarball building. Let it be so.
Regarding possible errors, I thought it can fail in a variety of ways, both due to a syntax error in the glob and due to misssing directories, etc., as in https://github.com/haskell/cabal/blob/master/Cabal/src/Distribution/Simple/Glob.hs#L243-L250
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the clarification on possible errors, I'm not particularly familiar with the glob code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second thought, I hope syntax errors in globs are caught already when .cabal file is parsed (it definitely is at
cabal check
, but that would not be enough). So, no point preparing to handle these errors again.