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

For ghc >= 8.2, default to -fhide-source-paths #3784

Closed
mgsloan opened this issue Jan 16, 2018 · 8 comments
Closed

For ghc >= 8.2, default to -fhide-source-paths #3784

mgsloan opened this issue Jan 16, 2018 · 8 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Jan 16, 2018

See http://hsyl20.fr/home/posts/2018-01-15-ghc-hiding-source-and-object-paths.html . Makes ghc build output look much nicer.

I see no strong downside, can probably be re-enabled with -fno-hide-source-paths. So, it should come before user-provided ghc-options.

@mgsloan
Copy link
Contributor Author

mgsloan commented Jan 16, 2018

On second thought, we already doing munging on build output, perhaps the munging should be updated to default to removing paths from the build output? This way it can work for ghc < 8.2 and the build logs get stored with full paths.

@ElvishJerricco
Copy link

ElvishJerricco commented Jan 16, 2018

I'd much rather see this made the default in GHC than see Stack do some special stuff and basically reimplement it (edit: with munging, that is).

Plus, if it were default in GHC, Stack could drop its existing munging, in favor of just telling the user that if they want the verbosity of paths at all, it might as well be absolute ones.

@mgsloan
Copy link
Contributor Author

mgsloan commented Jan 16, 2018

We're already doing the munging. I agree with disabling it where possible and instead using the flag for GHC >= 8.2 . Here are the gory details of what it currently does: https://github.com/commercialhaskell/stack/blob/fix-category-ghc-options-in-config-yaml-3753/src/Stack/Build/Execute.hs#L1804

Actually, looking closely, I don't think this munging affects the filepaths of -fhide-source-paths, instead, it's for error message paths.

@mauriciofierrom
Copy link
Contributor

Hello. I would like to work on this, if that's ok.

@snoyberg
Copy link
Contributor

Sounds great @mauriciofierrom! I think you'll basically be looking at two parts to this modification:

  1. Adding a new config setting to Config and ConfigMonoid in Stack.Types.Config for whether hide-source-paths should be passed, with a default of True. There are lots of other examples of such configuration values, such as configHideTHLoading. This will also need a new entry in the doc/yaml_configuration.md docs.
  2. Applying this setting when generating the configure options. This would be in Stack.Types.Build.configureOptsNoDir (the docs there explain the funny name). The trick would be to add in --ghc-option=-fhide-source-paths if the setting in (1) is True (the default) AND the actual GHC version is 8.2 or later.

Does that give enough direction to get started?

@mauriciofierrom
Copy link
Contributor

Yes, thank you very much!

@snoyberg
Copy link
Contributor

Implemented in #4736, thanks @mauriciofierrom!

@mauriciofierrom
Copy link
Contributor

Thanks for the great pointers @snoyberg 🙂

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

4 participants