unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: rczb <rc-zb@outlook.com>
To: help-guix@gnu.org
Subject: Cargo build process failed with `failed to get `ahash` as a dependency`
Date: Wed, 20 Mar 2024 21:03:41 +0800	[thread overview]
Message-ID: <ME3P282MB39203450D7B636C86CBE403EF8332@ME3P282MB3920.AUSP282.PROD.OUTLOOK.COM> (raw)

I tried to pack Helix <https://helix-editor.com/> with Guix, and 
imitated the script in Nixpkgs 
<https://github.com/NixOS/nixpkgs/blob/nixos-23.11/pkgs/applications/editors/helix/default.nix>. 
The build process failed with errors:

```

starting phase `build'
warning: virtual workspace defaulting to `resolver = "1"` despite one or 
more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` 
in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = 
"2"` in the workspace root's manifest
note: for more details see 
https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
error: failed to get `ahash` as a dependency of package `helix-core 
v0.6.0 (/tmp/guix-build-helix-23.10.drv-0/helix-core)`

Caused by:
  failed to load source for dependency `ahash`

Caused by:
  Unable to update registry `crates-io`

Caused by:
  failed to update replaced source registry `crates-io`

Caused by:
  found a virtual manifest at 
`/tmp/guix-build-helix-23.10.drv-0/book/guix-vendor/helix-23.10-source.tar.xz/Cargo.toml` 
instead of a package manifest
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "cargo" arguments: ("build" 
"--release") exit-status: 101 term-signal: #f stop-signal: #f>
phase`build' failed after0.1 seconds
command "cargo" "build" "--release" failed with status 101
builder for 
`/gnu/store/xajyrjcr51k6vhlxzl2n5x13sdx1f74i-helix-23.10.drv' failed 
with exit code 1
build of /gnu/store/xajyrjcr51k6vhlxzl2n5x13sdx1f74i-helix-23.10.drv failed
View build log at 
'/var/log/guix/drvs/xa/jyrjcr51k6vhlxzl2n5x13sdx1f74i-helix-23.10.drv.gz'.
guix build: error: build of 
`/gnu/store/xajyrjcr51k6vhlxzl2n5x13sdx1f74i-helix-23.10.drv' failed

```

According to the official guide 
<https://docs.helix-editor.com/install.html#building-from-source>, the 
flags `|--path helix-term --locked|` are needed for Cargo. But I 
couldn't find how this can be done, 'cause `cargo-build-system` lacks 
the `build-flags` parameter.


    Build Script

```

(define-module (gnu packages helix)
  #:use-module (gnu packages version-control)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system cargo)
  #:use-module (guix licenses))

(define-public helix
  (package
   (name "helix")
   (version "23.10")
   (source (origin
            (method url-fetch)
            (uri (string-append 
"https://github.com/helix-editor/helix/releases/download/"
                                version
                                "/helix-"
                                version
                                "-source.tar.xz"))
            (sha256 (base32 
"1s2k458wr3612jp4k4rmf338si2f3qbgvgcny74mp8di031clysf"))))

   (build-system cargo-build-system)
   (native-inputs (list git))
   (arguments (list #:phases
                    #~(modify-phases %standard-phases
                        (add-after 'install 'organize
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let* ((working-dir (assoc-ref outputs "out"))
                                   (runtime-dir (string-append 
working-dir "/runtime"))
                                   (sources-dir (string-append 
runtime-dir "/grammars/sources"))
                                   (contrib-dir (string-append 
working-dir "/contrib"))

                                   (lib-dir (string-append working-dir 
"/lib"))
                                   (entry-dir (string-append working-dir 
"/share/applications"))
                                   (fonts-dir (string-append working-dir 
"/share/icons/hicolor/256x256/apps")))
                              (delete-file-recursively sources-dir)

                              (mkdir-p lib-dir)
                              (copy-recursively runtime-dir lib-dir)

                              (mkdir-p entry-dir)
                              (copy-recursively (string-append 
contrib-dir "/Helix.desktop") entry-dir)

                              (mkdir-p fonts-dir)
                              (copy-recursively (string-append 
contrib-dir "/helix.png") fonts-dir))))
                        (add-before 'validate-runpath 'wrap
                          (lambda* (#:key outputs #:allow-other-keys)
                            (let* ((working-dir (assoc-ref outputs "out"))
                                   (excutable (string-append working-dir 
"/bin/hx"))
                                   (lib-runtime-dir (string-append 
working-dir "/lib/runtime")))
                              (wrap-program excutable
                                '("HELIX_RUNTIME" ":" = 
lib-runtime-dir))))))))

   (synopsis "A post-modern modal text editor")
   (description "A Kakoune / Neovim inspired editor, written in Rust.")
   (home-page "https://helix-editor.com/")
   (license mpl2.0)
   (supported-systems (list "x86_64-linux" "aarch64-linux"))))

helix

```

             reply	other threads:[~2024-03-20 13:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 13:03 rczb [this message]
     [not found] <mailman.88.1710950419.17912.help-guix@gnu.org>
2024-03-20 17:07 ` Cargo build process failed with `failed to get `ahash` as a dependency` Parnikkapore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ME3P282MB39203450D7B636C86CBE403EF8332@ME3P282MB3920.AUSP282.PROD.OUTLOOK.COM \
    --to=rc-zb@outlook.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).