Closed goosetherumfoodle closed 2 years ago
You may use pkgs.haskell.lib.dontCheck
to bypass the test-suite of a package if you want to skip it.
project-m36 = pkgs.haskell.lib.dontCheck (import (fetchTarball "https://github.com/agentm/project-m36/archive/refs/tags/v0.9.5.tar.gz"));
Indeed- the tests for the tagged releases always pass, so you can cut your build time by cutting out the tests.
In this particular case, I would guess that there is some proxy/firewall blocking the DNS response.
Does the following, equivalent curl
command succeed in the same environment?
curl 'https://raw.githubusercontent.com/agentm/project-m36/master/test/TutorialD/Interpreter/Import/httpimporttest.tutd'
It could be a fair request to have the test point at a local HTTP server, but I am curious as to what is actually blocking the DNS lookup.
I'm not a nix pro and may be misunderstanding, but i believe that network requests are discouraged during the nix build as sources of non-determinism. I'm not at my dev machine right now, but I probably have sandbox-mode enabled, which may be the source of the difference on my machine.
See the 'Sandboxing' section: https://nixos.wiki/wiki/Nix_package_manager#Sandboxing
Some quick googling gives me the impression that people disable network requests for nix builds: https://discourse.nixos.org/t/dealing-with-tests-that-require-networking-support/13804/3
I confirmed my nixos box does indeed have sandbox mode set. And the curl request mentioned succeeds.
Interestingly, I just ran the solution above, with the same config files in my first post, and that got me past the tests but then brought up a new error:
Setup: Encountered missing or private dependencies:
project-m36
Seems like cabal can't find the project, even though it's definitely compiling it.
Edit. Getting the same missing or private dependencies
result when i switch off sandbox mode. Now I'm wondering if either I'm the only one compiling this with nix on nixos, or if there's just something particular about my nixos install... I haven't encountered this elsewhere though.
{ pkgs ? import <nixpkgs> { } }:
with pkgs.haskell.lib; {
# curryer-rpc-0.2.1
allowBroken = true;
packageOverrides = super:
let self = super.pkgs;
in rec {
haskellPackages = haskell.packages.ghc924;
haskell = super.haskell // {
packages = super.haskell.packages // {
ghc924 = super.haskell.packages.ghc924.override {
overrides = self: super: {
#to all haskell packages.
mkDerivation = drv:
super.mkDerivation (drv // {
doCheck = false;
doHaddock = false;
});
curryer-rpc = self.callHackageDirect {
pkg = "curryer-rpc";
ver = "0.2.2";
sha256 = "sha256-c4DgpJV3GZl2oW55RR56xps4lGuwTFQzYrJP8VeLLds="; } {};
fast-builder = doJailbreak super.fast-builder;
project-m36 = self.callHackageDirect {
pkg = "project-m36";
ver = "0.9.5";
sha256 = "sha256-uDc7PB01uVyXSSf4t/v2F5ZeOOHu+xCopvDAt7XBquE=";} {};
};
};
};
};
};
}
I may not fully understand how import fetchTarball
works.
My nix channel is nixos-22.05 now.
The code above is my ~/.config/nixpkgs/config.nix. It can get project-m36 working in my computer.
Not calling out to the Internet is a fair request. We can just start a local HTTP server to check that functionality.
Project:M36 also uses nix to build the docker images, in case you need more nix examples to get going.
Setup: Encountered missing or private dependencies: project-m36
In nix repl "<nixpkgs>",
enter haskellPackages.project-m36
, what does it say?
I've been unable to add this as a dependency to a nix project. I'm on nixos.
I can reproduce with a simple cabal file:
and a
default.nix
pointing to the latest nixpkgs and the latest project-m36:With this setup,
nix-build
fails. It looks like a test fails while trying to make an http request: