Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Fix custom_package rules
Browse files Browse the repository at this point in the history
The mangled hazel_workspace name was inserted wrongly. Whenever another
package depended on a custom package it would fail due to the missing
external workspace.
  • Loading branch information
aherrmann committed Jan 9, 2019
1 parent e8a51c3 commit 38e9cef
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions hazel.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,9 @@ def hazel_custom_package_hackage(
package_id,
package_id,
)
fixed_package_name = hazel_workspace(package_name)
http_archive(
name = "haskell_{0}".format(fixed_package_name),
build_file = "//third_party/haskell:BUILD.{0}".format(fixed_package_name),
name = hazel_workspace(package_name),
build_file = "//third_party/haskell:BUILD.{0}".format(package_name),
sha256 = sha256,
strip_prefix = package_id,
urls = [url],
Expand Down Expand Up @@ -222,13 +221,12 @@ def hazel_custom_package_github(
repos).
"""

fixed_package_name = hazel_workspace(package_name)
build_file = "//third_party/haskell:BUILD.{0}".format(fixed_package_name)
build_file = "//third_party/haskell:BUILD.{0}".format(package_name)
url = "https://github.com/{0}/{1}".format(github_user, github_repo)
ssh_url = "[email protected]:{0}/{1}".format(github_user, github_repo)

new_git_repository(
name = "haskell_{0}".format(fixed_package_name),
name = hazel_workspace(package_name),
remote = ssh_url if clone_via_ssh else url,
build_file = build_file,
commit = repo_sha,
Expand Down

0 comments on commit 38e9cef

Please sign in to comment.