Skip to content
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

Disccuss: Regex and once_cell with high version might cause compatibility issues #190

Closed
Apokleos opened this issue Jul 12, 2024 · 12 comments · Fixed by #191
Closed

Disccuss: Regex and once_cell with high version might cause compatibility issues #190

Apokleos opened this issue Jul 12, 2024 · 12 comments · Fixed by #191

Comments

@Apokleos
Copy link
Contributor

Apokleos commented Jul 12, 2024

Hi @saschagrunert @utam0k
I am working migrate the oci-spec-rs latest version to my project. and encounted compatibility issues then I analysis it and found that regex and once_cell are the root cause.

I noticed that there's a PR#178 which introduces ExecAffinityCPU into oci-spec-rs, actually great work!

I want to talk about whether we need such high version regex and once_cell, as some projects depending on oci-spec-rs might not introduce such high version regex and once_cell.

Thx

@keisku keisku mentioned this issue Jul 12, 2024
@keisku
Copy link
Contributor

keisku commented Jul 12, 2024

FYI: 73c9740 doesn't require regex and once_cell dependencies. We didn't apply this way because of this benchmark result.

@Apokleos
Copy link
Contributor Author

FYI: 73c9740 doesn't require regex and once_cell dependencies. We didn't apply this way because of this benchmark result.

Hi @Keisu Thx for your reply.
I found the regex and once_cell introduced in Cargo.toml

@Apokleos
Copy link
Contributor Author

FYI: 73c9740 doesn't require regex and once_cell dependencies. We didn't apply this way because of this benchmark result.

If I understand it correctly, the regex and once_cell should be not in the Cargo.toml, right ?

@Apokleos
Copy link
Contributor Author

Hi @keisku @saschagrunert @utam0k FYI! thx

@utam0k
Copy link
Member

utam0k commented Jul 14, 2024

If I understand it correctly, the regex and once_cell should be not in the Cargo.toml, right ?

Why so? Since we don't need the specific and latest regex and once_cell, how about we specify the minimal versions we need in Cargo.toml instead of them?
https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements

@Apokleos
Copy link
Contributor Author

If I understand it correctly, the regex and once_cell should be not in the Cargo.toml, right ?

Why so? Since we don't need the specific and latest regex and once_cell, how about we specify the minimal versions we need in Cargo.toml instead of them? https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements

Thx @utam0k for your reply. and sorry for misunderstand of it. And have a deep learn about the PR with many commits, I got that
the commits: introducing regex and introducing once_cell and then in this commit avoid using regex and once_cell and then in this commit do revert to keep origin idea of introducing regex and once_cell. So regex and once_cell introduced, right ?

@Apokleos
Copy link
Contributor Author

@utam0k

If I understand it correctly, the regex and once_cell should be not in the Cargo.toml, right ?

how about we specify the minimal versions we need in Cargo.toml instead of them? https://doc.rust-> lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements

Yeah, good idea. SGTM!

@utam0k
Copy link
Member

utam0k commented Jul 15, 2024

Thx @utam0k for your reply. and sorry for misunderstand of it. And have a deep learn about the PR with many commits, I got that
the commits: introducing regex and introducing once_cell and then in this commit avoid using regex and once_cell and then in this commit do revert to keep origin idea of introducing regex and once_cell. So regex and once_cell introduced, right ?

Oh, I see. This is certainly misleading.

Yeah, good idea. SGTM!

Do you have a chance to contribute to it? If not, I'll be looking for those who are interested in first-contributing to oci-spec-rs.

@Apokleos
Copy link
Contributor Author

Thx @utam0k for your reply. and sorry for misunderstand of it. And have a deep learn about the PR with many commits, I got that
the commits: introducing regex and introducing once_cell and then in this commit avoid using regex and once_cell and then in this commit do revert to keep origin idea of introducing regex and once_cell. So regex and once_cell introduced, right ?

Oh, I see. This is certainly misleading.

Yeah, good idea. SGTM!

Do you have a chance to contribute to it? If not, I'll be looking for those who are interested in first-contributing to oci-spec-rs.

Yeah, appreciated! I will enhance it with your suggest no later than tomorrow, is that Ok?

@utam0k
Copy link
Member

utam0k commented Jul 15, 2024

Yeah, appreciated! I will enhance it with your suggest no later than tomorrow, is that Ok?

Sure. But I'm going to be unavailable for the next couple of days.

Apokleos added a commit to Apokleos/oci-spec-rs that referenced this issue Jul 15, 2024
Specify a minimal version for regex and once_cell with
some ability to update and enhance compatibility for
other projects which depends on these crates.

Fixes containers#190

Signed-off-by: Alex Lyn <[email protected]>
@Apokleos
Copy link
Contributor Author

Yeah, appreciated! I will enhance it with your suggest no later than tomorrow, is that Ok?

Sure. But I'm going to be unavailable for the next couple of days.

Ok, I first handle this issue before you are unavalible.

@kpcyrd
Copy link

kpcyrd commented Sep 30, 2024

The current workaround breaks cargo outdated -R:

% cargo outdated -R
error: failed to select a version for `regex`.
    ... required by package `oci-spec v0.7.0`
    ... which satisfies dependency `oci-spec = "^0.7.0"` of package `sh4d0wup v0.9.3 (/tmp/cargo-outdatedYX4PxY)`
versions that meet the requirements `~1.10.5` are: 1.10.6, 1.10.5

all possible versions conflict with previously selected packages.

  previously selected package `regex v1.11.0`
    ... which satisfies dependency `regex = "^1.11.0"` of package `sh4d0wup v0.9.3 (/tmp/cargo-outdatedYX4PxY)`

failed to select a version for `regex` which could resolve this conflict

Changing from oci-spec 0.6 to 0.7 forces a downgrade of the regex crate in my project:

% cargo update
    Updating crates.io index
     Locking 2 packages to latest compatible versions
    Updating oci-spec v0.6.7 -> v0.7.0
 Downgrading regex v1.11.0 -> v1.10.6 (latest: v1.11.0)
note: pass `--verbose` to see 72 unchanged dependencies behind latest

Please do not use the tilde operator like this, specify the minimum version you want to require (or simply 1) without any prefix and cargo is going to select a semver compatible version for you automatically.

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 a pull request may close this issue.

4 participants