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

progress output from curl inside builder seems to "hang" #8379

Open
kirillrdy opened this issue May 21, 2023 · 2 comments
Open

progress output from curl inside builder seems to "hang" #8379

kirillrdy opened this issue May 21, 2023 · 2 comments
Labels

Comments

@kirillrdy
Copy link
Member

kirillrdy commented May 21, 2023

Describe the bug

Sorry for vague title.

fetchurl from nixpkgs and other dependents eg fetchzip use curl to fetch files. curl usually prints download progress.

When called from builder however curl doesn't print progress, and it looks as if download is not progressing

Steps To Reproduce
here is minimal derivation to reproduce

curl.nix

{ pkgs ? import <nixpkgs> { } }:
derivation {
  system = "x86_64-linux";
  name = "foo";
  builder = ./builder.sh;
  curl = pkgs.curl;
  outputHashMode = "flat";
  outputHashAlgo = "sha256";
  outputHash = "sha256-GEcjpQXIreeWdgPiARZYbN4kGzRDGF1YZdIL8k23gFs=";
}

builder.sh

#!/bin/sh
${curl}/bin/curl --insecure https://dl.xonotic.org/xonotic-0.8.5.zip --output foo

Expected behavior

expect to see progress from curl

nix-env --version output

Additional context

I've managed to isolate the issue to this line

https://github.com/NixOS/nix/blob/master/src/libstore/build/local-derivation-goal.cc#L854

  if (dup2(builderOut.get(), STDERR_FILENO) == -1)
            throw SysError("cannot pipe standard error into log file");

removing this line, fixes the curl issue, but obviously it breaks a bunch of other things, I am not familiar enough with this area to fix all the issues, hoping that this makes more sense for nix developers/maintainers

Priorities

Add 👍 to issues you find important.

@abhillman
Copy link

I am seeing this issue. One workaround that may work is to delete the derivation with nix-store --delete /path [--ignore-liveness].

@thufschmitt
Copy link
Member

@abhillman wrong issue?

@kirillrdy I suspect it's due to stderr not being a tty any more. Not sure what to do about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants