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

Replace Hazel by stack_snapshot #2743

Merged
merged 7 commits into from
Nov 22, 2019
Merged

Replace Hazel by stack_snapshot #2743

merged 7 commits into from
Nov 22, 2019

Conversation

aherrmann-da
Copy link
Contributor

@aherrmann-da aherrmann-da commented Sep 4, 2019

  • Replace the now deprecated Hazel by rules_haskell's stack_snapshot which uses the stack to fetch Hackage dependencies and the Cabal library to build them.
  • Similar to how JVM dependencies are defined in bazel-java-deps.bzl, Haskell dependencies are now defined in bazel-haskell-deps.bzl.
  • Avoid Bazel name mangling and generate libz.so and libbz2.so for external library dependencies. Cabal requires library dependencies to match the expected name.
  • Update rules_haskell for stack_snapshot support.
  • Add patches for additional requred stack_snapshot features. These patches can be removed once the required features have landed upstream.
  • Most hackage dependencies are defined in a custom stack snapshot in stack-snapshot.yaml.
  • Where patches or custom builds are required, "vendored packages" are defined in the bazel-haskell-deps file. E.g. ghcide.
  • Binaries are not generated by stack_snapshot, so these are defined in bazel-haskell-deps.bzl. Their library dependencies are supplied using the stack_snapshot.
  • Updates the documentation from Hazel to stack_snapshot.
  • Removes Hazel code.

Easiest reviewed commit by commit.

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Add a line to the release notes, if appropriate
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@aherrmann-da aherrmann-da force-pushed the stackage_snapshot branch 7 times, most recently from 9074281 to 734a83a Compare September 10, 2019 15:49
@aherrmann-da
Copy link
Contributor Author

/AzurePipelines run

@azure-pipelines
Copy link
Contributor

Pull request contains merge conflicts.

@aherrmann-da aherrmann-da force-pushed the stackage_snapshot branch 10 times, most recently from 30b2071 to 11e735f Compare September 16, 2019 09:44
@aherrmann-da
Copy link
Contributor Author

Windows CI fails with

HttpExceptionRequest Request {
  host                 = "digitalassetsdk.bintray.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","Haskell pantry package")]
  path                 = "/ghc-lib/ghc-lib-parser-8.8.1.20190912.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Protocol ("certificate rejected: [SelfSigned]",True,CertificateUnknown))))

Windows CI on this PR used to not have this certificate issue, e.g. this run reached the stage of building @stackage packages, meaning that fetching ghc-lib(-parser) did succeed.

Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Awesome work, thank you so much for doing this!

I’m a bit unclear on why we need to have custom build definitions for some packages that are on Hackage but not Stackage, e.g., hpp and it would be nice to mark patches that cannot be upstreamed with a comment (it looks like all of them can be upstreamed but I might have missed something).

WORKSPACE Outdated Show resolved Hide resolved
bazel_tools/haskell-cabal-collisions.patch Outdated Show resolved Hide resolved
bazel_tools/haskell-cabal-cc-wrapper.patch Outdated Show resolved Hide resolved
bazel_tools/haskell-stack-snapshot-deps.patch Outdated Show resolved Hide resolved
@aherrmann-da aherrmann-da force-pushed the stackage_snapshot branch 3 times, most recently from a3cf2a2 to 96442c2 Compare October 11, 2019 09:27
@aherrmann-da aherrmann-da force-pushed the stackage_snapshot branch 5 times, most recently from c1bea57 to d47a943 Compare November 21, 2019 15:39
@aherrmann-da aherrmann-da force-pushed the stackage_snapshot branch 3 times, most recently from 304c3ed to 1d75fcd Compare November 21, 2019 16:58
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Awesome, thank you so much for being so incredibly persistent with this!

@aherrmann-da
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@mergify mergify bot merged commit f4d0eb6 into master Nov 22, 2019
@mergify mergify bot deleted the stackage_snapshot branch November 22, 2019 14:24
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.

3 participants