Is it still worth splitting CLI subcommands into crates?

オープン
#678 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
静か
技術スタック
rust
領域
cli

調査の方向性

Review the cmd/ crate layout and the history of pull requests #50 and #666 first. Compare the current build-time rationale with the complexity introduced by the split, then decide whether to consolidate the crates or document the rationale in the top-level README or cmd/README. Done means the preferred direction and its scope are recorded clearly.

索引モデルが issue の本文から書いたものです。

説明

In https://github.com/oxidecomputer/humility/pull/50, the cmd/ subfolder was split into many crates to aid with build times. Helpful commit message:

commit 93715f6819e754524cca68d62184442be387b17a
Author: Bryan Cantrill
Date:   Thu Dec 2 00:59:16 2021 -0800

    refactor commands in terms of crates (#50)
    
    This work refactors Humility commands to each be in their own crate
    (which in turn necessitated moving debugger functionality in its own
    crates that debugger command crates can then depend upon).  The reason
    to do this is severalfold, but the most immediately pressing concern
    is build times:  prior to this work, an empty change to a command
    would result in a build time of over 35 seconds on an 8-core Intel
    Core i7 (!); after this work, the same empty change results in a build
    time of 6 seconds.

Since then, there have been some improvements to parallelizing compilation, as well as incremental builds. The existence of multiple crates leads to a somewhat unfortunate amount of duck-typing in service of codegen purposes, c.f. https://github.com/oxidecomputer/humility/pull/666, so it might be nice to return these to a single crate where we could use a much simpler decl macro or such to generate the top level subcommand enum.

If we find that the split is still worth the compile time improvements, we might want to capture this explanation in either the top level README, or in a README in cmd/, to satisfy curious developers like myself who wonder "why is this like this".

主要言語
Rust
スター
589
フォーク
66
平均マージ
1日 2時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oxidecomputer/humility のほかの issue

oxidecomputer/humility の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。