Rust without cargo, with the idea of eventually stopping wasting energy. Some WIP experiments into making rust work with Guix properly.
Maxime Devos e6fdc7a86b rust-xml5ever: Update to building version 0.4.2. | %!s(int64=2) %!d(string=hai) anos | |
---|---|---|
shared-lib | %!s(int64=2) %!d(string=hai) anos | |
.gitignore | %!s(int64=2) %!d(string=hai) anos | |
.guix-authorizations | %!s(int64=2) %!d(string=hai) anos | |
.guix-channel | %!s(int64=2) %!d(string=hai) anos | |
.news | %!s(int64=2) %!d(string=hai) anos | |
0001-Port-src-parsers.rs-to-nom-7.patch | %!s(int64=2) %!d(string=hai) anos | |
0001-Update-to-new-GTK-version-and-new-version-of-depende.patch | %!s(int64=2) %!d(string=hai) anos | |
0001-use-std-time-bump-to-0.5.4.patch | %!s(int64=2) %!d(string=hai) anos | |
LICENSE | %!s(int64=2) %!d(string=hai) anos | |
README.md | %!s(int64=2) %!d(string=hai) anos | |
antioxidant-ci.scm | %!s(int64=2) %!d(string=hai) anos | |
antioxidant-packages.scm | %!s(int64=2) %!d(string=hai) anos | |
antioxidant.scm | %!s(int64=2) %!d(string=hai) anos | |
drill-update-dependencies.patch | %!s(int64=2) %!d(string=hai) anos | |
report | %!s(int64=2) %!d(string=hai) anos | |
rust-cbindgen-0.19-antioxidant-compatibility.patch | %!s(int64=2) %!d(string=hai) anos | |
rust-hmac-sha1-update-dependencies.patch | %!s(int64=2) %!d(string=hai) anos | |
rust-itoa-Reintroduce-fmt.patch | %!s(int64=2) %!d(string=hai) anos | |
rust-libnghttp2-unbundle.patch | %!s(int64=2) %!d(string=hai) anos | |
rust-meval-update-dependencies.patch | %!s(int64=2) %!d(string=hai) anos | |
rust-proptest-derive-upgrade-to-stable-proc-macro-ecosyst.patch | %!s(int64=2) %!d(string=hai) anos | |
rust-watchexec-nix-compatibility.patch | %!s(int64=2) %!d(string=hai) anos | |
warp-Update-tokio-rustls-to-v0.23.patch | %!s(int64=2) %!d(string=hai) anos | |
warp-Update-tungstenite-to-0.17.2.patch | %!s(int64=2) %!d(string=hai) anos |
Rust without cargo, with the idea of eventually stopping wasting energy. Some WIP experiments into making rust work with Guix properly.
Currently, the Rust apps 'agate', 'castor', 'diffr', 'git-absorb', 'hexyl', 'sniffglue' and 'tealdeer' can be built, see guix.scm:
$ guix build -L . -f antioxidant-packages.scm
$ [...]/bin/hexyl
(input some lines)
Warning: some packages have been updated without checking the source code diff!
After a "git pull", do:
$ guix git authenticate 020851ad649480ee4769b77a947642e993ea5956 "C1F3 3EE2 0C52 8FDB 7DD7 011F 49E3 EE22 1917 25EE" --keyring=keys
You can also use it as a channel, e.g. with the following configuration
(use-modules (guix ci))
(cons
(channel
(name 'antioxidated-packages)
(url "https://notabug.org/maximed/cargoless-rust-experiments")
(introduction
(make-channel-introduction
"020851ad649480ee4769b77a947642e993ea5956"
(openpgp-fingerprint
"C1F3 3EE2 0C52 8FDB 7DD7 011F 49E3 EE22 1917 25EE"))))
(list (channel-with-substitutes-available
%default-guix-channel
"https://ci.guix.gnu.org")))
(TODO: make some vitaminated packages available, test "guix pull")
If the package as a #:features #~'("this" "that" ...) argument, then the crate is build with features this and that and their implied features.
If the package has no such argument and Cargo.toml has a "default" feature, then the crate is built with the default feature and all its implied features.
If the package has no such argument and Cargo.toml has no "default" feature, then the crate is built with all features except "nightly" and "unstable".
(for technnical detiails, see 'make-feature-closure' and 'choose-features' in antioxidant.scm)
What if rust-foo requires the 'yes' feature of rust-bar, and rust-oof requires the absence of the 'yes' feature of rust-bar?
Then add a context-dependent replacement to %replacements:
("rust-bar" ,(package-with-rust-features rust-bar #~'() #:metatada "guix-variant=without-yes")
#:for-dependent
,(lambda (dependent)
(string=? "rust-oof" (package-name dependent))))
and enable the feature by default in %features.
Does "rust-foo" fail to build because it requires the feature "baz" of "rust-bar"? Then go to %features in guix.scm and add an entry
("rust-bar" ,#~'("default" "baz")).
If there's already an entry for "rust-bar", modify the existing entry to add "baz".
If you see
warning: #<<crate-mapping> true-name: "packed_simd" local-name: "packed_simd"> not found in the available crates -- this might cause the build to fail!
and
error[E0463]: can't find crate for `packed_simd`
--> src/simd/generic.rs:1:1
|
1 | extern crate packed_simd;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
the solution is probably to remove "simd" or "generic-simd" feature or such, by making the list of features explicit instead of implicit.
("rust-bytecount" ,#~'())
E.g.:
error[E0432]: unresolved imports `digest::BlockInput`, `digest::FixedOutputDirty`
--> lib/lib.rs:133:14
|
133 | use digest::{BlockInput, FixedOutputDirty, Reset, Update};
| ^^^^^^^^^^ ^^^^^^^^^^^^^^^^
| | |
| | no `FixedOutputDirty` in the root
| | help: a similar name exists in the module: `FixedOutput`
| no `BlockInput` in the root
The fixed-length API has been removed in https://github.com/RustCrypto/traits/pull/380. To solve the build failure, maybe update the crate that depends on rust-digest@0.9.0 to a version that supports rust-digest@0.10.0. Alternatively, look if it rust-digest is only used when a certain feature is enabled, and if so, disable that feature.
If the crate assumes unstable rust (e.g. by using #![feature ...]), updating the crate often fixes that.
No method named foo
from bar
? Try updating the crate, maybe an updated crate uses the new API version. Can be caused by over-eagerly replacing rust-syn by a newer version. Could be avoided by implementing support for multiple versions of a crate as dependencies.
2022-05-12: source code location of binaries can now be inferred. Previously, only src/main.rs was understood as default and crates had to set the 'target' field explicitely. But not all crates do that, e.g. rust-alloc-no-stdlib@2.
'set-platform-independent-manifest-variables' doesn't barf anymore on versions like 1.2.3+4.5.6, allowing rust-bzip2-sys to compile.