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

Haskell provider #87

Merged
merged 12 commits into from
May 11, 2022
Merged

Haskell provider #87

merged 12 commits into from
May 11, 2022

Conversation

aleksrutins
Copy link
Contributor

Fixes #81

src/lib.rs Outdated Show resolved Hide resolved
src/nixpacks/mod.rs Show resolved Hide resolved
src/providers/haskell.rs Show resolved Hide resolved
_app: &crate::nixpacks::app::App,
_env: &crate::nixpacks::environment::Environment,
) -> anyhow::Result<Option<crate::nixpacks::phase::InstallPhase>> {
Ok(Some(InstallPhase::new("sudo apt-get update && sudo apt-get install -y libgmp-dev gcc binutils make && stack setup".to_string())))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these packages be installed with Nix instead? gcc and make should be able to. What are libgmp-dev and binutils for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nix doesn’t package any development libraries/headers. libgmp-dev is a floating-point math library needed by the Haskell compiler. binutils has things like ar that are needed to build libraries. make could probably be installed through Nix, but gcc needs to be installed using the same package manager as any libraries you’re trying to use, so that it can find them. Since apt is the only way to get development libraries, gcc needs to be installed through it too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see. I thinkkk this is okay. I'm hesitant to start having providers download external dependencies outside of Nix since we lose the ability to pin to a specific version of the Nix store. I think this is fine for now but we should be cautious about encouraging this moving forward.

If more than one provider can be matched at a time (future plans) then it would be nicer if the Haskell provider could depend on the AptProvider and specify the packages that way. Then at least the behaviour is consistent and more controller than just installing w/e packages in the install phase.

src/providers/haskell.rs Outdated Show resolved Hide resolved
@coffee-cup
Copy link
Contributor

Can you please fix the conflicts. I can merge once complete

@aleksrutins
Copy link
Contributor Author

Oh gosh, rebasing broke everything again, didn't it...

@coffee-cup coffee-cup merged commit 599d121 into railwayapp:main May 11, 2022
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.

Haskell provider
3 participants