* Cargo build process failed with `failed to get `ahash` as a dependency`
@ 2024-03-20 13:03 rczb
0 siblings, 0 replies; 2+ messages in thread
From: rczb @ 2024-03-20 13:03 UTC (permalink / raw)
To: help-guix
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
```
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-20 17:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
2024-03-20 13:03 rczb
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).