From 65332a88b6a376334c35d1ec2109cc1f90127523 Mon Sep 17 00:00:00 2001 From: dylan madisetti Date: Mon, 3 Apr 2023 21:20:47 -0400 Subject: [PATCH] Escape path for tests + attributes --- core/nixpkgs.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/nixpkgs.bzl b/core/nixpkgs.bzl index 3886b4848..6f49619c4 100644 --- a/core/nixpkgs.bzl +++ b/core/nixpkgs.bzl @@ -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 { 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 = {}