nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
638 stars 24 forks source link

self-upgrade panics intel lorri when switching aarch64 nixpkgs #47

Closed hlolli closed 3 years ago

hlolli commented 3 years ago

Describe the bug

I'm trying to force lorri to rebuild as aarch64 binary. The deamon is running via nix-darwin as x86_64 process

2021-06-01 22 11 02

while my current channel and nixpkgs/master as flake both say

> nix-build -A lorri
/nix/store/j29bkzy1yfq6208wmr4cnghvb5gnzn0l-lorri-1.5.0
> file result/bin/lorri
result/bin/lorri: Mach-O 64-bit executable arm64

This could be a minor issue, and very edge case. But I'll add more to this ticket when I find out more.

To Reproduce Steps to reproduce the behavior:

  1. ...
  2. ...
  3. ...

Expected behavior

Metadata

$ lorri info
error: The following required arguments were not provided:
    --shell-file <nix_file>

USAGE:
    lorri info --shell-file <nix_file>

For more information try --help
$ uname -a
Darwin Hlodvers-MacBook-Air.local 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101 x86_64

Additional context

stacktrace

> lorri self-upgrade
....
> cat /var/folders/m1/flj7c17d3jnc2fqjss319r1m0000gn/T/report-42f0fbab-e866-4c36-8884-1b029d417ea2.toml
name = 'lorri'
operating_system = 'unix:OSX'
crate_version = '1.5.0'
explanation = '''
Panic occurred in file 'src/ops.rs' at line 820
'''
cause = '''
Failed to build the update! Exit {
    cmd: "\"nix-build\" \"--out-link\" \"/var/folders/m1/flj7c17d3jnc2fqjss319r1m0000gn/T/.tmpo4sR5I/result\" \"-A\" \"package\" \"--argstr\" \"type\" \"branch\" \"--argstr\" \"branch\" \"rolling-release\" \"--\" \"/Users/hlodversigurdsson/Library/Caches/com.github.nix-community.lorri.lorri.lorri/cas/a9146ec9593a3cbfad08b432f09c4a9e\"",
    status: Some(
        1,
    ),
    logs: [
        LogLine(
            "warning: unknown setting \'allowUnfree\'",
        ),
        LogLine(
            "error: cannot coerce null to a string",
        ),
        LogLine(
            "",
        ),
        LogLine(
            "       at /nix/store/mbhz2ijd6103h2k6vxcr6xk4dqln4iwk-source/pkgs/build-support/cc-wrapper/default.nix:150:28:",
        ),
        LogLine(
            "",
        ),
        LogLine(
            "          149|",
        ),
        LogLine(
            "          150|     + (if nativeTools then \'\'",
        ),
        LogLine(
            "             |                            ^",
        ),
        LogLine(
            "          151|       echo ${if targetPlatform.isDarwin then cc else nativePrefix} > $out/nix-support/orig-cc",
        ),
        LogLine(
            "(use \'--show-trace\' to show detailed location information)",
        ),
    ],
}'''
method = 'Panic'
backtrace = '''

   0: 0x102f98773 - rust_begin_unwind
   1: 0x102fe8c0b - std::panicking::begin_panic_fmt::h86231066132bcd5f
   2: 0x102de937f - lorri::ops::upgrade::h314670cca2ce54b7
   3: 0x102d980a1 - lorri::main::h4be6800031699d26
   4: 0x102d9b77a - std::sys_common::backtrace::__rust_begin_short_backtrace::hd89080067f139f5e
   5: 0x102d9c3bc - std::rt::lang_start::{{closure}}::h1c7f424e69d8a839
   6: 0x102f9ca10 - std::rt::lang_start_internal::hdea04416cf01ed0d
   7: 0x102d996b9 - main'''
hlolli commented 3 years ago

false alarm, nix-darwin which starts the service has it seems a flake bug (being on experimental stage, I don't blame anyone :) )

I puhed on my fork a hard-coded fix for now to set currentSystem to aarch64-darwin. I hope this information can serve future googlers in trouble.

2021-06-01 23 08 22