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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-17 13:51 UTC by Urs
Modified: 2021-03-03 00:32 UTC (History)
1 user (show)

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


Attachments

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 freebsd_triage 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.


Yuri
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,
-Urs
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 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.


Thanks,
Yuri
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 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.


Best,
Yuri
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 freebsd_triage 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 freebsd_triage 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

Log:
  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>

Changes:
  head/sysutils/Makefile
  head/sysutils/watchman/Makefile
  head/sysutils/watchman450/
  head/sysutils/watchman450/Makefile
Comment 9 commit-hook freebsd_committer freebsd_triage 2020-08-13 15:59:25 UTC
A commit references this bug:

Author: yuri
Date: Thu Aug 13 15:59:07 UTC 2020
New revision: 544816
URL: https://svnweb.freebsd.org/changeset/ports/544816

Log:
  sysutils/watchman: Rollback to 4.5.0, remove sysutils/watchman in favor of sysutils/watchman450

  PR:		247343
  Suggested by:	mat

Changes:
  head/sysutils/Makefile
  head/sysutils/watchman/
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-08-13 16:01:29 UTC
A commit references this bug:

Author: yuri
Date: Thu Aug 13 16:00:27 UTC 2020
New revision: 544817
URL: https://svnweb.freebsd.org/changeset/ports/544817

Log:
  sysutils/watchman: Rollback to 4.5.0, move sysutils/watchman450 to sysutils/watchman

  PR:		247343
  Suggested by:	mat

Changes:
  head/sysutils/Makefile
  head/sysutils/watchman/
  head/sysutils/watchman/Makefile
  head/sysutils/watchman450/