-
Notifications
You must be signed in to change notification settings - Fork 691
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
Add support for cabal.project fields to scripts #7997
Conversation
9631cb3
to
6fffde7
Compare
cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.test.hs
Show resolved
Hide resolved
@@ -15,5 +15,7 @@ description: { | |||
- The name of the generated script executable has been changed from "script" to | |||
"cabal-script-<your-sanitized-script-name>" for easier process management. | |||
- Reduce the default verbosity of scripts, so that the build output doesn't interfere with the script output. | |||
- Scripts now support a project metadata block that allows them to use options | |||
that would normally be set in a cabal.project file. |
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.
this just reads it and does not attempt to validate that the fields set are relevant to scripts. I think this is probably fine, but I'm open to discussing it.
a note in docs about that would be enough imo
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.
And an issue about adding such validation would be great too
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.
I added an issue: #8024
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.
Many thanks, a really good recap, maybe it worths to link the issue in the doc note (as list all the problematic fields would be too verbose)
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.
great work as usual, many thanks
eager to see the amazing new script support released
-} | ||
|
||
main :: IO () | ||
main = do | ||
... | ||
|
||
Where there cabal metadata block is mandatory and contains fields from a |
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.
This interjects the sentences "With a script that looks like: ... It can either be executed like any other script..." and the context is lost before we get to "It can either". Perhaps change the initial sentence to "A script may looks like this:", then your interjection, then "The script can either be executed like any other script...".
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.
👌
Closes #5698
Currently, as with the executable block, this just reads it and does not attempt to validate that the fields set are relevant to scripts. I think this is probably fine, but I'm open to discussing it.