-
Notifications
You must be signed in to change notification settings - Fork 704
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 validation for valid fields in script metadata blocks #8024
Comments
Is |
I'd also like to have |
It would be great if the project meta data can support package configurations, in order to support non-hackage dependencies including local ones. (coming from #9084) |
We still have to run the build script with GHC 9.4, since we need to override `dhall`, and can't override `source-repository-package` for scripts (haskell/cabal#8562, haskell/cabal#8024 (comment)).
The problem is bigger than that: While these changes are a step in the right direction, in the short term it's been a big regression that we can no longer sensibly override dependencies. I've honestly considered publishing some of my temporary forks to Hackage because of this, and that's not behaviour we want to encourage! Is supporting |
My suspicion is that this is a matter of some flag plumbing, and not a huge conceptual obstacle. |
FWIW, passing |
I'd like to have this fixed... at munihac this weekend, anyone in this thread is around? |
if anyone is working on this at munihac, my suggestuon is to work on removing the use of fake-package instead of trying to solve this specific issue. See: #6977 |
Fwiw, I found a workaround for now, that is to specify the package-dbs list in the
I will look into cabal code in the future to fix this wart... since it is in the interest of my project to remove such a hack. |
Oof, that's horrible, and I'm probably going to use it. |
By the way, a correction, the "user" package-db trick didn't work, I had to use the "in place" one directly: I used the following snippets in my loader of the project:
I believe you could reuse these to add a wrap to your |
The
{- cabal: ... -}
and{- project: ... -}
(with #7997) blocks of a script parse of full the fullexecutable
grammar andcabal.project
grammar respectively, regardless of whether such fields make sense. Also many fields are broken because using fake-package (see #6977) means that the directory the script project file is relative to is not the same as the directory the script is actually in.Script specific validation should be added for these blocks.
Executable fields that should warn:
main-is
this will be overridden to be the scriptscope
is meaningless for a script, but I don't think it actually breaks anything if setinstall-includes:
install is not supported for scriptsExecutable fields that don't work as expected with relative paths because of fake-package:
other-modules
hs-source-dirs:
includes:
include-dirs:
c-sources:
cxx-sources:
asm-sources:
cmm-sources:
js-sources:
extra-lib-dirs:
extra-framework-dirs:
Project fields that should warn:
run-tests:
scripts can't specify testswrite-ghc-environment-files:
gets put in/is relative to wrong directory because of fake-packageProject fields that don't work as expected with relative paths because of fake-package:
packages:
optional-packages:
extra-prog-path:
extra-include-dirs:
extra-lib-dirs:
extra-framework-dirs:
remote-repo-cache:
logs-dir:
The text was updated successfully, but these errors were encountered: