Skip to content

[new-build] Use canonical path to compiler in config hash #5159

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

Open
edsko opened this issue Feb 22, 2018 · 5 comments
Open

[new-build] Use canonical path to compiler in config hash #5159

edsko opened this issue Feb 22, 2018 · 5 comments

Comments

@edsko
Copy link
Contributor

edsko commented Feb 22, 2018

Changing the path to ghc from /opt/ghc/8.0.2/bin/ghc to /opt/ghc/8.0.2//bin/ghc causes cabal to consider the compiler to have changed, leading to a lot of unnecessary recompilation.

@hvr
Copy link
Member

hvr commented Feb 22, 2018

which normalisation recipe do you recommend?

@edsko
Copy link
Contributor Author

edsko commented Feb 23, 2018

I don't have one in mind :) But it should have the property that if P and Q point to the same file they should result in the same hash? Perhaps better yet, don't include the hash of the path but instead the hash of the binary? (May be too expensive I suppose.)

@hvr
Copy link
Member

hvr commented Feb 23, 2018

@edsko the problem with the hash of the binary is that you'd be hashing the wrapper shell script ghc :-)

One could as a heuristic also use the inode number of the file object ghc points to.

@edsko
Copy link
Contributor Author

edsko commented Feb 23, 2018

Perfect, ought to be much cheaper to compute then 😁

@hvr
Copy link
Member

hvr commented Feb 23, 2018

Btw, there is a dual ticket to this one (to un-differentiate ghcs which seem different but are the same), #5116 for the opposite need (i.e. to better differentiate ghcs which seem to be the same but aren't)

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

3 participants