I’m having a problem (or rather, our customer is, and I can’t debug or reproduce it locally). The following is what I hope is a minimal version of the problem, but I really can’t check it: GitHub - kenranunderscore/nix-dhall-sandbox-repro: Trying to build a minimal example to reproduce a problem with building Dhall packages in a Nix sandbox
The idea is that there is a Dhall package that defines GitLab CI pipelines, and I use
dhall-to-yaml-ng to convert that to YAML inside of a Nix job. I’ve used
dhall-nixpkgs to generate a Nix expression (using fixed output derivations) for the dependencies. Now I am able to use
nix build (in this example
nix-build release.nix) with the
--no-sandbox flag to build everything locally, with
result being the generated YAML file. This all works just fine for me and in our own GitLab instance and is actually a pleasure to work with (thank you for that!) I’m really happy I could get rid of
--no-sandbox, so now I can properly use flakes and hydra for our project.
But: this seems to fail when running in our customer’s GitLab instance. I don’t have access there, but what I know is that they usually have all the proxy variables set. The Nix build above is triggered in GitLab CI, and even though I can run it in a sandbox locally, the error they’re seeing seems to suggest that “someone” tries to access the internet. Setting the correct proxy variables for the job should have fixed it IMHO, as long as Nix is the one doing the downloading, but it doesn’t seem to work with or without those. This is the relevant part of the error they sent me:
dhall> checking for references to /build/ in /nix/store/4lzqcvq0cz2sxm6p1477mycp96p5fbz6-dhall-1.40.2-doc... building '/nix/store/68gqy3m9lpvrk3p77kz979gv0zcpy9ri-package.dhall.drv'... package.dhall> Warning: Could not get or create the default cache directory: package.dhall> ↳ /homeless-shelter/.cache/dhall package.dhall> You can enable caching by creating it if needed and setting read, package.dhall> write and search permissions on it or providing another cache base package.dhall> directory by setting the $XDG_CACHE_HOME environment variable. package.dhall> dhall: package.dhall> Error: InternalException (HostCannotConnect "raw.githubusercontent.com" [Network.Socket.connect: <socket: 3>: does not exist (Connection refused),Network.Socket.connect: <socket: 3>: does not exist (Connection refused),Network.Socket.connect: <socket: 3>: does not exist (Connection refused),Network.Socket.connect: <socket: 3>: does not exist (Connection refused)]) package.dhall> URL: https://raw.githubusercontent.com/bobdoah/dhall-gitlab-ci/5805c9b69c2b99ebcdd56490acc54a02cf4b8b1d/package.dhall package.dhall> dhall: package.dhall> Error: Invalid input package.dhall> (input):1:1: package.dhall> | package.dhall> 1 | <empty line> package.dhall> | ^ package.dhall> unexpected end of input package.dhall> expecting #!, expression, or whitespace error: builder for '/nix/store/68gqy3m9lpvrk3p77kz979gv0zcpy9ri-package.dhall.drv' failed with exit code 1
Sorry that I don’t have more information. I’m trying to grasp the problem myself. All the other builds that we’re doing that don’t require
--no-sandbox actually run fine in their GitLab instance, so I’m a bit at a loss. Thanks for any pointers!