Skip to content

HADOOP-19758. Avoid tput in shell usage formatting when unavailable.#8387

Open
deepujain wants to merge 1 commit intoapache:trunkfrom
deepujain:HADOOP-19758-ncurses-shell
Open

HADOOP-19758. Avoid tput in shell usage formatting when unavailable.#8387
deepujain wants to merge 1 commit intoapache:trunkfrom
deepujain:HADOOP-19758-ncurses-shell

Conversation

@deepujain
Copy link
Copy Markdown
Contributor

Summary
Avoid invoking tput when it is not installed, so Hadoop shell usage formatting works on minimal distros without ncurses.

Change

  • hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh: guard the terminal-width probe with command -v tput and fall back cleanly to the default width.
  • hadoop-common-project/hadoop-common/src/test/scripts/hadoop_subcommands.bats: add a regression for the missing-tput path.

JIRA
Fixes HADOOP-19758

@deepujain
Copy link
Copy Markdown
Contributor Author

Fixed the usage formatter to skip tput when it is unavailable and added a regression for the missing-tput path. I also verified the formatter directly in a PATH without tput, and it prints cleanly now. Ready for review.

@edwardcapriolo
Copy link
Copy Markdown
Contributor

Cool nice job. When i mentioned it I never thought someone else wold fix! I just installed ncurses in my docker.

@deepujain deepujain force-pushed the HADOOP-19758-ncurses-shell branch from 9783550 to e89bead Compare April 21, 2026 18:08
@deepujain
Copy link
Copy Markdown
Contributor Author

Rebased this onto current apache/trunk and force-pushed the refreshed branch. Local validation for the narrow shell change passed by sourcing hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh, simulating a PATH without tput, and verifying hadoop_generic_columnprinter still prints the expected archive-logs usage text without a tput error message. I also confirmed the branch still contains the matching bats regression in hadoop_subcommands.bats.

@hadoop-yetus
Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 7m 16s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 26m 52s trunk passed
+1 💚 mvnsite 1m 8s trunk passed
+1 💚 shadedclient 15m 12s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 42s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 0m 52s the patch passed
+1 💚 shellcheck 0m 3s No new issues.
-1 ❌ shadedclient 2m 38s patch has errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 1m 12s /patch-unit-hadoop-common-project_hadoop-common.txt hadoop-common in the patch failed.
+1 💚 asflicense 0m 20s The patch does not generate ASF License warnings.
58m 10s
Reason Tests
Failed TAP tests hadoop_subcommands.bats.tap
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8387/2/artifact/out/Dockerfile
GITHUB PR #8387
Optional Tests dupname asflicense mvnsite unit codespell detsecrets shellcheck shelldocs
uname Linux 9731dae77d8e 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / e89bead
TAP logs https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8387/2/artifact/out/patch-hadoop-common-project_hadoop-common.tap
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8387/2/testReport/
Max. process+thread count 612 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8387/2/console
versions git=2.43.0 maven=3.9.11 shellcheck=0.9.0
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@deepujain deepujain force-pushed the HADOOP-19758-ncurses-shell branch from e89bead to 99aa5d8 Compare April 22, 2026 01:18
@deepujain
Copy link
Copy Markdown
Contributor Author

Follow-up push for the latest Yetus failure: the new bats test was masking more than just tput because the simulated PATH also removed fold, so the expected archive-logs output never printed in CI. I updated the test fixture to keep fold available while still simulating missing tput, then force-pushed the amended single commit. Local validation passed with the same narrowed shell repro: source hadoop-functions.sh, expose only sort and fold on PATH, unset COLUMNS, and confirm hadoop_generic_columnprinter still prints archive-logs output without a tput error.

@hadoop-yetus
Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 21s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 25m 32s trunk passed
+1 💚 mvnsite 1m 12s trunk passed
+1 💚 shadedclient 14m 56s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 42s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 mvnsite 0m 54s the patch passed
+1 💚 shellcheck 0m 2s No new issues.
+1 💚 shadedclient 14m 27s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 1m 14s hadoop-common in the patch passed.
+1 💚 asflicense 0m 25s The patch does not generate ASF License warnings.
61m 32s
Subsystem Report/Notes
Docker ClientAPI=1.54 ServerAPI=1.54 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8387/3/artifact/out/Dockerfile
GITHUB PR #8387
Optional Tests dupname asflicense mvnsite unit codespell detsecrets shellcheck shelldocs
uname Linux 592b64b635f5 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 99aa5d8
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8387/3/testReport/
Max. process+thread count 645 (vs. ulimit of 10000)
modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8387/3/console
versions git=2.43.0 maven=3.9.11 shellcheck=0.9.0
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants