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

Pass command line arguments to hsc2hs using response files #5553

Merged
merged 1 commit into from
Aug 30, 2018
Merged

Pass command line arguments to hsc2hs using response files #5553

merged 1 commit into from
Aug 30, 2018

Conversation

ckoparkar
Copy link
Contributor

@ckoparkar ckoparkar commented Aug 29, 2018


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Fixes #3122. Also see Trac #13896.

hsc2hs has gained the ability to accept command line arguments via response files, which helps
to work around the limit on their length on Windows. This is the next step which updates Cabal to use a response file when invoking hsc2hs. Unfortunately, I have not yet tried to build the projects (this gist and ermine) mentioned in the issue. I will do it as soon as I get access to a Windows machine (or once I setup Vagrant or something). Note that this patch only changes the invocation logic for hsc2hs >= 0.68.4 which will be released with GHC 8.6.

re:testing -- I tested this by hand and ensured that the arguments are indeed passed via a response file, and hsc2hs can successfully process a Foo.hsc file. Also,

$ cabal-tests cabal-testsuite/PackageTests/PreProcess/setup.test.hs

tests the hsc2hs pre-processor and doesn't fail. I'm not sure if I should add another test.

/cc @bgamari @RyanGlScott @hvr

@@ -94,6 +94,8 @@
* Foreign libraries are now linked against the threaded RTS when the
'ghc-options: -threaded' flag is used
([#5431](https://github.com/haskell/cabal/pull/5431)).
* Pass command line arguments to `hsc2hs` using response files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...when possible/supported... :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right. Fixed it :)

@hvr hvr added this to the 2.4 milestone Aug 29, 2018
@23Skidoo 23Skidoo merged commit f83aa4a into haskell:master Aug 30, 2018
@23Skidoo
Copy link
Member

Merged, thanks!

23Skidoo added a commit that referenced this pull request Aug 30, 2018
Pass command line arguments to hsc2hs using response files

(cherry picked from commit f83aa4a)
@23Skidoo
Copy link
Member

Also cherry-picked into 2.4.

@ckoparkar
Copy link
Contributor Author

Great. Thank you :)

@hvr
Copy link
Member

hvr commented Oct 18, 2018

note, this turns out to be incorrect as the version doesn't uniquely determine whether hsc2hs was built w/ support for response files; fix(es) underway

@23Skidoo
Copy link
Member

Relevant GHC ticket: https://ghc.haskell.org/trac/ghc/ticket/15758

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants