Rust without cargo, with the idea of eventually stopping wasting energy. Some WIP experiments into making rust work with Guix properly.

Danny Milosavljevic 9c8bd1c66c antioxidant: Fix license field (syntactically) of rust-lebe, rust-exr, 1 سال پیش
shared-lib 6979084754 Add missing example 2 سال پیش
.gitignore 12237ccedd Initial tests 2 سال پیش
.guix-authorizations 020851ad64 Add channels code. 2 سال پیش
.guix-channel 31942c4d19 Try fixing news 2 سال پیش
.news 925a123e55 Fix it again(?) 2 سال پیش
0001-Port-src-parsers.rs-to-nom-7.patch acb8e22522 Add missing patches to Git 2 سال پیش
0001-Update-to-new-GTK-version-and-new-version-of-depende.patch c32e2be39e Make 'castor' compatible with recent GTK-related crates. 2 سال پیش
0001-use-std-time-bump-to-0.5.4.patch acb8e22522 Add missing patches to Git 2 سال پیش
DOCUMENTATION f92e2dd1e9 antioxidant: Save tests in .guix-tests if there is no "tests" output. 2 سال پیش
LICENSE 1604b75ccc Build rust-cfg-if with Guix 2 سال پیش
README.md 239d17b4a3 README.md: Update changelog. 2 سال پیش
antioxidant-ci.scm 8a63d5c4b5 antioxidant-ci: Skip removed package rust-cargo-c. 2 سال پیش
antioxidant-packages.scm 9c8bd1c66c antioxidant: Fix license field (syntactically) of rust-lebe, rust-exr, 1 سال پیش
antioxidant-workspaces.scm 7dfb67f6e3 antioxidant-workspaces: Skip 'check' and 'install' by default when there is no Makefile. 2 سال پیش
antioxidant.scm 9c27ea181e antioxidant: Write the .crate-info after compiling the library. 2 سال پیش
drill-update-dependencies.patch d7135dfe34 Update drill for new dependencies. 2 سال پیش
report 87ad056160 report: final changes 2 سال پیش
rust-cbindgen-0.19-antioxidant-compatibility.patch d4a9d71231 rust-cbindgen: Correct patch to actually read the json file. 2 سال پیش
rust-clap-derive-update-dependencies.patch 25f690e48c rust-clap-derive: Unupdate, patch instead. 2 سال پیش
rust-hmac-sha1-update-dependencies.patch df658ff949 rust-hmac-sha1: Add patch for compatibility with new versions of dependencies. 2 سال پیش
rust-itoa-Reintroduce-fmt.patch 94cd0cacc9 Export crate as necessary. 2 سال پیش
rust-libnghttp2-unbundle.patch ca28074b1b rust-libnghttp2-sys: Fix build. 2 سال پیش
rust-meval-update-dependencies.patch d463406c8a rust-meval: Update to building version. 2 سال پیش
rust-newtype-derive-Update-dependencies.patch 0d0ec6766f rust-newtype-derive: Make compatible with new-rustc-version. 2 سال پیش
rust-polars-core-Update-rand.patch 67e9bdd91c rust-polars-core: Patch to make it build against new rust-rand, with "random" feature. 2 سال پیش
rust-proptest-derive-upgrade-to-stable-proc-macro-ecosyst.patch cdb578946e rust-proptest-derive: Make build with rust-syn-1. 2 سال پیش
rust-rustc-test-Update-for-new-time.patch f6abf54a83 rust-rustc-test: Patch to compile with new rust-time. 2 سال پیش
rust-semver-Add-increment-foo-again.patch fb00e6d5b6 rust-semver: Re-add things required by rust-nu-plugin-inc. 2 سال پیش
rust-test-generator-Update-dependencies.patch d66fed067b rust-test-generator: Patch for compatibility with current dependency versions. 2 سال پیش
rust-trybuild-antioxidant-stubs.patch 469cbf3a35 rust-trybuild: Patch for antioxidant. 2 سال پیش
rust-watchexec-nix-compatibility.patch 0c2ab303dc Add patch to rust-watchexec to make it compile against current dependencies. 2 سال پیش
rust-winit-Update-smithay-client-toolkit.patch 73b140faca rust-winit: Update to building version. 2 سال پیش
topological-sort.scm f37aa80f31 antioxidant-workspaces: Fix topological sorting again(?). 2 سال پیش
warp-Update-tokio-rustls-to-v0.23.patch fdcb546507 Update to building version of rust-warp 2 سال پیش
warp-Update-tungstenite-to-0.17.2.patch fdcb546507 Update to building version of rust-warp 2 سال پیش

README.md

cargoless-rust-experiments

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!

Using as a channel (for now)

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
            (channel
              (inherit %default-guix-channel)
              (branch "core-updates"))
            "https://ci.guix.gnu.org")))

This channel requires core-updates! (This is for making librsvg build, for which updating librsvg is convenient but requires up-to-date dependencies as well.)

(TODO: make some vitaminated packages available, test "guix pull")

How to help

  1. Choose a Rust app or library to build.
  2. guix.scm ends with (map vitaminate/auto (list ...)). Add the package to the list.
  3. Run "guix build -L. -f guix.scm" to build it.
  4. If it builds succesfully, go back to (1) and choose something else.
  5. Fix build failures (see next section)
  6. Send a patch to https://notabug.org/maximed/cargoless-rust-experiments/pulls or guix-patches@gnu.org (with maximedevos@telenet.be in X-Debbugs-CC, or alternatively send a mail to maximedevos@telenet.be with a link to the issues.guix.gnu.org entry.)
  7. Repeat.

Which features are built?

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)

How to fix build failures

Build failures caused by incompatible features?

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.

Build failures caused by missing 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".

Build failures due to non-building features

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" ,#~'())

Build failures related to rust-digest

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.

Unstable Rust

If the crate assumes unstable rust (e.g. by using #![feature ...]), updating the crate often fixes that.

Version incompatibilities

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.

Cycles

Changelog

2022-10-15: Support for tests (unit and 'integration'). Support for 'rustdoc' and 'cbindgen'. Support for workspaces. Support for unstable crates. Implied features. More metadata enivornment variables. Support for multiple versions of a single dependency. Helper for running under xvfb-run. Automatic detection of some forms of bundling.

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.