Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Call to "get cmdb" on Darwin outside of a task throws bash error

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

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

2026年9月23日 から。

  • #1368 @sdondley による — オープン
  • #1660 @stantheman0128 による — オープン

評価

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

調査の方向性

提供された Rexfile を Darwin 上で使って問題を再現し、その後 lib/Rex/Hardware/Memory.pm の 193 行付近と lib/Rex/Hardware/Swap.pm の 143 行付近を読んでください。タスクの外側と内側での get cmdb() の動作を比較してください。タスクの外側での呼び出しが、繰り返される free: command not found エラーを出力せずに完了すれば完了です。

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

説明

Describe the bug

Following bash message is shown twice on STDERR:

sh: free: command not found

How to reproduce it

Steps to reproduce the behavior:

  1. Add the following code in the main body of a Rexfile outside of a task:

get cmdb()

Shortest code example that demonstrates the bug:

use Rex -feature => [ qw( 1.4 ) ];
get cmdb();

task test => sub {
};

1;

Expected behavior

No error.

Circumstances

  • Rex version: 11
  • Perl version: 5.24.4
  • OS running rex: Darwin (Catalina, 10.15.5)
  • OS managed by rex: Darwin

Other

The error can be hacked around by change commenting out this line in Rex/Hardware/Memory:
https://github.com/RexOps/Rex/blob/master/lib/Rex/Hardware/Memory.pm#L193
and replace with:
$free_str = '';

The same hack needs to be done to the line at: https://github.com/RexOps/Rex/blob/master/lib/Rex/Hardware/Swap.pm#L143

Obviously these are not proper fixes and are provided here to help pinpoint the problem.

Finally, the bug does not occur when get cmdb() is called from inside a task.

主要言語
Perl
スター
736
フォーク
217
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

RexOps/Rex のほかの issue

RexOps/Rex の issue をすべて見る

似ている issue

Perl の issue をもっと見る

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

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