Skip to content

uucore: put more deps behind feature flags (for nushell) #5202

Closed

Description

@tertsdiepraam

Context: nushell/nushell#10097 (comment)

uucore is quite modular in that large parts can be enabled or disabled via features. However, this does go far enough yet. There are many modules in the mods folder, that should be put behind feature flags.

This would make it so that uucore becomes smaller and faster to compile when only compiling a subset of utils. This is of particular interest for nushell, where we are introducing just a single util (cp), but have to include the entirety of uucore.

Fixing this should not be too hard. However, we should pay special attention to verify that every util still compiles on its own. That is, that they individually enable all the features they need. Every util should compile like this:

cargo build --no-default-features --features {util}

Ideally, we would also test this in the CI. See also #4032

PS: Ultimately, I think uucore should be split into multiple crates, but that's an issue for another time. If we make it more modular now, we can also more easily split it up in the future.

Activity

  1. changed the title [-]`uucore`: put more deps behind feature flags[/-] [+]`uucore`: put more deps behind feature flags (for nushell)[/+] on Aug 24, 2023
  2. cakebaker commented on Sep 20, 2023

    @cakebaker
    Contributor

    Is there more work necessary for this ticket to be considered as "done" or can I close it?

  3. sylvestre commented on Sep 20, 2023

    @sylvestre
    SponsorContributor

    is it possible to add a check in the CI to make sure we don't regress?

  4. cakebaker commented on Sep 20, 2023

    @cakebaker
    Contributor

    @sylvestre there's #4032 or do you mean something else?

  5. tertsdiepraam commented on Sep 20, 2023

    @tertsdiepraam
    CollaboratorAuthor

    @cakebaker I'm happy with this! The only thing "missing" is that clap is still required, but that is a larger issue and covered by the "compile cp without clap" issue. 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