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

Comments

Projects
None yet
4 participants
@mgsloan
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

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

@snoyberg

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

Yes, thank you very much!

@mauriciofierrom mauriciofierrom referenced this issue Apr 14, 2019

Merged

GHC Hide Source Paths #4736

2 of 2 tasks complete
@snoyberg

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

Implemented in #4736, thanks @mauriciofierrom!

@snoyberg snoyberg closed this Apr 15, 2019

@mauriciofierrom

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

Thanks for the great pointers @snoyberg 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.