Skip to content

Commit

Permalink
Source python toolchain from rules_nixpkgs.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinp committed Oct 4, 2019
1 parent 35de191 commit aa98d59
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
29 changes: 29 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,32 @@ sh_test(
".bazelversion",
],
)

load("@rules_python//python:defs.bzl", "py_runtime_pair")

py_runtime(
name = "python2_runtime",
python_version = "PY2",
files = [],
interpreter = "@python//:bin/python",
)

py_runtime(
name = "python3_runtime",
python_version = "PY3",
files = [],
interpreter = "@python3//:bin/python",
)

py_runtime_pair(
name = "my_python_pairs",
py2_runtime = ":python2_runtime",
py3_runtime = ":python3_runtime",
)

toolchain(
name = "py_pair_toolchain",
#target_compatible_with = <...>,
toolchain = ":my_python_pairs",
toolchain_type = "@rules_python//python:toolchain_type",
)
12 changes: 12 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ nixpkgs_package(
repositories = { "nixpkgs": "@nixpkgs//:default.nix" },
)

nixpkgs_package(
name = "python",
repositories = { "nixpkgs": "@nixpkgs//:default.nix" },
)

nixpkgs_package(
name = "python3",
repositories = { "nixpkgs": "@nixpkgs//:default.nix" },
)

nixpkgs_package(
name = "flex",
repositories = { "nixpkgs": "@nixpkgs//:default.nix" },
Expand Down Expand Up @@ -108,6 +118,8 @@ load("//:setup.bzl", "kythe_rule_repositories", "maybe")
# NOTE(treetide): local modification, we hardwired the nix-based values here.
register_toolchains("//tools/build_rules/lexyacc:lexyacc_local_toolchain")

register_toolchains("//:py_pair_toolchain")

kythe_rule_repositories()

# NOTE(treetide): local
Expand Down

0 comments on commit aa98d59

Please sign in to comment.