Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Remove duplicate dependencies #1256

Closed
Closed

Description

@jyn514
  • What is the feature or code improvement you would like to do in Cranelift?

Remove duplicate versions of quote, syn, and xid-tools.
As you can see in the dependency tree below, extremely old versions of these are required by packed_struct_codegen.

Dependency tree (generated with `cargo tree -d`):
quote v0.3.15
├── packed_struct_codegen v0.3.0
│   └── cranelift-codegen-shared v0.51.0 (/home/joshua/Documents/Programming/rust/cranelift/c
ranelift-codegen/shared)
...snip...

quote v1.0.2
├── failure_derive v0.1.6
│   ├── failure v0.1.6
│   │   ├── cranelift-faerie v0.51.0 (/home/joshua/Documents/Programming/rust/cranelift/crane
lift-faerie)
...snip...

syn v0.11.11
└── packed_struct_codegen v0.3.0
    └── cranelift-codegen-shared v0.51.0 (/home/joshua/Documents/Programming/rust/cranelift/c
ranelift-codegen/shared)
...snip...

syn v1.0.8
├── failure_derive v0.1.6
│   ├── failure v0.1.6
│   │   ├── cranelift-faerie v0.51.0 (/home/joshua/Documents/Programming/rust/cranelift/cranelift-faerie)
...snip...

unicode-xid v0.0.4
├── syn v0.11.11
│   └── packed_struct_codegen v0.3.0
│       └── cranelift-codegen-shared v0.51.0 (/home/joshua/Documents/Programming/rust/craneli
ft/cranelift-codegen/shared)
...snip...

unicode-xid v0.2.0
├── proc-macro2 v1.0.6
│   ├── failure_derive v0.1.6
│   │   ├── failure v0.1.6
│   │   │   ├── cranelift-faerie v0.51.0 (/home/joshua/Documents/Programming/rust/cranelift
... snip ...
  • What is the value of adding this in Cranelift?

Reduced compile times. Also removes warnings from rustdoc about duplicated output directories.

  • Do you have an implementation plan?

Unfortunately since there is no version of packed_struct_codegen later than 0.3, there's not an easy way to fix this. Cranelift would probably have to nudge that project or switch to a different library like https://docs.rs/bitflags/.

  • Have you considered alternative implementations? If so, how are they better
    or worse than your proposal?

Cranelift could just leave the duplicates in place. That would be easy to do but also requires 2 versions of syn and quote to be compiled for every newcomer and CI run.

Activity

  1. bnjbvr commented on Dec 2, 2019

    @bnjbvr
    Member

    It's indeed unfortunate to have duplicated dependencies. Any chance we could do this work upstream and have the maintainers bump a new version of this crate?

    cc @sstangl @abrown

  2. abrown commented on Dec 2, 2019

    @abrown
    Member

    I don't think the bitflags library will work in this case so I guess the upstream update is the way to go. We could alternately remove packed_struct altogether since it was an ease-of-use decision for EncodingBits and it seems to cause no_std issues (e.g. #1262)... but I think I would lean towards the upstream update since the use of packed_struct makes the code more explicit and less error-prone. @sstangl, what do you think?

  3. bnjbvr commented on Dec 13, 2019

    @bnjbvr
    Member

    Now that #1282 has landed, we don't use packed_struct anymore, and cargo tree -d doesn't show anything. Closing, but feel free to reopen if I misunderstood anything.

  4. jyn514 commented on Dec 13, 2019

    @jyn514
    ContributorAuthor

    Looks great to me, thanks for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions