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

package '@go_sdk' outputs a single file which is not supported by rules_nixpkgs #419

Open
edjubert opened this issue Sep 21, 2023 · 3 comments
Labels
P3 minor: not priorized type: bug

Comments

@edjubert
Copy link

edjubert commented Sep 21, 2023

Describe the bug
I'm trying to create a project with Nix, Bazel and Go.
I've setup the project with a flake.nix that call a package.nix file with:

{
  buildBazelPackage,
  lib,
  stdenv,
  pkgs,
}:
buildBazelPackage {
  name = "nixbazelgotemplate";

  bazel = pkgs.bazel_6;
  bazelTargets = ["//cmd/nixbazelgotemplate:nixbazelgotemplate"];

  nativeBuildInputs = with pkgs; [nix go];
  buildInputs = with pkgs; [cacert];
  buildAttrs = {
    installPhase = ''
      install -Dm755 bazel-bin/cmd/nixbazelgotemplate/nixbazelgotemplate_/nixbazelgotemplate $out/bin/nixbazelgotemplate
    '';
  };

  src = pkgs.nix-gitignore.gitignoreSource [] (lib.cleanSource ./.);
  fetchAttrs.sha256 = {
    x86_64-linux = "sha256-8U3VvIzQmKUs4Hk5kjerRUNM+VULT7/1ZXGKXTSpkeo=";
    aarch64-darwin = "sha256-L4OCveyEBQ7jzwOVgtbnLa4ns+GVQPphme2x2fJ/DOk=";
  }.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
}

An error occur on every x86_64-linux I've tried (nix on Ubuntu and nixOS if that matter) but runs without error on aarch64-darwin.
When I build it with nix build it returns me this error:

$ nix build .#nixbazelgotemplate
[1/0/2 built] building nixbazelgotemplate-deps.tar.gz (buildPhase): Analyzing: target //cmd/nixbazelgotemplate:nixbazelgotemperror: builder for '/nix/store/nrn95lki35l99x1skqhya2lqgk8d6pzn-nixbazelgotemplate-deps.tar.gz.drv' failed with exit code 1;
       last 10 log lines:
       >   Package '@sdk_go_nix' outputs a single file which is not supported by rules_nixpkgs. Please only use directories.
       >     Command: "/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3/bin/test" "-d" "/nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain"
       >     Return code: 1
       >     Error output:
       >
       > ERROR: Analysis of target '//cmd/nixbazelgotemplate:nixbazelgotemplate' failed; build aborted:
       > INFO: Elapsed time: 45.452s
       > INFO: 0 processes.
       > FAILED: Build did NOT complete successfully (45 packages loaded, 260 targets configured)
       >
       For full logs, run 'nix log /nix/store/nrn95lki35l99x1skqhya2lqgk8d6pzn-nixbazelgotemplate-deps.tar.gz.drv'.
error: 1 dependencies of derivation '/nix/store/qdbd6bw5ccwj2jl1gfgxlm0ys6mzcmjb-nixbazelgotemplate.drv' failed to build

This is the output of nix log /nix/store/nrn95lki35l99x1skqhya2lqgk8d6pzn-nixbazelgotemplate-deps.tar.gz.drv

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/8l8l8hcn1jzdrg8cg8jjqyc90hyc47cb-0hc0kj34zdpgmlnn23wbhywlmh37p124-source
source root is 0hc0kj34zdpgmlnn23wbhywlmh37p124-source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Extracting Bazel installation...
Loading: 
Loading: 
Loading:
Loading: 0 packages loaded
Analyzing: target //cmd/nixbazelgotemplate:nixbazelgotemplate (1 packages loaded, 0 targets configured)
warning: '/nix/var/nix' does not exist, so Nix will use '/build/.local/share/nix/root' as a chroot store
Analyzing: target //cmd/nixbazelgotemplate:nixbazelgotemplate (45 packages loaded, 260 targets configured)
these 4 derivations will be built:
  /nix/store/ncjc9ppbkah02375xzh0hxl73yxr5pj7-bazel-go-toolchain-go-version.drv
  /nix/store/hh0ss11kiini8ajm0l5l11r9l6lbqdar-builder.pl.drv
  /nix/store/yyr5a7zxj30mgxrwiqa3z0n1la7nn742-bazel-go-toolchain.drv
  /nix/store/35q12y2aq3ph8sh40j5fqfdd9wll9kf1-bazel-go-toolchain.drv
these 39 paths will be fetched (93.75 MiB download, 353.74 MiB unpacked):
  /nix/store/2jdmi86cvcrjrgmjc9mx119zbq278ssi-acl-2.3.1
  /nix/store/65jnw3qlvhpk3d0m8vnfbdxc7izdyd92-attr-2.5.1
  /nix/store/a7f7xfp9wyghf44yv6l6fv9dfw492hd3-bash-5.2-p15
  /nix/store/7lmanxby1n0lwb4a2wdjgrsqfk5vzxsg-bzip2-1.0.8
  /nix/store/ylq35nr0zs7n54c96wx0vl3spwhcf3z9-bzip2-1.0.8-bin
  /nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3
  /nix/store/sfzqh8clr15s9cm5876ff83ax0kfr5vj-diffutils-3.10
  /nix/store/41hwancy55ywhy9j63fia9i1rpy0gpjn-ed-1.19
  /nix/store/6igv1bi4jxxvl22vk9k1fqwpyrx8cif7-file-5.44
  /nix/store/w8k9gfc9rkfvvgv1z2pcvpn57xs0nfvy-findutils-4.9.0
  /nix/store/qzxlwhn71a4yx9gb1dyrr06shik3h6v3-gawk-5.2.2
  /nix/store/wrj1i7vfrw4997dzxsx8ky1z47xmnzp4-gcc-12.3.0-lib
  /nix/store/si7fm4vgklis9960c581frfssp5h6530-gcc-12.3.0-libgcc
  /nix/store/ayg065nw0xi1zsyi8glfh5pn4sfqd8xg-glibc-2.37-8
  /nix/store/qvb7bf22jf0k2f1xygcy44l87aqki03w-gmp-with-cxx-6.2.1
  /nix/store/cd6950p53rlxib6vgwh4vy7r6asd9a87-gnu-config-2023-01-21
  /nix/store/mhw4vhrz163p19afdp52disvb5l16zvs-gnugrep-3.11
  /nix/store/92alb87rz7w6yjak1yj4c2ryhsps34az-gnumake-4.4.1
  /nix/store/yrcf918h3vz3x9b36fnm0kf8snvjff9b-gnused-4.9
  /nix/store/xk6lvr5w3bgxm404x8lkgcka2xx3h40q-gnutar-1.34
  /nix/store/nvydgjdaff1i887x2fk8kygcrbxyfyiy-go-1.20.5
  /nix/store/pvvi5kmz97dnlkg8k5dnmv3kikv7asdl-gzip-1.12
  /nix/store/7l7qrvdlfsx2xwwq2bskrfb7wds9s7y3-iana-etc-20230316
  /nix/store/vh4pdds47783g12fmywazdx3v3kx0j4x-libidn2-2.3.4
  /nix/store/aw137ya6rvy61zw8ydsz22xwarsr8ynf-libunistring-1.1
  /nix/store/7mr6k2mfh18hc90j7zlcw7d83gn1wzfz-libxcrypt-4.4.35
  /nix/store/pv29wwix860q9zcsii88iwfwc4hbizrm-lndir-1.0.4
  /nix/store/8wznfxkfkrmj286wfzkp001rp8m8z3vm-mailcap-2.1.53
  /nix/store/ssqd1aivzbl9gf5k6dwxh530jjwfsh2z-patch-2.7.6
  /nix/store/vfqcpzf6a6dy1iy3f51gwfny0ks7rgld-patchelf-0.15.0
  /nix/store/78dmf1mys98x7zc3cm0d22j7wsdzpw0j-pcre2-10.42
  /nix/store/wmccghnpfng3hmpgks56k62izma8bvhy-perl-5.36.0
  /nix/store/hf5zdjmd5gr5w519vd7driifnlm37rpw-stdenv-linux
  /nix/store/bnpc0xj14ip2zipad05qd3y9bv2lwkzq-tzdata-2023c
  /nix/store/7h0kcmyzb5r4zgck42w63b753wm2g52s-update-autotools-gnu-config-scripts-hook
  /nix/store/6kyaqlxcmfadiiq0mcdj1symv1jsp58w-xgcc-12.3.0-libgcc
  /nix/store/s4208r60vs0y90xwg4wwfv07kfdwax2g-xz-5.4.3
  /nix/store/1ci6fn5jq64iqkcmhgzjxashsg8bm8p5-xz-5.4.3-bin
  /nix/store/mgz7sp9jxnk7c3rn1hvich9n0k2rjr7m-zlib-1.2.13
copying path '/nix/store/cd6950p53rlxib6vgwh4vy7r6asd9a87-gnu-config-2023-01-21' from 'https://cache.nixos.org'...
copying path '/nix/store/si7fm4vgklis9960c581frfssp5h6530-gcc-12.3.0-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/7l7qrvdlfsx2xwwq2bskrfb7wds9s7y3-iana-etc-20230316' from 'https://cache.nixos.org'...
copying path '/nix/store/aw137ya6rvy61zw8ydsz22xwarsr8ynf-libunistring-1.1' from 'https://cache.nixos.org'...
copying path '/nix/store/8wznfxkfkrmj286wfzkp001rp8m8z3vm-mailcap-2.1.53' from 'https://cache.nixos.org'...
copying path '/nix/store/vh4pdds47783g12fmywazdx3v3kx0j4x-libidn2-2.3.4' from 'https://cache.nixos.org'...
copying path '/nix/store/bnpc0xj14ip2zipad05qd3y9bv2lwkzq-tzdata-2023c' from 'https://cache.nixos.org'...
copying path '/nix/store/7h0kcmyzb5r4zgck42w63b753wm2g52s-update-autotools-gnu-config-scripts-hook' from 'https://cache.nixos.org'...
copying path '/nix/store/6kyaqlxcmfadiiq0mcdj1symv1jsp58w-xgcc-12.3.0-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/ayg065nw0xi1zsyi8glfh5pn4sfqd8xg-glibc-2.37-8' from 'https://cache.nixos.org'...
copying path '/nix/store/65jnw3qlvhpk3d0m8vnfbdxc7izdyd92-attr-2.5.1' from 'https://cache.nixos.org'...
copying path '/nix/store/a7f7xfp9wyghf44yv6l6fv9dfw492hd3-bash-5.2-p15' from 'https://cache.nixos.org'...
copying path '/nix/store/2jdmi86cvcrjrgmjc9mx119zbq278ssi-acl-2.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/7lmanxby1n0lwb4a2wdjgrsqfk5vzxsg-bzip2-1.0.8' from 'https://cache.nixos.org'...
copying path '/nix/store/41hwancy55ywhy9j63fia9i1rpy0gpjn-ed-1.19' from 'https://cache.nixos.org'...
copying path '/nix/store/ylq35nr0zs7n54c96wx0vl3spwhcf3z9-bzip2-1.0.8-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/qzxlwhn71a4yx9gb1dyrr06shik3h6v3-gawk-5.2.2' from 'https://cache.nixos.org'...
copying path '/nix/store/wrj1i7vfrw4997dzxsx8ky1z47xmnzp4-gcc-12.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/92alb87rz7w6yjak1yj4c2ryhsps34az-gnumake-4.4.1' from 'https://cache.nixos.org'...
copying path '/nix/store/qvb7bf22jf0k2f1xygcy44l87aqki03w-gmp-with-cxx-6.2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/yrcf918h3vz3x9b36fnm0kf8snvjff9b-gnused-4.9' from 'https://cache.nixos.org'...
copying path '/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3' from 'https://cache.nixos.org'...
copying path '/nix/store/xk6lvr5w3bgxm404x8lkgcka2xx3h40q-gnutar-1.34' from 'https://cache.nixos.org'...
copying path '/nix/store/sfzqh8clr15s9cm5876ff83ax0kfr5vj-diffutils-3.10' from 'https://cache.nixos.org'...
copying path '/nix/store/w8k9gfc9rkfvvgv1z2pcvpn57xs0nfvy-findutils-4.9.0' from 'https://cache.nixos.org'...
copying path '/nix/store/nvydgjdaff1i887x2fk8kygcrbxyfyiy-go-1.20.5' from 'https://cache.nixos.org'...
copying path '/nix/store/pvvi5kmz97dnlkg8k5dnmv3kikv7asdl-gzip-1.12' from 'https://cache.nixos.org'...
copying path '/nix/store/7mr6k2mfh18hc90j7zlcw7d83gn1wzfz-libxcrypt-4.4.35' from 'https://cache.nixos.org'...
copying path '/nix/store/pv29wwix860q9zcsii88iwfwc4hbizrm-lndir-1.0.4' from 'https://cache.nixos.org'...
copying path '/nix/store/ssqd1aivzbl9gf5k6dwxh530jjwfsh2z-patch-2.7.6' from 'https://cache.nixos.org'...
copying path '/nix/store/vfqcpzf6a6dy1iy3f51gwfny0ks7rgld-patchelf-0.15.0' from 'https://cache.nixos.org'...
copying path '/nix/store/78dmf1mys98x7zc3cm0d22j7wsdzpw0j-pcre2-10.42' from 'https://cache.nixos.org'...
copying path '/nix/store/s4208r60vs0y90xwg4wwfv07kfdwax2g-xz-5.4.3' from 'https://cache.nixos.org'...
copying path '/nix/store/mhw4vhrz163p19afdp52disvb5l16zvs-gnugrep-3.11' from 'https://cache.nixos.org'...
copying path '/nix/store/1ci6fn5jq64iqkcmhgzjxashsg8bm8p5-xz-5.4.3-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/mgz7sp9jxnk7c3rn1hvich9n0k2rjr7m-zlib-1.2.13' from 'https://cache.nixos.org'...
copying path '/nix/store/6igv1bi4jxxvl22vk9k1fqwpyrx8cif7-file-5.44' from 'https://cache.nixos.org'...
copying path '/nix/store/wmccghnpfng3hmpgks56k62izma8bvhy-perl-5.36.0' from 'https://cache.nixos.org'...
copying path '/nix/store/hf5zdjmd5gr5w519vd7driifnlm37rpw-stdenv-linux' from 'https://cache.nixos.org'...
building '/nix/store/ncjc9ppbkah02375xzh0hxl73yxr5pj7-bazel-go-toolchain-go-version.drv'...
building '/nix/store/hh0ss11kiini8ajm0l5l11r9l6lbqdar-builder.pl.drv'...
building '/nix/store/yyr5a7zxj30mgxrwiqa3z0n1la7nn742-bazel-go-toolchain.drv'...
created 2 symlinks in user environment
building '/nix/store/35q12y2aq3ph8sh40j5fqfdd9wll9kf1-bazel-go-toolchain.drv'...
/nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain
INFO: Repository sdk_go_nix instantiated at:
  /build/0hc0kj34zdpgmlnn23wbhywlmh37p124-source/WORKSPACE:51:21: in <toplevel>
  /build/output/external/rules_nixpkgs_go/go.bzl:398:20: in nixpkgs_go_configure
  /build/output/external/rules_nixpkgs_core/nixpkgs.bzl:676:21: in nixpkgs_package
Repository rule _nixpkgs_package defined at:
  /build/output/external/rules_nixpkgs_core/nixpkgs.bzl:549:35: in <toplevel>
Analyzing: target //cmd/nixbazelgotemplate:nixbazelgotemplate (45 packages loaded, 260 targets configured)
ERROR: An error occurred during the fetch of repository 'sdk_go_nix':
   Traceback (most recent call last):
	File "/build/output/external/rules_nixpkgs_core/nixpkgs.bzl", line 547, column 31, in _nixpkgs_package_impl
		_nixpkgs_build_and_symlink(repository_ctx, nix_build, build_file_content)
	File "/build/output/external/rules_nixpkgs_core/nixpkgs.bzl", line 417, column 20, in _nixpkgs_build_and_symlink
		execute_or_fail(
	File "/build/output/external/rules_nixpkgs_core/util.bzl", line 97, column 13, in execute_or_fail
		fail("""
Error in fail: 
  Package '@sdk_go_nix' outputs a single file which is not supported by rules_nixpkgs. Please only use directories.
    Command: "/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3/bin/test" "-d" "/nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain"
    Return code: 1
    Error output: 

ERROR: /build/0hc0kj34zdpgmlnn23wbhywlmh37p124-source/WORKSPACE:51:21: fetching _nixpkgs_package rule //external:sdk_go_nix: Traceback (most recent call last):
	File "/build/output/external/rules_nixpkgs_core/nixpkgs.bzl", line 547, column 31, in _nixpkgs_package_impl
		_nixpkgs_build_and_symlink(repository_ctx, nix_build, build_file_content)
	File "/build/output/external/rules_nixpkgs_core/nixpkgs.bzl", line 417, column 20, in _nixpkgs_build_and_symlink
		execute_or_fail(
	File "/build/output/external/rules_nixpkgs_core/util.bzl", line 97, column 13, in execute_or_fail
		fail("""
Error in fail: 
  Package '@sdk_go_nix' outputs a single file which is not supported by rules_nixpkgs. Please only use directories.
    Command: "/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3/bin/test" "-d" "/nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain"
    Return code: 1
    Error output: 

ERROR: /build/output/external/sdk_go_nix_toolchains/BUILD.bazel:4:19: @sdk_go_nix_toolchains//:toolchain_go_linux_amd64-impl depends on @sdk_go_nix//:builder in repository @sdk_go_nix which failed to fetch. no such package '@sdk_go_nix//': 
  Package '@sdk_go_nix' outputs a single file which is not supported by rules_nixpkgs. Please only use directories.
    Command: "/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3/bin/test" "-d" "/nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain"
    Return code: 1
    Error output: 

ERROR: /build/output/external/sdk_go_nix_toolchains/BUILD.bazel:4:19: @sdk_go_nix_toolchains//:toolchain_go_linux_amd64-impl depends on @sdk_go_nix//:go_sdk in repository @sdk_go_nix which failed to fetch. no such package '@sdk_go_nix//': 
  Package '@sdk_go_nix' outputs a single file which is not supported by rules_nixpkgs. Please only use directories.
    Command: "/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3/bin/test" "-d" "/nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain"
    Return code: 1
    Error output: 

ERROR: Analysis of target '//cmd/nixbazelgotemplate:nixbazelgotemplate' failed; build aborted: 
INFO: Elapsed time: 45.452s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (45 packages loaded, 260 targets configured)

To Reproduce
I created a repository with the project setup and a description of the error (same as above)
https://github.com/edjubert/nix-bazel-go-template

git clone https://github.com/edjubert/nix-bazel-go-template
cd nix-bazel-go-template
nix build .#nixbazelgotemplate

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS name + version:
    • Ubuntu 23.04
    • NixOS 23.05
@benradf
Copy link
Contributor

benradf commented Nov 10, 2023

Thanks for reporting this @edjubert.

@benradf benradf added P3 minor: not priorized type: bug labels Nov 10, 2023
@benradf
Copy link
Contributor

benradf commented Nov 10, 2023

This error is a bit misleading:

Error in fail: 
  Package '@sdk_go_nix' outputs a single file which is not supported by rules_nixpkgs. Please only use directories.
    Command: "/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3/bin/test" "-d" "/nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain"
    Return code: 1
    Error output: 

It suggests that /nix/store/qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain is a single file, but the test being done actually checks whether that path exists as a directory — test -d.

Using some nsenter hackery to get into the Nix build sandbox, I can see that qjynhwar1pjwgi4dfkc069a8jjbihmwr-bazel-go-toolchain does not exist at all. The only store paths available from within the sandbox are:

/nix/store/47xarw376yhzhkl3p97l58hacmzwsn9h-a31y96kz0y1553kjw3y1rg2vgcwnrd0b-source
/nix/store/2jdmi86cvcrjrgmjc9mx119zbq278ssi-acl-2.3.1
/nix/store/65jnw3qlvhpk3d0m8vnfbdxc7izdyd92-attr-2.5.1
/nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh
/nix/store/10fi6lmrvra2rx1janwgyp18n9d8crdk-aws-sdk-cpp-1.11.37
/nix/store/1bljb7i1f67h0zlicf7v55a11g7sw20x-aws-c-mqtt-0.8.8
/nix/store/2f54wbn8fm88f4a7a9gl7shda8q7hbr3-aws-c-auth-0.6.26
/nix/store/50hr9ifrn91s3d15rz5rwspx3xg6f8ba-aws-c-s3-0.2.8
/nix/store/531a3l9fnmphcfikm1mjmlfg5wwlf1xl-aws-c-event-stream-0.2.20
/nix/store/8dk94r15w643nyc0diifvcadzhx58xvp-aws-c-io-0.13.19
/nix/store/9h84fyj8daykbi1lgskr902kzbs4w106-aws-c-sdkutils-0.1.9
/nix/store/akjs2sdxjdih0v0m34vgq7m956yrk1am-aws-crt-cpp-0.20.2
/nix/store/d3jc67v01smf02cks01lpfp21w6zq865-aws-c-compression-0.2.16
/nix/store/i98cfrl78nd84amw71hcp86bgw1g0njr-aws-c-cal-0.5.21
/nix/store/ibva3w2dk3z9l2lc38lw9za6ljz7icba-aws-c-common-0.8.15
/nix/store/jj308v652zamqb8gjhvhmmxlbq1c3ak5-aws-checksums-0.1.14
/nix/store/xy3r20ms0ak75ishzw07l7gmv2ik03bp-aws-c-http-0.7.6
/nix/store/a7f7xfp9wyghf44yv6l6fv9dfw492hd3-bash-5.2-p15
/nix/store/b2s2i3y5x27qn0ka3ck90qcrg0sp62kp-bazel-rc
/nix/store/im5hxxjwaxgphxzih5cbir4bprl795zb-bazel-6.2.0
/nix/store/isfp8a9ppamf93qga4l3yvffj42f9jpd-bazel-deps
/nix/store/011g91lwk2l5qmzgrgmrjp2qpkjj1n0r-binutils-2.40-lib
/nix/store/r5x7gyddzwml0h9g7gg7r6zlwpdzc10a-binutils-2.40
/nix/store/wgnrcbdh3nq4qd00xzj1sl2ps8fx70r0-binutils-wrapper-2.40
/nix/store/0dgg8mr9rbylqg8qm1bkdc2lz0zp3hjl-boehm-gc-8.2.2
/nix/store/0llsnhn2l2mnv1qgmaibqrlw3rl44ayq-boehm-gc-8.2.2-dev
/nix/store/n4a595v77gmjdm3gpjx4l9c62xig1nxy-brotli-1.0.9-lib
/nix/store/0296qxvn30z9b2ah1g5p97k5wr9k8y78-busybox-static-x86_64-unknown-linux-musl-1.35.0
/nix/store/6mij49vn3jf0b277fq2djn7asrg5chsw-busybox-static-x86_64-unknown-linux-musl-1.36.1
/nix/store/7lmanxby1n0lwb4a2wdjgrsqfk5vzxsg-bzip2-1.0.8
/nix/store/ylq35nr0zs7n54c96wx0vl3spwhcf3z9-bzip2-1.0.8-bin
/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh
/nix/store/whinz9rj5h6h8zxp9bkmfzv7fkzc0cq8-coreutils-9.3
/nix/store/zh95xd7sy0si14hp7pf42jywdg6qc5y8-curl-8.1.1
/nix/store/6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh
/nix/store/sfzqh8clr15s9cm5876ff83ax0kfr5vj-diffutils-3.10
/nix/store/41hwancy55ywhy9j63fia9i1rpy0gpjn-ed-1.19
/nix/store/rmzr2ysndb9f3yw72cwr4zyf77id18sv-editline-1.17.1
/nix/store/z7zc7cm04j6dd7bghlczg7ryk93md6f4-expand-response-params
/nix/store/4m6pyb4lyp3kqm6nl4b9hklgrdiw1fd9-expat-2.5.0
/nix/store/6igv1bi4jxxvl22vk9k1fqwpyrx8cif7-file-5.44
/nix/store/y77gdq3aaxnm2fjy0266fz12ma31vjqv-file-5.44
/nix/store/w8k9gfc9rkfvvgv1z2pcvpn57xs0nfvy-findutils-4.9.0
/nix/store/qzxlwhn71a4yx9gb1dyrr06shik3h6v3-gawk-5.2.2
/nix/store/hhhjpdd06w42prplsak9r0w2y426pdwp-gcc-12.3.0
/nix/store/si7fm4vgklis9960c581frfssp5h6530-gcc-12.3.0-libgcc
/nix/store/wrj1i7vfrw4997dzxsx8ky1z47xmnzp4-gcc-12.3.0-lib
/nix/store/x7n44lfys59k5ajj9w1fkxw5391cnn5v-gcc-wrapper-12.3.0
/nix/store/vy1ap7zfrqxjq93gz1xn0ivn7y99k63s-gdbm-1.23
/nix/store/0ccvlygpc7p5zyfsyz8mmg9ycqkvrcp2-glibc-2.37-8-dev
/nix/store/75vv3mli422cf9awip32v9yklhn43nz4-glibc-2.37-8-bin
/nix/store/ayg065nw0xi1zsyi8glfh5pn4sfqd8xg-glibc-2.37-8
/nix/store/f5qzn45360sflx2nx8jd3vx0hb8zf5pg-gmp-6.2.1
/nix/store/qvb7bf22jf0k2f1xygcy44l87aqki03w-gmp-with-cxx-6.2.1
/nix/store/cd6950p53rlxib6vgwh4vy7r6asd9a87-gnu-config-2023-01-21
/nix/store/mhw4vhrz163p19afdp52disvb5l16zvs-gnugrep-3.11
/nix/store/92alb87rz7w6yjak1yj4c2ryhsps34az-gnumake-4.4.1
/nix/store/yrcf918h3vz3x9b36fnm0kf8snvjff9b-gnused-4.9
/nix/store/xk6lvr5w3bgxm404x8lkgcka2xx3h40q-gnutar-1.34
/nix/store/nvydgjdaff1i887x2fk8kygcrbxyfyiy-go-1.20.5
/nix/store/pvvi5kmz97dnlkg8k5dnmv3kikv7asdl-gzip-1.12
/nix/store/7l7qrvdlfsx2xwwq2bskrfb7wds9s7y3-iana-etc-20230316
/nix/store/n5fc3wm8vyb9hcscqjcdaqz65j5j0j79-isl-0.20
/nix/store/hpzffx5x5vs4jl3sy19kvry8qn1zsx4i-keyutils-1.6.3-lib
/nix/store/xc7ykv139chgawl2wagb1jk8wiga2lp5-lcms2-2.15
/nix/store/xc54imzy7w2q21jk5l76a95va6919jna-libarchive-3.6.2-lib
/nix/store/r2mrjm0y87ps900b838z6km1vb6wlbij-libcpuid-0.6.3
/nix/store/v4gixcxxx0dwy8s8l32i63cbnz16zn5d-libffi-3.4.4
/nix/store/vh4pdds47783g12fmywazdx3v3kx0j4x-libidn2-2.3.4
/nix/store/kv30whm9ffm47m2jnfc6rdgf1dk8n44k-libjpeg-turbo-2.1.5.1
/nix/store/zl98vicy04kkjq7lqqa8k75w1j8malck-libkrb5-1.20.1
/nix/store/h2lzk7a4754z47j7qz6wavffdi3agxl6-libmpc-1.3.1
/nix/store/xykfcm1gdz27sxmcvbwb7xmrhmw8qayc-libseccomp-2.5.4-lib
/nix/store/k5x8rlvh0inprakni6h7nl7x3qglqrwf-libsodium-1.0.18
/nix/store/na202vmpsp4p7wzmyqdqqmzndgafi0pm-libssh2-1.11.0
/nix/store/aw137ya6rvy61zw8ydsz22xwarsr8ynf-libunistring-1.1
/nix/store/7mr6k2mfh18hc90j7zlcw7d83gn1wzfz-libxcrypt-4.4.35
/nix/store/7rj7g152pq6p4bv417hlq89anm829nvr-libxml2-2.10.4
/nix/store/dwprf815f2nz9skngv4hs363a8ryadrx-linux-headers-6.4
/nix/store/w7f60r28z1lk6si2wrkjdbmkpay506d4-lowdown-1.0.2-lib
/nix/store/8wznfxkfkrmj286wfzkp001rp8m8z3vm-mailcap-2.1.53
/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh
/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh
/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh
/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh
/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh
/nix/store/cglcd1jr6c41zq0y4m8flw4kz0smpvwl-mpfr-4.2.0
/nix/store/bxsly8a56yb8kyrq03s82a3vyc8fqrb3-multiple-outputs.sh
/nix/store/gmx0dj8kvl7agm6azrbgv9w3k4kp844y-ncurses-6.4
/nix/store/iq7sf09cj4l402jvyap0miad31cazbhi-nghttp2-1.51.0-lib
/nix/store/89ybsq306rilnfxy2mdy2fq618dfbgcb-nix-2.15.1-man
/nix/store/bp8fzfn6n7zg00lqg8kwfbmg5s6yhxiv-nix-2.15.1-dev
/nix/store/zx5z0qi896pj0y85zixsw1dlblmvgq1z-nix-2.15.1
/nix/store/a90balxd26wdsfcbps02hchgnxi497yz-nlohmann_json-3.11.2
/nix/store/h0w9h1kq7da07x68x58qlc88qfpzwm3m-nss-cacert-3.90
/nix/store/1sxv5d55jigpcwx2blbyl1c0mbn0l5dq-openjdk-headless-11.0.19+7
/nix/store/3qfhik9kh01wsyvc0lbl4wmw5v4acmn0-openssl-3.0.9
/nix/store/ix7cb1isdcdl4gq9hl4pdk6gyc4wrk14-openssl-3.0.9
/nix/store/nf1lkdrhapsx5lr6diyxyjr7pb7r20gr-patch-shebangs.sh
/nix/store/ssqd1aivzbl9gf5k6dwxh530jjwfsh2z-patch-2.7.6
/nix/store/vfqcpzf6a6dy1iy3f51gwfny0ks7rgld-patchelf-0.15.0
/nix/store/78dmf1mys98x7zc3cm0d22j7wsdzpw0j-pcre2-10.42
/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
/nix/store/9c03r86hcdn43dm3hsgjirifvyzfkhwh-python3-3.10.12
/nix/store/4f5dbbbh05f87xi8b3lgs653gs5bpb6d-readline-8.2p1
/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh
/nix/store/gg4ycm76irr82z31b2mv5bvjdvr1sqhz-s2n-tls-1.3.46
/nix/store/n66hz94r0qh6wh9s9hsng651sv8wcsk9-set-java-classpath-hook
/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh
/nix/store/q4md4bnaz6sc35nr32disndbbfq5yxd8-sqlite-3.42.0
/nix/store/fzb9wy1yz0hn69vxw12954szvrjnjjgk-stdenv-linux
/nix/store/a9ndjg0b1ivi0av9m93vfkrndp7fqbw1-strip.sh
/nix/store/bnpc0xj14ip2zipad05qd3y9bv2lwkzq-tzdata-2023c
/nix/store/gkm485lrbl38cfna6zjwzysvwcgsq1ka-unzip-6.0
/nix/store/7h0kcmyzb5r4zgck42w63b753wm2g52s-update-autotools-gnu-config-scripts-hook
/nix/store/9s3cmkci23pydidsm64klvgjm11n7h9w-which-2.21
/nix/store/6kyaqlxcmfadiiq0mcdj1symv1jsp58w-xgcc-12.3.0-libgcc
/nix/store/1ci6fn5jq64iqkcmhgzjxashsg8bm8p5-xz-5.4.3-bin
/nix/store/s4208r60vs0y90xwg4wwfv07kfdwax2g-xz-5.4.3
/nix/store/h7kgdjnqh3ys875qp5dsj2c8pm3rq8nv-zip-3.0
/nix/store/mgz7sp9jxnk7c3rn1hvich9n0k2rjr7m-zlib-1.2.13
/nix/store/lb2s32b01llckgbzzhwdg9jdnl9z8kg9-zstd-1.5.5

I'm afraid I'm not familiar enough with buildBazelPackage to say why the bazel-go-toolchain derivation is missing.

@avdv
Copy link
Member

avdv commented Nov 13, 2023

Hi.

I think this is a problem because you're trying to call nix inside of nix:

  1. you run a nix build with bazel_6, nix and go inside the sandbox
  2. bazel tries to build the bazel-go-toolchain package by calling nix

This is usually not supported, as the nix sandbox will not allow you to do that.

You might get away with it by disabling the sandbox.

An alternative approach would be to let nix provide all the tooling (ie. go SDK, C compiler) and inside the nix sandbox just use non-nix toolchain resolution.

Yet another thing you could look into is to use the experimental recursive nix support. See NixOS/nix#3205 and NixOS/nix#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 minor: not priorized type: bug
Projects
None yet
Development

No branches or pull requests

3 participants