unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Mekeor Melire <mekeor@posteo.de>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 54509@debbugs.gnu.org
Subject: [bug#54509] bump: make rust-cargo understand rust-edition2021 which rustc already does
Date: Fri, 01 Jul 2022 21:48:43 +0000	[thread overview]
Message-ID: <87sfnk4e3j.fsf@posteo.de> (raw)
In-Reply-To: <eb52fedfbd9ce41ba736c348030092f4335d70f0.camel@telenet.be>

2022-06-30 / 10:10 / maximedevos@telenet.be:

> Mekeor Melire schreef op wo 29-06-2022 om 22:57 [+0000]:

> > the rust-compiler which is packaged for guix supports edition2021
> > but the cargo version packaged for guix does not
>
> Pretty sure that it does, IIRC under antioxidant-build-system I've seen
> some things being compiled with the 2021 edition of rust, presumably
> they also compiled under cargo-build-system.

i tested this again. i'll describe the issue with some instructions:

    create a cargo project:

        $ cargo new foo
        $ cd foo

    use edition 2021 instead of 2018:

        $ sed -i 's/2018/2021/' Cargo.toml

    attempt to build and run. you'll observe an error:

        $ cargo run

        > error: failed to parse manifest at `/home/user/foo/Cargo.toml`
        > Caused by:
        >   feature `edition2021` is required
        >   consider adding `cargo-features = ["edition2021"]` to the manifest

    specify the 2021-edition as a cargo-feature, as suggested by cargo.
    and try building and running again. it'll work fine:

        $ (echo 'cargo-features = ["edition2021"]' && cat Cargo.toml) | \
          sponge Cargo.toml
        $ cargo run

        > [...]
        > Hello world!

    but now, let's add a package as dependency - a package which uses
    edition2021. and then, try to build and run:

        $ echo 'axum = "0.5.4"' >> Cargo.toml
        $ cargo run

        > error: failed to download `axum-core v0.2.6`
        > Caused by:
        >   unable to get packages from source
        > Caused by:
        >   failed to parse manifest at
        >   `/home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-core-0.2.6/Cargo.toml`
        > Caused by:
        >   feature `edition2021` is required
        >   consider adding `cargo-features = ["edition2021"]` to the manifest

TLDR: you can't build projects which depend on packages which depend on
edition2021.

> Also, rust-cargo does not have the cargo binary (but a cargo library!),
> you may be looking for the 'cargo' output of the 'rust' package
> instead.
>
> Greetings,
> Maxime.




  reply	other threads:[~2022-07-01 23:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 17:46 [bug#54509] rust-cargo: Update to 0.60.0 to support Edition2021 projects Paul Alesius
2022-03-21 18:46 ` Maxime Devos
2022-03-21 20:59   ` Paul Alesius
2023-02-09 13:18     ` bug#54509: " Maxim Cournoyer
2022-06-29 22:57 ` [bug#54509] bump: make rust-cargo understand rust-edition2021 which rustc already does Mekeor Melire
2022-06-30  8:10   ` Maxime Devos
2022-07-01 21:48     ` Mekeor Melire [this message]
2022-07-02 11:27       ` Tobias Geerinckx-Rice via Guix-patches via
2022-07-02 11:35         ` Tobias Geerinckx-Rice via Guix-patches via
2022-07-06 14:06           ` Mekeor Melire

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=87sfnk4e3j.fsf@posteo.de \
    --to=mekeor@posteo.de \
    --cc=54509@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).