Skip to content

Dont start #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AveNRU opened this issue Apr 3, 2025 · 14 comments
Closed

Dont start #332

AveNRU opened this issue Apr 3, 2025 · 14 comments
Labels
bug Something isn't working

Comments

@AveNRU
Copy link

AveNRU commented Apr 3, 2025

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> C:\Users\AveN.cargo\registry\src\index.crates.io-6f17d22bba15001f\calamine-0.26.1\src\xlsb\mod.rs:603:18
|
603 | r: BufReader<ZipFile<'a>>,
| ^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: R
--> C:\Users\AveN.cargo\registry\src\index.crates.io-6f17d22bba15001f\zip-2.6.0\src\read.rs:252:12
|
252 | pub struct ZipFile<'a, R: Read> {
| ^^^^^^^ -
help: add missing generic argument
|
603 | r: BufReader<ZipFile<'a, R>>,
| +++

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> C:\Users\AveN.cargo\registry\src\index.crates.io-6f17d22bba15001f\calamine-0.26.1\src\xlsx\mod.rs:26:52
|
26 | pub(crate) type XlReader<'a> = XmlReader<BufReader<ZipFile<'a>>>;
| ^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: R
--> C:\Users\AveN.cargo\registry\src\index.crates.io-6f17d22bba15001f\zip-2.6.0\src\read.rs:252:12
|
252 | pub struct ZipFile<'a, R: Read> {
| ^^^^^^^ -
help: add missing generic argument
|
26 | pub(crate) type XlReader<'a> = XmlReader<BufReader<ZipFile<'a, R>>>;
| +++

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> C:\Users\AveN.cargo\registry\src\index.crates.io-6f17d22bba15001f\calamine-0.26.1\src\ods.rs:24:42
|
24 | type OdsReader<'a> = XmlReader<BufReader<ZipFile<'a>>>;
| ^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: R
--> C:\Users\AveN.cargo\registry\src\index.crates.io-6f17d22bba15001f\zip-2.6.0\src\read.rs:252:12
|
252 | pub struct ZipFile<'a, R: Read> {
| ^^^^^^^ -
help: add missing generic argument
|
24 | type OdsReader<'a> = XmlReader<BufReader<ZipFile<'a, R>>>;
| +++

For more information about this error, try rustc --explain E0107.

Rust 1.75.0 Windows 7

[package]
name = "Powerscript"
version = "0.1.0"
edition = "2021"

[dependencies]
lazy_static = "1.4.0"
regex = "1.11.1"
calamine = "0.26.1"
rust_xlsxwriter = "0.85.0"
encoding_rs = "0.8.35"
encoding_rs_io = "0.1.7"
csv = "=1.3.1"
csv2xlsx = "0.3.0"
rust_decimal = "1.36.0"
rust_decimal_macros = "1.36.0"

@AveNRU AveNRU added the bug Something isn't working label Apr 3, 2025
@AveNRU
Copy link
Author

AveNRU commented Apr 3, 2025

Windows 10
Rust 1.85.1

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> C:\Users\AveN.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\calamine-0.26.1\src\xlsb\mod.rs:603:18
|
603 | r: BufReader<ZipFile<'a>>,
| ^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: R
--> C:\Users\AveN.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\zip-2.6.0\src\read.rs:252:12
|
252 | pub struct ZipFile<'a, R: Read> {
| ^^^^^^^ -
help: add missing generic argument
|
603 | r: BufReader<ZipFile<'a, R>>,
| +++

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> C:\Users\AveN.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\calamine-0.26.1\src\xlsx\mod.rs:26:52
|
26 | pub(crate) type XlReader<'a> = XmlReader<BufReader<ZipFile<'a>>>;
| ^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: R
--> C:\Users\AveN.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\zip-2.6.0\src\read.rs:252:12
|
252 | pub struct ZipFile<'a, R: Read> {
| ^^^^^^^ -
help: add missing generic argument
|
26 | pub(crate) type XlReader<'a> = XmlReader<BufReader<ZipFile<'a, R>>>;
| +++

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> C:\Users\AveN.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\calamine-0.26.1\src\ods.rs:24:42
|
24 | type OdsReader<'a> = XmlReader<BufReader<ZipFile<'a>>>;
| ^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: R
--> C:\Users\AveN.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\zip-2.6.0\src\read.rs:252:12
|
252 | pub struct ZipFile<'a, R: Read> {
| ^^^^^^^ -
help: add missing generic argument
|
24 | type OdsReader<'a> = XmlReader<BufReader<ZipFile<'a, R>>>;
| +++

For more information about this error, try rustc --explain E0107.
error: could not compile calamine (lib) due to 3 previous errors

@sbruton
Copy link

sbruton commented Apr 3, 2025

Yep, adding those generics is a breaking change

@itaysmalia
Copy link

itaysmalia commented Apr 3, 2025

As a workaround I've added this crate to my Cargo.toml dependencies section and pinned its version to 2.5.0

zip = "2.5.0"

EDIT: doesn't really work for deps of deps, can't find a solution 😕

@AveNRU
Copy link
Author

AveNRU commented Apr 3, 2025

As a workaround I've added this crate to my Cargo.toml dependencies section and pinned its version to 2.5.0

zip = "2.5.0"

On windows 7 this variant is not working

@ddimaria
Copy link

ddimaria commented Apr 3, 2025

We're seeing this issue in a dependency of a dependency who is fixed to the major version:

zip = { version = "2" }

I would expect this breaking change for Zip2 to be v3.0.0

@itaysmalia
Copy link

itaysmalia commented Apr 3, 2025

Workaround suggestion:

  1. clone zip2 before breaking changes:
git clone -b v2.5.0 https://github.com/zip-rs/zip2
  1. change the version in its cargo.toml to 2.6.0 (edit "./zip2/Cargo.toml")
  2. use the [replace] section in your cargo toml to include:
[replace]
"zip:2.6.0" = { path = "./zip2" }

@ddimaria
Copy link

ddimaria commented Apr 3, 2025

This worked for us:

[patch.crates-io]
zip = { git = "https://github.com/zip-rs/zip2", rev = "77cde6a" }

[patch.'https://github.com/zip-rs/zip2']
zip = { git = "https://github.com//zip-rs/zip2", rev = "77cde6a" }

note the extra / in the bottom URL. Thanks Omar S. Navarro Leija to for that.

astraw added a commit to strawlab/strand-braid that referenced this issue Apr 4, 2025
This works around the semver breakage reported in
zip-rs/zip2#332
@jqnatividad
Copy link

jqnatividad commented Apr 4, 2025

I suggest 2.6.1 be yanked and republished as 3.0.0 per @ddimaria

@AveNRU
Copy link
Author

AveNRU commented Apr 7, 2025

[replace]
"zip:2.6.0" = { path = "./zip2" }

Dont working

@prophittcorey
Copy link

@AveNRU this may help,

cargo update -p zip --precise 2.5.0

However, if you do a cargo update you will have to replace the zip version with 2.5.0 again.

@JonesRusty
Copy link

This worked for us:

[patch.crates-io]
zip = { git = "https://github.com/zip-rs/zip2", rev = "77cde6a" }

[patch.'https://github.com/zip-rs/zip2']
zip = { git = "https://github.com//zip-rs/zip2", rev = "77cde6a" }
note the extra / in the bottom URL. Thanks Omar S. Navarro Leija to for that.

Maybe I am doing it wrong but this didn't work for me on windows.

I added this to my rust project that is using calamine.

Do I need to clone calamine itself and add these lines to the calamine build and then link to my local build?

@ddimaria
Copy link

Maybe I am doing it wrong but this didn't work for me on windows.

I added this to my rust project that is using calamine.

Do I need to clone calamine itself and add these lines to the calamine build and then link to my local build?

This approach doesn't require a clone of calamine. This worked on mac and linux, but I would expect windows would work as well. You might try deleting your lock file and/or doing a cargo clean.

@simnalamburt
Copy link

For those who might be experiencing build issues, here’s a summary of possible workarounds:

1. Temporary solution

For now, doing the following fixes it:

$ cargo update -p zip --precise 2.5.0

But it'll break again if you run cargo update later.

2. Patch dependency version

# Cargo.toml
[patch.crates-io]
zip = { git = "https://github.com/zip-rs/zip2", tag = "v2.5.0" }

Due to a limitation in Cargo (rust-lang/cargo#5478), we unfortunately can’t use the crates.io index when changing dependency versions. As a result, we had to use the git protocol.

3. Patch dependency version (registry)

For those who prefer not to use the git:// protocol:

# Cargo.toml
[patch.crates-io]
zip = { version = "=2.5.0", registry = "crates-io-2" }
# .cargo/config.toml
[registries]
crates-io-2 = { index = "sparse+https://index.crates.io/" }
# Required due to https://github.com/rust-lang/cargo/issues/5478

This can lead to the same sub-dependency being downloaded from both crates-io and crates-io-2. It’s not a major issue to download the same dependency twice, but just be aware of it.

@Pr0methean
Copy link
Member

Fixed in 3.0.0 by the version bump, and versions 2.6.0 and 2.6.1 are now yanked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants