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

Add compilerLocation to Compiler datatype #7507

Closed

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Aug 4, 2021

Avoids compiler program lookup logic code in ShowBuildInfo.

Split off from #7498 based on the comment #7498 (comment)

@fendor
Copy link
Collaborator Author

fendor commented Aug 4, 2021

cc @DanielG

@DanielG
Copy link
Collaborator

DanielG commented Aug 4, 2021

My gut feeling is that this is a bad idea. If you insist on going this way you should replace all the use sites of lookupProgram ghcProgram and similar with this mechanism instead and see if it still makes sense.

@fendor
Copy link
Collaborator Author

fendor commented Aug 4, 2021

I do not insist, I thought it might be a smooth solution, but if it isn't, I feel free to abandon it again

@DanielG
Copy link
Collaborator

DanielG commented Aug 4, 2021

I didn't mean to imply I don't think it's worth pursuing, I just think just adding this hardly tells us if this is a good idea or not. In my mind the ProgramDB is there for a reason and I'm not sure if moving some of the info it hast elsewhere wont lead to more problems than it solves. Showing how this would replace a lot of error prone (hehe) code would certainly make a stronger case for this approach.

@fendor
Copy link
Collaborator Author

fendor commented Aug 4, 2021

I don't think a single invocation of requireProgram or lookupProgram can be saved, as other data is usually required than just the program location. E.g. to invoke a program, you still need its ConfiguredProgram.

We rarely go the way: Compiler -> ConfiguredProgram -> ProgramLocation

@fendor
Copy link
Collaborator Author

fendor commented Sep 4, 2021

This is probably not very good, so closed

@fendor fendor closed this Sep 4, 2021
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.

2 participants