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

Support of passing flags to arbitrary programs #2868

Closed
PierreVDL opened this issue Dec 22, 2016 · 5 comments
Closed

Support of passing flags to arbitrary programs #2868

PierreVDL opened this issue Dec 22, 2016 · 5 comments

Comments

@PierreVDL
Copy link

On haskell-stack different questions are asked to add arguments to particular programs.
See e.g. https://groups.google.com/forum/#!topic/haskell-stack/6sYk9V5IuNI
and https://groups.google.com/forum/#!topic/haskell-stack/9oKeSo-nz7U

Cabal states it can accept arguments to arbitrary programs : https://www.haskell.org/cabal/users-guide/installing-packages.html#programs-used-for-building

--prog-options=options Specify additional options to the program prog. Any program known to Cabal can be used in place of prog. For example: --alex-options="--template=mytemplatedir/".

Can stack support this as well?

@decentral1se
Copy link
Member

Don't think this is supported yet.

@tiansivive
Copy link

I guess this is still an issue? I'm trying to pass some args to happy on running stack build and running into this.

It's been 5 years, I'll just assume this died in backlog hell?

@mpilgrem
Copy link
Member

mpilgrem commented Mar 30, 2023

@tiansivive, it is still an unfulfilled request. (Note to self: the modern Cabal link is https://cabal.readthedocs.io/en/stable/setup-commands.html#programs-used-for-building.) EDIT: On a quick initial review, it looks like a sensible thing to have and perhaps it is not too difficult to implement, as long as it is compatible with the oldest version of Cabal that Stack still supports.

EDIT: Cabal-3.10.1.0 has the following built-in programs:

-- compilers and related
ghc  -- Stack has --ghc-options
ghc-pkg
ghcjs -- Stack has not support GHCJS since Stack 2.3.1
ghcjs-pkg
haskell-suite
haskell-suite-pkg
hmake
hpc -- Stack has stack hpc
jhc
runghc -- Stack has stack runghc. Not present in Cabal-1.22.5.0
uhc
-- configuration tools
pkg-config
-- preprocessors
alex
c2hs
cpphs
doctest -- Not present in Cabal-1.22.5.0
greencard
haddock  -- Stack has --haddock-arguments
happy
hsc2hs
hscolour
-- platform toolchain (GNU)
ar  -- create, modify, and extract from archives
gcc -- C/C++ compiler
ld -- linker
strip -- discards symbols and other data from object files
tar -- saves many files together

@mpilgrem
Copy link
Member

mpilgrem commented Apr 3, 2023

@tiansivive, I think the version of Stack in branch fix2868 now adds what you are seeking to the command line. See #6083. I have reasoned that it works, but could you test that it actually solves your problem (or specify some minimal example that I could use to test it)?

If it does work, I'll merge it and then turn to adding something also to Stack's YAML configuration files separately.

mpilgrem added a commit that referenced this issue Apr 20, 2023
Fix #2868 Add --PROG-option to stack build
@mpilgrem mpilgrem reopened this Apr 21, 2023
@mpilgrem
Copy link
Member

Re-opening issue, as I have realised that 9ebe1fc does not address the hash that ensures builds are reproducible. I'll address that separately.

mpilgrem added a commit that referenced this issue Apr 21, 2023
The merger proved to be premature.
mpilgrem added a commit that referenced this issue Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants