Skip to content

Implement [Replace] for rust-crypto#147

Merged
plietar merged 1 commit intomasterfrom
replace
Feb 12, 2018
Merged

Implement [Replace] for rust-crypto#147
plietar merged 1 commit intomasterfrom
replace

Conversation

@sashahilton00
Copy link
Copy Markdown
Member

@sashahilton00 sashahilton00 commented Feb 12, 2018

Option 5 from #128, usea replace tag to switch to avx2 branch from awmath/rust-crypto. Closes #128

Comment thread Cargo.toml
rand = "0.3.13"
rpassword = "0.3.0"
rust-crypto = { git = "https://github.com/awmath/rust-crypto.git", branch = "avx2" }
rust-crypto = "0.2.36"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be done in every crate, eg core/Cargo.toml.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slipped my mind, will do that now.

Comment thread audio/Cargo.toml Outdated
tremor = { git = "https://github.com/plietar/rust-tremor", optional = true }
vorbis = { version ="0.1.0", optional = true }

[replace]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should only be at the root though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so [replace] propagates to dependencies?

@sashahilton00
Copy link
Copy Markdown
Member Author

Fixed up the history, let me know if anything else needs adjusting.

@awiouy
Copy link
Copy Markdown
Collaborator

awiouy commented Feb 12, 2018

Should there not be a [replace] statement in every Cargo.toml?

@sashahilton00
Copy link
Copy Markdown
Member Author

Originally I had that, but Paul says it's only necessary in the root Cargo.toml, presumably it propagates

@plietar
Copy link
Copy Markdown
Contributor

plietar commented Feb 12, 2018

From https://doc.rust-lang.org/cargo/reference/manifest.html#the-workspace-section

The [patch] and [replace] sections in Cargo.toml are only recognized in the root crate's manifest, and ignored in member crates' manifests.

@plietar plietar merged commit 0cf11da into master Feb 12, 2018
@sashahilton00 sashahilton00 deleted the replace branch February 12, 2018 14:57
@michaelherger
Copy link
Copy Markdown
Contributor

As I'm using librespot as a library for my own application, would I have to add the [replace] section to my own project's Cargo.toml, though I don't use it in there directly?

@plietar
Copy link
Copy Markdown
Contributor

plietar commented Feb 12, 2018

@michaelherger I think so. You can try with and without the [replace] section and see which version of rust-crypto cargo is building.

If the section is correctly defined you should get:

Compiling rust-crypto v0.2.36 (https://github.com/awmath/rust-crypto.git?branch=avx2#394c2472)

Otherwise you just get

Compiling rust-crypto v0.2.36

@michaelherger
Copy link
Copy Markdown
Contributor

Interesting: it's compiling the avx2 branch, without any modification on my end. I'll keep this in mind. Just in case there were unexpected issues. Thanks!

paulfariello pushed a commit to paulfariello/librespot that referenced this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants