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

Implement a nicer repository interface for nixpkgs #387

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions haskell/ghc.BUILD

This file was deleted.

8 changes: 7 additions & 1 deletion haskell/haskell.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ load(
_haskell_lint = "haskell_lint",
)
load(
":toolchain.bzl",
":private/toolchain/core.bzl",
_haskell_toolchain = "haskell_toolchain",
)
load(
":private/toolchain/nixpkgs.bzl",
_haskell_nixpkgs_toolchain = "haskell_nixpkgs_toolchain",
)
load(
":ghc_bindist.bzl",
_ghc_bindist = "ghc_bindist",
Expand Down Expand Up @@ -271,6 +275,8 @@ haskell_doctest_toolchain = _haskell_doctest_toolchain

haskell_toolchain = _haskell_toolchain

haskell_nixpkgs_toolchain = _haskell_nixpkgs_toolchain

haskell_proto_library = _haskell_proto_library

haskell_proto_toolchain = _haskell_proto_toolchain
Expand Down
30 changes: 30 additions & 0 deletions haskell/private/toolchain/cc.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Definitions for customizing CC toolchains"""

load("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_autoconf_impl")

def _cc_configure_custom(ctx):
overriden_tools = {
"gcc": ctx.path(ctx.attr.gcc),
"ld": ctx.path(ctx.attr.ld),
}

return cc_autoconf_impl(ctx, overriden_tools)

cc_configure_custom = repository_rule(
implementation = _cc_configure_custom,
attrs = {
"gcc": attr.label(
doc = "The `gcc` binary to use in the custom CC toolchain.",
executable = True,
cfg = "host",
allow_single_file = True,
),
"ld": attr.label(
doc = "The `ld` binary to use in the custom CC toolchain.",
executable = True,
cfg = "host",
allow_single_file = True,
),
},
local = True,
)
Loading