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

published indexmap 1.3.1 has broken Cargo.toml #116

Closed
kentfredric opened this issue Feb 5, 2020 · 5 comments · Fixed by #117
Closed

published indexmap 1.3.1 has broken Cargo.toml #116

kentfredric opened this issue Feb 5, 2020 · 5 comments · Fixed by #117

Comments

@kentfredric
Copy link

1.3.1 seems to not be shipped with a Cargo.toml generated by cargo package, which is what is expected from running cargo publish

Here's the diff from 1.3.0 to 1.3.1:

diff 1.3.0/Cargo.toml 1.3.1/Cargo.toml
diff --git a/Cargo.toml b/Cargo.toml
index 7b4e98d..166a7f8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,66 +1,65 @@
-# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
-#
-# When uploading crates to the registry Cargo will automatically
-# "normalize" Cargo.toml files for maximal compatibility
-# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
-#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
-
 [package]
 name = "indexmap"
-version = "1.3.0"
-authors = ["bluss", "Josh Stone <cuviper@gmail.com>"]
-build = "build.rs"
-description = "A hash table with consistent order and fast iteration.\n\nThe indexmap is a hash table where the iteration order of the key-value\npairs is independent of the hash values of the keys. It has the usual\nhash table functionality, it preserves insertion order except after\nremovals, and it allows lookup of its elements by either hash table key\nor numerical index. A corresponding hash set type is also provided.\n\nThis crate was initially published under the name ordermap, but it was renamed to\nindexmap.\n"
+version = "1.3.1"
+authors = [
+"bluss",
+"Josh Stone <cuviper@gmail.com>"
+]
 documentation = "https://docs.rs/indexmap/"
+repository = "https://github.com/bluss/indexmap"
+license = "Apache-2.0/MIT"
+description = """
+A hash table with consistent order and fast iteration.
+
+The indexmap is a hash table where the iteration order of the key-value
+pairs is independent of the hash values of the keys. It has the usual
+hash table functionality, it preserves insertion order except after
+removals, and it allows lookup of its elements by either hash table key
+or numerical index. A corresponding hash set type is also provided.
+
+This crate was initially published under the name ordermap, but it was renamed to
+indexmap.
+"""
+
 keywords = ["hashmap", "no_std"]
 categories = ["data-structures", "no-std"]
-license = "Apache-2.0/MIT"
-repository = "https://github.com/bluss/indexmap"
-[package.metadata.docs.rs]
-features = ["serde-1", "rayon"]
 
-[package.metadata.release]
-no-dev-version = true
-tag-name = "{{version}}"
-[profile.bench]
-debug = true
+build = "build.rs"
 
 [lib]
 bench = false
-[dependencies.rayon]
-version = "1.0"
-optional = true
 
-[dependencies.serde]
-version = "1.0"
-optional = true
-[dev-dependencies.fnv]
-version = "1.0"
+[build-dependencies]
+autocfg = "1"
+[dependencies]
+serde = { version = "1.0", optional = true }
+rayon = { version = "1.0", optional = true }
 
-[dev-dependencies.itertools]
-version = "0.8"
+[dev-dependencies]
+itertools = "0.8"
+rand = "0.6"
+quickcheck = { version = "0.8", default-features = false }
+fnv = "1.0"
+lazy_static = "1.3"
+serde_test = "1.0.99"
 
-[dev-dependencies.lazy_static]
-version = "1.3"
+[features]
+# Serialization with serde 1.0
+serde-1 = ["serde"]
+
+# for testing only, of course
+test_low_transition_point = []
+test_debug = []
 
-[dev-dependencies.quickcheck]
-version = "0.8"
-default-features = false
+[profile.bench]
+debug = true
 
-[dev-dependencies.rand]
-version = "0.6"
+[package.metadata.release]
+no-dev-version = true
+tag-name = "{{version}}"
 
-[dev-dependencies.serde_test]
-version = "1.0.99"
-[build-dependencies.autocfg]
-version = "0.1.6"
+[package.metadata.docs.rs]
+features = ["serde-1", "rayon"]
 
-[features]
-serde-1 = ["serde"]
-test_debug = []
-test_low_transition_point = []
+[workspace]
+members = ["test-nostd"]

Additionally, unlike 1.3.0, which works fine with the cargo-generated Cargo.toml

1.3.0 cargo test success
cargo test
    Updating crates.io index
  Downloaded autocfg v0.1.7
  Downloaded serde_test v1.0.104
  Downloaded rand v0.6.5
  Downloaded quickcheck v0.8.5
  Downloaded itertools v0.8.2
  Downloaded serde v1.0.104
  Downloaded rand_jitter v0.1.4
  Downloaded rand_pcg v0.1.2
  Downloaded rand_xorshift v0.1.1
  Downloaded rand_hc v0.1.0
  Downloaded rand_os v0.1.3
  Downloaded rand_chacha v0.1.1
  Downloaded rand_isaac v0.1.1
  Downloaded either v1.5.3
   Compiling autocfg v0.1.7
   Compiling rand_core v0.4.2
   Compiling libc v0.2.66
   Compiling serde v1.0.104
   Compiling either v1.5.3
   Compiling lazy_static v1.4.0
   Compiling fnv v1.0.6
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling itertools v0.8.2
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand v0.6.5
   Compiling indexmap v1.3.0 (/home/kent/.cpanm/work/1580894972.28404/indexmap-1.3.1)
   Compiling rand_xorshift v0.1.1
   Compiling rand_hc v0.1.0
   Compiling rand_isaac v0.1.1
   Compiling rand_os v0.1.3
   Compiling quickcheck v0.8.5
   Compiling serde_test v1.0.104
    Finished test [unoptimized + debuginfo] target(s) in 47.28s
     Running target/debug/deps/indexmap-af6a4872f48a66f7

running 33 tests
test map::tests::entry_or_default ... ok
test map::tests::entry ... ok
test map::tests::entry_and_modify ... ok
test map::tests::extend ... ok
test map::tests::insert ... ok
test map::tests::insert_full ... ok
test map::tests::grow ... ok
test map::tests::it_works ... ok
test map::tests::insert_order ... ok
test map::tests::keys ... ok
test map::tests::new ... ok
test map::tests::partial_eq_and_eq ... ok
test map::tests::remove_to_empty ... ok
test map::tests::remove ... ok
test map::tests::values ... ok
test map::tests::values_mut ... ok
test map::tests::swap_remove_index ... ok
test set::tests::comparisons ... ok
test set::tests::extend ... ok
test set::tests::insert ... ok
test set::tests::grow ... ok
test set::tests::insert_dup ... ok
test set::tests::insert_full ... ok
test set::tests::insert_order ... ok
test set::tests::it_works ... ok
test set::tests::iter_comparisons ... ok
test set::tests::new ... ok
test set::tests::partial_eq_and_eq ... ok
test set::tests::remove ... ok
test set::tests::ops ... ok
test set::tests::swap_remove_index ... ok
test map::tests::insert_2 ... ok
test set::tests::insert_2 ... ok

test result: ok. 33 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/equivalent_trait-1769a2528452c354

running 2 tests
test test_lookup ... ok
test test_string_str ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/macros_full_path-e6fdf8b9bff872b5

running 2 tests
test test_create_map ... ok
test test_create_set ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/quick-711278843a6d10b5

running 16 tests
test drain ... ok
test contains ... ok
test equality ... ok
test contains_not ... ok
test insertion_order ... ok
test insert_remove ... ok
test operations_string ... ok
test pop ... ok
test keys_values ... ok
test operations_i8 ... ok
test keys_values_mut ... ok
test shift_remove ... ok
test with_cap ... ok
test sort_2 ... ok
test sort_1 ... ok
test retain_ordered ... ok

test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/serde-406ea1513b9cfc01

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/tests-f4d162c97b6224f6

running 2 tests
test test_sort ... ok
test test_sort_set ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests indexmap

running 4 tests
test src/set.rs - set::IndexSet (line 55) ... ok
test src/macros.rs - indexset (line 47) ... ok
test src/map.rs - map::IndexMap (line 259) ... ok
test src/macros.rs - indexmap (line 8) ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

1.3.1 is broken for all cargo commands:

1.3.1 breakage
> cargo build
error: failed to read `/home/kent/.cpanm/work/1580894972.28404/indexmap-1.3.1/test-nostd/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

> cargo test
error: failed to read `/home/kent/.cpanm/work/1580894972.28404/indexmap-1.3.1/test-nostd/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

 > cargo package
error: failed to read `/home/kent/.cpanm/work/1580894972.28404/indexmap-1.3.1/test-nostd/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

> cargo update
error: failed to read `/home/kent/.cpanm/work/1580894972.28404/indexmap-1.3.1/test-nostd/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

This seems like a pretty serious regression, and is likely to be a substantial impediment to all linux vendors packaging rust.

@cuviper
Copy link
Member

cuviper commented Feb 5, 2020

I just used the MSRV (1.18) cargo when publishing 1.3.1, which doesn't rewrite Cargo.toml -- that was introduced in rust-lang/cargo#4030, cargo 0.20.0 (Rust 1.19).

This seems like a pretty serious regression, and is likely to be a substantial impediment to all linux vendors packaging rust.

I think you're overstating the severity. The crates.io package is not broken when used as a normal dependency, and the missing workspace only matters when you try to use it as a primary source. I happen to be a Fedora packager too, and I just patched it out there:
https://src.fedoraproject.org/rpms/rust-indexmap/blob/314395ffa87c370a0ef2bdcc41e7ebddc034beff/f/indexmap-fix-metadata.diff#_18

As a linux vendor, you should already be prepared to make such changes for any crate that was packaged before Cargo.toml rewriting started.

Still, I will make a new release...

@kentfredric
Copy link
Author

I think you're overstating the severity.

Indeed, after filing the bug I found it was easier to patch out than I'd anticipated.

Though thanks for making a new release anyway, where possible, we desire to follow upstream with as few patches as possible :)

@bluss
Copy link
Member

bluss commented Apr 12, 2020

I just used the MSRV (1.18) cargo when publishing 1.3.1,

@cuviper Is it important to package like this? Just curious why you've included this in your process.

@cuviper
Copy link
Member

cuviper commented Apr 13, 2020

I feel wary of publishing with newer Cargo than MSRV, in case its Cargo.toml rewriting ever does something that's not supported by older Cargo. However, I'm not aware of any such problems yet.

@kentfredric
Copy link
Author

I feel wary of publishing with newer Cargo than MSRV, in case its Cargo.toml rewriting ever does something that's not supported by older Cargo. However, I'm not aware of any such problems yet.

Only problem I'm aware of is the new Cargo.lock layout getting shipped, which doesn't parse with older cargo, but you'll only have that if you ship examples or binaries.

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.

3 participants