Giter Site home page Giter Site logo

Failed to identify PDU about watchman HOT 11 CLOSED

facebook avatar facebook commented on May 6, 2024
Failed to identify PDU

from watchman.

Comments (11)

wez avatar wez commented on May 6, 2024

I think this might be due an issue with the BSER client in the watchman CLI.
Try this instead:

$ watchman --persistent --server-encoding=json log-level debug

from watchman.

nmalcolm avatar nmalcolm commented on May 6, 2024

Thanks. I'm now getting a bunch of assessing triggers messages. To clarify, is that to fix the issue with debugging or with watchman not executing scripts? If the latter, is there a way to set server-encoding to json always (I'm assuming that watchman does its own thing with starting up; correct me if I'm wrong)?

from watchman.

wez avatar wez commented on May 6, 2024

my comment was about connecting to the debug output. You haven't given any details on your other issue, so it's difficult to say whats's going on. What does watchman trigger-list $root say?

from watchman.

nmalcolm avatar nmalcolm commented on May 6, 2024
{
    "version": "2.8.2",
    "triggers": [
        {
            "name": "generatestatic",
            "command": [
                "./scripts/celerity_mapper.php ./webroot"
            ],
            "rules": [
                {
                    "pattern": "*.css",
                    "include": true,
                    "negated": false
                }
            ]
        }
    ]
}

Running ./scripts/celerity_mapper.php ./webroot from the root works fine, and git status does show that .css files have been modified. I tried using absolute paths too, to no avail.

from watchman.

wez avatar wez commented on May 6, 2024

Run watchman --persistent --server-encoding=json log-level debug in one window, then in another, touch a .css file. Watchman should assess the trigger for your css and try to invoke celerity_mapper.php.

The triggers happen on file changes as they are noticed; it doesn't talk to git to see if the file is different

from watchman.

nmalcolm avatar nmalcolm commented on May 6, 2024

Output: http://pastebin.com/d8QeTWej

The triggers happen on file changes as they are noticed; it doesn't talk to git to see if the file is different

I'm aware; git status shows that the .css files are modified but once they have been it should also show that ./src/__celerity_resource_map__.php has been modified too.

from watchman.

wez avatar wez commented on May 6, 2024

Have to dash, but wanted to quickly respond: the output in your paste shows that watchman is trying to execute this:

"./scripts/celerity_mapper.php ./webroot" "changedfile.css"

We use a driver script for the command; you could do something like:

#!/bin/sh
exec ./scripts/celerity_mapper.php ./webroot $*

and then register that as your trigger

from watchman.

nmalcolm avatar nmalcolm commented on May 6, 2024

The command which needs to be executed is ./scripts/celerity_mapper.php ./webroot. Is there a way to omit the argument which watchman adds?

This is the command I'm using to create the trigger.

watchman -- trigger /var/www/phabricator generatestatic '*.css' -- "./scripts/celerity_mapper.php ./webroot"

from watchman.

wez avatar wez commented on May 6, 2024

If you don't want to pass the changed files to celerity_mapper.php, you should use a script like this:

#!/bin/sh
exec ./scripts/celerity_mapper.php ./webroot

Then

watchman -- trigger /var/www/phabricator generatestatic '*.css' -- './scripts/run-celerity-mapper.sh'

otherwise, change your quoting so that it runs the right thing:

watchman -- trigger /var/www/phabricator generatestatic '*.css' -- ./scripts/celerity_mapper.php ./webroot

We don't currently have a way to tell the trigger dispatcher to not pass the changed filenames, but do want to add that functionality.

from watchman.

nmalcolm avatar nmalcolm commented on May 6, 2024

I had tried that originally but this is the only debug output when I changed the CSS file:

{
    "version": "2.8.2",
    "log": "1381517326: tid=798742272 inotify read: returned 256.\n"
}
{
    "version": "2.8.2",
    "log": "1381517326: tid=798742272 inotify read: returned 192.\n"
}

It doesn't look like it's trying to execute celerity_mapper.php?

from watchman.

wez avatar wez commented on May 6, 2024

I turned off BSER by default in the CLI, so I'm considering this good enough for now.
The future for this is a BSER implementation based on libphenom when I finally get a chance to push that diff.

from watchman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.