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

Stack Build-API? #5248

Closed
LeanderK opened this issue Apr 1, 2020 · 6 comments
Closed

Stack Build-API? #5248

LeanderK opened this issue Apr 1, 2020 · 6 comments

Comments

@LeanderK
Copy link

LeanderK commented Apr 1, 2020

I am developing a GHC source-plugin that would impact the build-process, since i would need to generate different versions of functions based on the package i am developing in. I would need to traverse the dependency-graph forward (starting by main source package), parse its source-code and mark modules as needed to be recompiled with my source-plugin enabled.

Is something like this possible with stack? I think a simple way to get the dependent graph, the source-code for each dependency and mark it as dirty would suffice.

@mbj
Copy link
Contributor

mbj commented Apr 1, 2020

@LeanderK You could also use the stack command line. stack ls dependencies. This may be less work. There are various options to change the dependency output to make it easier to parse.

@mbj
Copy link
Contributor

mbj commented Apr 3, 2020

@LeanderK Also see #4424, dependencies now can rendered as JSON making processing easier.

@LeanderK
Copy link
Author

LeanderK commented Apr 5, 2020

Ah, okay. That helps, since it seems to include then URL to the source-code. Is there a way to mark a package as dirty so it gets rebuild? Rebuilding everything all the time is super expensive ---force-dirty is the only option I've found.

@mbj
Copy link
Contributor

mbj commented Apr 7, 2020

@LeanderK The only workaround I know is changing a packages ghc-config flags. This can cause a targeted rebuild. Note that if you target a dependency with many dependencies, you'll get to significant build times again as all transitive ones may get re-build also.

@mbj
Copy link
Contributor

mbj commented Apr 7, 2020

BTW I meant to overwrite like this:

# stack.yaml
ghc-options:
  your-target: -some-flag

@mpilgrem
Copy link
Member

I am closing this issue, given the passage of time.

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