rbt diff tool not found

42 views
Skip to first unread message

Ron A

unread,
Dec 25, 2024, 3:53:34 PM12/25/24
to Review Board Community
Testing on reviewboard 4.x and 7.x 
rbt post command can't find the diff tool.
Thanks for the help in advance!

os rocky 9.x
which diff
/bin/diff

RBTools             5.1.1
INFO - Python script running under: apache
INFO - PATH /usr/bin/:/usr/local/bin:/bin:/usr/bin

A compatible command line diff tool (Apple Diff, GNU Diff) was not found on the system. This is required in order to generate diffs, and will need to be installed and placed in your system path.\n\nOn Linux, GNU Diff can be installed using your system package manager.\n\nIf you\'re running an older version of RBTools, you may also need to upgrade.\n')

David Trowbridge

unread,
Dec 25, 2024, 4:17:03 PM12/25/24
to revie...@googlegroups.com
What is the output if you run "diff --version"?

David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/reviewboard/c6185dd2-9837-427d-b59c-686d57d02bdbn%40googlegroups.com.

Ron T

unread,
Dec 25, 2024, 4:23:35 PM12/25/24
to revie...@googlegroups.com
Here is the output.
Thanks.

diff --version
diff (GNU diffutils) 3.7
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Eggert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.

You received this message because you are subscribed to a topic in the Google Groups "Review Board Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard/DhNke7HOdQQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/reviewboard/CAFS3VNWJuf%3D2zoy90y%2B80G3EkOFtOdZ_rhnurA%3DvK888Ti81bA%40mail.gmail.com.

Ron T

unread,
Dec 25, 2024, 4:55:00 PM12/25/24
to revie...@googlegroups.com
On rocky 9 there is only one version available it appears, at least as far as the repos I've searched so far.
dnf search  diffutils --showduplicates
Name Exactly Matched: diffutils =============================================================
diffutils-3.7-12.el9.x86_64 : GNU collection of diff utilities

I also tried downloading version diffutils-3.6-6.el8.x86_64 from https://download.rockylinux.org/vault/rocky/8.6/BaseOS/x86_64/os/Packages/d/
and installed it, but had the same results as before.

David Trowbridge

unread,
Dec 25, 2024, 5:11:45 PM12/25/24
to revie...@googlegroups.com
Thanks for that. Can you also run your rbt command with --debug and send the output?

David


Ron T

unread,
Dec 25, 2024, 10:15:39 PM12/25/24
to revie...@googlegroups.com
Here it is, thanks.

2024-12-25 13:51:17 - DEBUG - PostReviewStdErr: >>> RBTools 5.1.1\n>>> Python 3.9.21 (main, Dec  5 2024, 00:00:00) \n[GCC 11.5.0 20240719 (Red Hat 11.5.0-2)]\n>>> Running on Linux-5.14.0-427.35.1.el9_4.cloud.1.0.x86_64-x86_64-with-glibc2.34\n>>> Home = /mnt/data/www\n>>> Command line: rbt post --debug --server https://myserver.com:8080/reviewboard/ --publish --description "test 7\n" --summary "user1: [home] test 7" --submit-as user1 --username svn --password xxxx --target-groups "" --target-people "" --repository myrepo --repository-type svn --repository-url file:///mnt/data/svn/myrepo 486717:486718\n>>> [scan] Checking for available SCMs for ...\n>>> [scan] Only considering the following types of repositories: svn\n>>> Running: svn --non-interactive info file:///mnt/data/svn/myrepo\n>>> [scan] SCM scan complete. Found svn (None)\n>>> [scan] Verifying repository information...\n>>> Running: svn --non-interactive --version -q\n>>> [scan] Successfully found repository information: <SVNRepositoryInfo(path=\'file:///mnt/data/svn/myrepo\', base_path=\'/\', local_path=None)>\n>>> [diff tool scan] Scanning for installed diff tools...\nERROR: Unexpected error setting up and checking for diff tool "gnu": \'PATH\'\nTraceback (most recent call last):\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/registry.py", line 212, in _populate_instances\n    diff_tool.setup()\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/base/diff_tool.py", line 94, in setup\n    self.available = self.check_available()\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/backends/gnu.py", line 91, in check_available\n    for diff_path in self._iter_diff_paths():\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/backends/gnu.py", line 302, in _iter_diff_paths\n    yield from iter_exes_in_path(\'gdiff\')\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/utils/filesystem.py", line 90, in iter_exes_in_path\n    for dirname in os.environ[\'PATH\'].split(os.pathsep):\n  File "/usr/lib64/python3.9/os.py", line 679, in __getitem__\n    raise KeyError(key) from None\nKeyError: \'PATH\'\nERROR: Unexpected error setting up and checking for diff tool "apple": \'PATH\'\nTraceback (most recent call last):\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/registry.py", line 212, in _populate_instances\n    diff_tool.setup()\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/base/diff_tool.py", line 94, in setup\n    self.available = self.check_available()\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/backends/apple.py", line 48, in check_available\n    for diff_path in iter_exes_in_path(\'diff\'):\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/utils/filesystem.py", line 90, in iter_exes_in_path\n    for dirname in os.environ[\'PATH\'].split(os.pathsep):\n  File "/usr/lib64/python3.9/os.py", line 679, in __getitem__\n    raise KeyError(key) from None\nKeyError: \'PATH\'\n>>> [diff tool scan] No diff tools found (tried [<class \'rbtools.diffs.tools.backends.gnu.GNUDiffTool\'>, <class \'rbtools.diffs.tools.backends.apple.AppleDiffTool\'>])\n>>> [diff tool scan] Scan complete.\nTraceback (most recent call last):\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/commands/base/commands.py", line 1207, in initialize_scm_tool\n    tool.get_diff_tool()\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/clients/base/scmclient.py", line 898, in get_diff_tool\n    diff_tool = diff_tools_registry.get_available()\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/diffs/tools/registry.py", line 144, in get_available\n    raise MissingDiffToolError(\nrbtools.diffs.tools.errors.MissingDiffToolError: A compatible command line diff tool (Apple Diff, GNU Diff) was not found on the system. This is required in order to generate diffs, and will need to be installed and placed in your system path.\n\nOn Linux, GNU Diff can be installed using your system package manager.\n\nIf you\'re running an older version of RBTools, you may also need to upgrade.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/mnt/data/y/bin/rbt", line 8, in <module>\n    sys.exit(main())\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/commands/main.py", line 214, in main\n    command.run_from_argv([RB_MAIN, command_name] + args)\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/commands/base/commands.py", line 1114, in run_from_argv\n    self.initialize()\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/commands/base/commands.py", line 973, in initialize\n    repository_info, tool = self.initialize_scm_tool(\n  File "/mnt/data/y/lib/python3.9/site-packages/rbtools/commands/base/commands.py", line 1209, in initialize_scm_tool\n    raise CommandError(str(e))\nrbtools.commands.base.errors.CommandError: A compatible command line diff tool (Apple Diff, GNU Diff) was not found on the system. This is required in order to generate diffs, and will need to be installed and placed in your system path.\n\nOn Linux, GNU Diff can be installed using your system package manager.\n\nIf you\'re running an older version of RBTools, you may also need to upgrade.\n

Ron T

unread,
Dec 26, 2024, 12:46:00 AM12/26/24
to revie...@googlegroups.com
I found the culprit.

at the end of the rbt post command was env={"HOME": "/mnt/data/www"}).communicate()
removing that fixed the diff binary not being found. I'm not sure why though?
The user apache has its home at /mnt/data/www for my test case so that's the reason env was set, but unsetting it results in the same home location that has .bashrc and .bash_profile files, and the diff binary was in the PATH ..?

..
  "--repository-type", "svn",
  "--repository-url",  repoPath,
   revisionRange],
   stdout=PIPE,
   stderr=PIPE).communicate()
   env={"HOME": "/mnt/data/www"}).communicate()

David Trowbridge

unread,
Dec 26, 2024, 1:57:50 AM12/26/24
to revie...@googlegroups.com
When you pass env=, it's overriding the entire environment for the child process. From the debug output, it's failing to find "diff" because there's no PATH set at all. If you need to override $HOME here, you could copy os.environ, set HOME in the copy, and then pass that in for the env parameter.

David

Ron T

unread,
Dec 26, 2024, 11:12:53 PM12/26/24
to Review Board Community
Thank you for the explanation David :)
Merry Christmas.

Reply all
Reply to author
Forward
0 new messages