Skip to content

Some crates in the crates.io index have invalid json #1168

Closed
@est31

Description

@est31

I'm trying to parse the crates.io index using the serde and json crates. As we have a specification now, I know what I can require! I've created some structs and am iterating over the directory hierarchy, parsing every single file.

Now I have encountered some crates where the crates.io index violates that specification.

There are 100 older (read: 2014) crates that inside their dependencies list are either lacking a "kind" attribute, or have it set to null. (the only crate where kind is set to null is rope, due to being yanked).

Click to expand the list of affected crates
"unicode_names_macros"
"tempan"
"pipes"
"pidfile"
"plugin"
"uchardet-sys"
"uchardet"
"julius"
"openssl-sys"
"opentype"
"openssl2-sys"
"leveldb"
"tgff"
"vorbisfile-sys"
"vorbis-sys"
"glium"
"gl_generator"
"glutin"
"lazy"
"lapack"
"rope"
"ogg-sys"
"epsilonz"
"matrix"
"email"
"hotspot"
"miniz-sys"
"redis"
"resources_package"
"rethinkdb"
"basehangul"
"free"
"fractran_macros"
"chrono"
"docopt_macros"
"date"
"event"
"event-emitter"
"cssparser"
"obj"
"xsv"
"zip"
"mio"
"url"
"utp"
"rusqlite"
"rust-crypto"
"capnp-rpc"
"capnpc"
"probability"
"image"
"git2"
"fingertree"
"diecast"
"blas"
"slow_primes"
"gl"
"enforce"
"encoding-index-tradchinese"
"encoding"
"encoding-index-simpchinese"
"encoding-index-japanese"
"encoding-index-korean"
"encoding-index-singlebyte"
"bzip2-sys"
"bzip2"
"conduit-log-requests"
"conduit-middleware"
"conduit-utils"
"conduit-conditional-get"
"conduit-router"
"conduit"
"conduit-test"
"conduit-static"
"conduit-json-parser"
"typemap"
"libssh2-sys"
"liblapack-sys"
"libz-sys"
"libgit2-sys"
"libressl-pnacl-sys"
"quickcheck_macros"
"error"
"tiled"
"time"
"civet"
"ssh2"
"stream"
"strided"
"string_telephone"
"sfunc"
"ordered-float"
"flate2"
"monad"
"modifier"
"tailrec"
"tabwriter"
"taskpool"
"fftw3-sys"
"grabbag"

As the index repo doesn't have a bugtracker, I chose to file the bug here. The missing of that attribute seems to be a violation of that specification. If you disagree that this is a violation, I'd really love to see an amendment of the spec that explicitly states that missing or null deps fields are allowed, together with a statement about the value you can assume if the deps field is not set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bug 🐞Category: unintended, undesired behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions