Conversation
sol
left a comment
There was a problem hiding this comment.
Hey, thanks for looking into this.
Personally I am not convinced that extra-files offers enough value over extra-source-files and extra-doc-files to be worthwhile.
That said, this is a minimal change, so in this specific case I am willing to accept this patch for parity with Cabal.
Note that parity with Cabal is not a stated design principle of Hpack, so this will always be a case by case decision.
README.md
Outdated
| | `build-type` | · | `Simple`, or `Custom` if `custom-setup` exists | Must be `Simple`, `Configure`, `Make`, or `Custom` | | | | ||
| | `extra-source-files` | · | | Accepts [glob patterns](#file-globbing) | | | | ||
| | `extra-doc-files` | · | | Accepts [glob patterns](#file-globbing) | | `0.21.2` | | ||
| | `extra-files` | · | | Accepts [glob patterns](#file-globbing) | | `0.39.0` | |
There was a problem hiding this comment.
As this is a very non-invasive change, do you think we should release as 0.38.1?
NB: Adding a new field to Hpack.Config.Package I don't consider a "breaking" change:
Hpack.Configis semi-internal- A user should use
Hpack.Config.packageto construct aPackageanyway, and if they did that, their code will continue to work just fine. - In general, for records with a large number of fields, I as a user should always be prepared that new fields are added.
There was a problem hiding this comment.
Please also bump the package version accordingly, so that a release to Hackage is triggered
|
@mpilgrem I updated the issue description, can you please update the commit message accordingly? |
|
This is 'early', in that only GHC >= 9.12 requires Cabal >= 3.14 and we are unlikely to understand user use of |
My question is more along the lines of "When does this actually matter?". I think in the worst case you just rebuild too often. Now if there is some extra file that changes all the time, then I would see a potential issue that |
sol
left a comment
There was a problem hiding this comment.
- apply my two diff suggestions
- bump version to
0.38.1 - add change log entry
Then this is ready to go 👍
| |] `shouldWarn` ["Specified pattern \"*.markdown\" for extra-doc-files does not match any files"] | ||
|
|
||
| describe "extra-files" $ do | ||
| it "accepts a list of files" $ do |
There was a problem hiding this comment.
| it "accepts a list of files" $ do | |
| it "accepts extra-files" $ do |
There was a problem hiding this comment.
We currently have:
extra-doc-files
accepts a list of files
and
extra-files
accepts extra-files
seemed a little 'circular' as an output - but if you are sure that is what you want, I'll put it through.
There was a problem hiding this comment.
The priorities are:
- It needs to be clear what the purpose of a specific test case is ("What are we testing here?").
- Consistency
- Anything else
As (1) is the main priority, I would shy away from sacrificing it for stylistic reasons.
In this specific case, we are testing that it "accepts extra-files". We are not concerned with whether it can be a list, whether it accept globs, etc. (those aspects are covered by other test cases).
seemed a little 'circular' as an output
Yes, definitely agree!
However, if you would want to address this, then I think the right approach would be to get rid of the describe "extra-files".
But then again we already have things like:
describe "spec-version" $ do
it "accepts spec-version" $ doSo keeping the describe is at least consistent with what we already have (in line with our second priority).
There was a problem hiding this comment.
Sorry, my mistake. I'll fix it now.
README.md
Outdated
| | `build-type` | · | `Simple`, or `Custom` if `custom-setup` exists | Must be `Simple`, `Configure`, `Make`, or `Custom` | | | | ||
| | `extra-source-files` | · | | Accepts [glob patterns](#file-globbing) | | | | ||
| | `extra-doc-files` | · | | Accepts [glob patterns](#file-globbing) | | `0.21.2` | | ||
| | `extra-files` | · | | Accepts [glob patterns](#file-globbing) | | `0.39.0` | |
There was a problem hiding this comment.
| | `extra-files` | · | | Accepts [glob patterns](#file-globbing) | | `0.39.0` | | |
| | `extra-files` | · | | Accepts [glob patterns](#file-globbing) | | `0.38.1` | |
There was a problem hiding this comment.
The reason I've held off on the Hpack version is that there may be other changes soon that could be released together (and extra-files on its own is not a burning platform) - I'm currently (off repository) looking at moving #518 forward.
There was a problem hiding this comment.
I say "release early, release often" and "minimize dependencies between tasks".
|
Rebuilding unnecessarily was given as the motivation for
but the fact it was not implemented for the first 20 years of Cabal suggests its need was not pressing! |
cabal-version: 3.14of the Cabal package description format specification has introduced new fieldextra-files- likeextra-source-filesbut without the semantics that the files listed are tracked by build tools.