Bug 247343 - sysutils/watchman: 2020.06.15.00 : fails: getOpenedPath not implemented on this platform
Summary: sysutils/watchman: 2020.06.15.00 : fails: getOpenedPath not implemented on th...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Yuri Victorovich
Depends on:
Reported: 2020-06-17 13:51 UTC by Urs
Modified: 2020-08-11 22:53 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (yuri)


Note You need to log in before you can comment on or make changes to this bug.
Description Urs 2020-06-17 13:51:11 UTC
Executing "watchman watch /root" will respond with:

    "cli_validated": true,
    "version": "0.0.0",
    "error": "failed to validate command: Could not resolve /root to the canonical watch path: getOpenedPath not implemented on this platform: Function not implemented"

It looks like the environment variable F_GETPATH is not set, which is used in the source file FileDescriptor.cpp (method FileDescriptor::getOpenedPath() ). 

F_GETPATH is only set in a test, grepping for it:
tests/integration/path_utils.py:    F_GETPATH = 50

So the method getOpenedPath is not functional...

The older version 4.5.0_1 worked fine...

Version: watchman-2020.06.15.00
Comment 1 Yuri Victorovich freebsd_committer 2020-06-17 15:53:50 UTC
Hi Urs,

Thank you for your report.

I only recently took maintainership of this port, and didn't yet review it properly.

I will fix this problem.

Comment 2 Urs 2020-07-08 12:40:50 UTC
Hi Yuri

Please have a look at this issue. IMHO this port should be marked "broken".
Thanks and best regards,
Comment 3 Yuri Victorovich freebsd_committer 2020-07-08 16:17:16 UTC
(In reply to Urs from comment #2)

Hi Urs,

You are right, but I was semi-working on this and might be able to fix it by figuring out how to do this.

I will mark it broken in case this turns out to be impossible.

Comment 4 Yuri Victorovich freebsd_committer 2020-07-08 17:13:24 UTC
This problem is dependent on the symbol F_GETPATH for fcntl(2).

Here is the patch against HEAD that implements it: https://people.freebsd.org/~mjg/F_GETPATH.diff

Based on the Mateusz Guzik's response in hackers@ he might be adding it to 12.1 as well.

This would automatically fix watchman.

Comment 5 Urs 2020-07-17 20:56:36 UTC
uh-oh... Patching the OS to fix watchman?
Watchman 4.5.0_1 did run nicely. Would it be a possibility to revert to this version?
Best regards, Urs
Comment 6 Yuri Victorovich freebsd_committer 2020-07-17 21:12:51 UTC
(In reply to Urs from comment #5)

It looks like they added the use of this feature in a later version of watchman that is currently missing.

I'll look into either reverting this change in the code, or following another suggestion from the hackers@ thread - to use realpath(3).
Comment 7 Urs 2020-08-11 21:17:11 UTC
Hi Yuri

I suggest to revert watchman to an older functioning version... That would be the simplest solution. Could you please do so?

Thanks and best regards, -Urs
Comment 8 commit-hook freebsd_committer 2020-08-11 22:53:07 UTC
A commit references this bug:

Author: yuri
Date: Tue Aug 11 22:52:44 UTC 2020
New revision: 544722
URL: https://svnweb.freebsd.org/changeset/ports/544722

  New port: sysutils/watchman450: Branch for version 4.5.0 of sysutils/watchman

  sysutils/watchman is currently broken because F_GETPATH isn't currently available.

  PR:		247343
  Reported by:	Urs <upte@triamec.com>
  Suggested by:	Urs <upte@triamec.com>