Skip to content

Commit

Permalink
nixpkgs_python_toolchain string attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
aherrmann committed Nov 13, 2019
1 parent 60381f8 commit ab522e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,11 @@ toolchain(
_nixpkgs_python_toolchain = repository_rule(
_nixpkgs_python_toolchain_impl,
attrs = {
"python2_runtime": attr.label(),
"python3_runtime": attr.label(),
# Using attr.string instead of attr.label, so that the repository rule
# does not explicitly depend on the nixpkgs_package instances. This is
# necessary, so that builds don't fail on platforms without nixpkgs.
"python2_runtime": attr.string(),
"python3_runtime": attr.string(),
},
)

Expand Down Expand Up @@ -496,7 +499,7 @@ def _cp(repository_ctx, src, dest = None):

def _label_string(label):
"""Convert the given (optional) Label to a string."""
if label == None:
if not label:
return "None"
else:
return '"%s"' % label

0 comments on commit ab522e6

Please sign in to comment.