help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cargo build process failed with `failed to get `ahash` as a dependency`


From: rczb
Subject: Cargo build process failed with `failed to get `ahash` as a dependency`
Date: Wed, 20 Mar 2024 21:03:41 +0800
User-agent: Betterbird (Linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]