Skip to content

Commit

Permalink
Escape path for tests + attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmadisetti committed Apr 4, 2023
1 parent b7e7f84 commit 65332a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -481,18 +481,18 @@ def _nixpkgs_package_impl(repository_ctx):
if repository_ctx.attr.nix_file:
nix_file = cp(repository_ctx, repository_ctx.attr.nix_file)
default_nix_substs = {
"%{def}": "import %s" % repository_ctx.path(nix_file),
"%{maybe_attr}": (".%s" % attribute_path) if attribute_path else "",
"%{def}": "import /${\"%s\"}" % repository_ctx.path(nix_file),
"%{maybe_attr}": (".\"%s\"" % attribute_path) if attribute_path else "",
}
elif repository_ctx.attr.nix_file_content:
default_nix_substs = {
"%{def}": repository_ctx.attr.nix_file_content,
"%{maybe_attr}": (".%s" % attribute_path) if attribute_path else "",
"%{maybe_attr}": (".\"%s\"" % attribute_path) if attribute_path else "",
}
else:
default_nix_substs = {
"%{def}": "import <nixpkgs> { config = {}; overlays = []; }",
"%{maybe_attr}": ".%s" % (attribute_path or repository_ctx.attr.name),
"%{maybe_attr}": ".\"%s\"" % (attribute_path or repository_ctx.attr.name),
}

nix_file_deps = {}
Expand Down

0 comments on commit 65332a8

Please sign in to comment.