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

Prereleases cannot be selected #2337

Closed
nox opened this issue Jan 30, 2016 · 8 comments
Closed

Prereleases cannot be selected #2337

nox opened this issue Jan 30, 2016 · 8 comments

Comments

@nox
Copy link
Contributor

nox commented Jan 30, 2016

I can't currently use expat-sys 2.1.1-really.0 from anywhere.

version required: = 2.1.1-really.0
versions found: 2.1.0
@SimonSapin
Copy link
Contributor

It was fine when I first published that version, I don’t know what changed. @nox, what’s cargo --version for this error message?

@nox
Copy link
Contributor Author

nox commented Jan 30, 2016

± cargo --version
cargo 0.7.0-nightly (1af03be 2015-12-08)

@nox
Copy link
Contributor Author

nox commented Jan 30, 2016

I think I am hit by brson/multirust#121 too, so maybe it's fixed in the latest nightly but I can't confirm right now.

@nox
Copy link
Contributor Author

nox commented Jan 30, 2016

± cargo --version
cargo 0.9.0-nightly (6ffd134 2016-01-26)

± cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating registry `https://github.com/rust-lang/crates.io-index`
no matching package named `expat-sys` found (required by `servo-skia`)
location searched: registry https://github.com/rust-lang/crates.io-index
version required: ^2.1.1-really.0
versions found: 2.1.0

@alexcrichton
Copy link
Member

cc @steveklabnik, perhaps a semver issue?

@steveklabnik
Copy link
Member

    // https://docs.npmjs.com/misc/semver#prerelease-tags
    fn pre_tag_is_compatible(&self, ver: &Version) -> bool {
        // If a version has a prerelease tag (for example, 1.2.3-alpha.3) then it will only be
        // allowed to satisfy comparator sets if at least one comparator with the same [major,
        // minor, patch] tuple also has a prerelease tag.
        !ver.is_prerelease() || (self.major == ver.major &&
                                 self.minor == Some(ver.minor) &&
                                 self.patch == Some(ver.patch) &&
                                 !self.pre.is_empty())
    }

That said, the really version is now yanked, so I don't have an easy way to check that this still happens. I tried to write a test locally, but ran into https://github.com/alexcrichton/git2-rs/issues/100

@alexcrichton
Copy link
Member

When added to Cargo's test suite, this failed for me:

test!(use_semver {                                        
    let p = project("foo")                                
        .file("Cargo.toml", r#"                           
            [project]                                     
            name = "bar"                                  
            version = "0.5.0"                             
            authors = []                                  

            [dependencies]                                
            foo = "1.2.3-alpha.0"                         
        "#)                                               
        .file("src/main.rs", "fn main() {}");             
    p.build();                                            

    Package::new("foo", "1.2.3-alpha.0").publish();       

    assert_that(p.cargo("build"), execs().with_status(0));
});                                                       

@steveklabnik
Copy link
Member

Yes, this is a bug in Semver: dtolnay/semver#73

I'll see what I can do

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

No branches or pull requests

4 participants