du: adding ./ to the operand silently defeats --exclude=target/debug

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

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

@costajohnt がすでに取り組んでいます。

2026年11月18日 から。

  • #16699 @costajohnt による — オープン
  • #16701 @nishant9144 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust
領域
cli, testing

調査の方向性

Read the traversal in src/uu/du/src/du.rs around lines 563–567 and the existing test_du_exclude_several_components fixture. Run that test with the ./a operand case described in the issue and compare the result with the reported du -bs --exclude=target/debug behavior. Done means the excluded target/debug subtree stays excluded when the operand is ./, and the regression is covered by a test.

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

説明

U - du

A size check run from a project root counts the build artifacts it explicitly excludes. Even target and ./target give different totals for the same directory.

(
  cd "$(mktemp -d)" || exit 1
  export LC_ALL=C
  mkdir -p target/debug docs/debug
  head -c 1048576 /dev/zero > target/debug/app
  printf 'keep\n' > docs/debug/guide
  for dir in . target ./target; do
    du -bs --exclude=target/debug "$dir"
  done
)
Operand uutils GNU 9.12
. 1048581 5
target 0 0
./target 1048576 0

All commands exit 0 with empty stderr. Reproduced on Linux x86_64 with uutils 0.12.0 and main at 293a724. With du -a --exclude=target/debug ., uutils also lists ./target/debug/app. The five-byte docs/debug/guide should be counted in the project total.

The traversal checks the full path (./target/debug) and the basename (debug), missing the matching suffix target/debug. The existing test_du_exclude_several_components covers an exact full-path match. Running its fixture again with ./a would exercise this case.

主要言語
Rust
スター
24.4k
フォーク
2.2k
平均マージ
2日 23時間
マージ済み PR(30日)
402

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

uutils/coreutils のほかの issue

uutils/coreutils の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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