Skip to content

Make libdir a mandatory parameter to 'applyRefactorings' #134

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

Merged
merged 1 commit into from
Jan 22, 2023

Conversation

fendor
Copy link
Contributor

@fendor fendor commented Jan 16, 2023

Binary distributions of programs depending on apply-refact are otherwise impossible, since the distributed package will contain a hard-coded path to a libdir to a GHC installation on the host system.

Fixes #133

Binary distributions of programs depending on apply-refact are otherwise
impossible, since the distributed package will contain a hard-coded path
to a libdir to a GHC installation on the host system.
@@ -87,7 +88,7 @@ runPipe Options {..} file = do
"Invalid extensions: " ++ intercalate ", " invalidExts
m <-
either (onError "runPipe") applyFixities
=<< parseModuleWithArgs (enabledExts, disabledExts) file
=<< parseModuleWithArgs GHC.Paths.libdir (enabledExts, disabledExts) file

Choose a reason for hiding this comment

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

Sorry, I don't understand how this fixes it. We're still using GHC.Paths.libdir here? It seems the invocation just moved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah but thats the executable. The library of apply refract doesn't use it anymore. This allows the binary of apply refact to continue to work without a major overhaul

Choose a reason for hiding this comment

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

So we're assuming no one wants to ship the apply-refact binary?

Copy link
Contributor Author

@fendor fendor Jan 17, 2023

Choose a reason for hiding this comment

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

Yeah. Doing that right now would require to migrate apply-refact to use hie-bios (or cli argument), which I am happy to do, but for HLS, this is the important bit and apply-refact can't have a binary distribution right now either.

Choose a reason for hiding this comment

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

Why not write what you just said as a comment in the code here?

Copy link
Contributor Author

@fendor fendor Jan 17, 2023

Choose a reason for hiding this comment

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

I did note something similar for end users in https://github.com/mpickering/apply-refact/pull/134/files#diff-7f889a0125943a04146509ea2a668d4a40d7839f4bbd6cd1b5a8159c482d3d12R20

I will create an issue for migrating to hie-bios, however, since HLS depends on implicit-hie, the behaviour wouldn't be uniform with hls...

@zliu41
Copy link
Collaborator

zliu41 commented Jan 22, 2023

LGTM, thanks for the fix. This is long overdue.

@zliu41 zliu41 merged commit 98e1885 into mpickering:master Jan 22, 2023
@zliu41
Copy link
Collaborator

zliu41 commented Jan 22, 2023

0.12.0.0 published on Hackage.

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.

Apply-refact shouldn't hardcode GHC.Paths.libdir in parseModuleWithArgs
4 participants