Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filterhook role does not work if you install non-LIVE version #138

Open
pitkali opened this issue Jun 28, 2019 · 0 comments
Open

Filterhook role does not work if you install non-LIVE version #138

pitkali opened this issue Jun 28, 2019 · 0 comments

Comments

@pitkali
Copy link

pitkali commented Jun 28, 2019

If you install non-LIVE version of an extension, every time you trigger its filter hook role, you will receive the following error:

Error:  Process returned non-zero exit status 1
 Output:

   /var/home/jl/src/critic/src/library/js/v8/critic.js:272: Uncaught IOError: chdir() failed: No such file or directory (<snapshot of commit 7cd60ece>)
   Stacktrace:
     setup() at /var/home/jl/src/critic/src/library/js/v8/critic.js:272

-- critic

This happens, because this role accesses the manifest at several different places, and instead of reading it every time with Manifest.load and installed path like other roles, it uses extension.getManifest() providing sha1 (rather than version ID, for example).

However, extension.getManifest() synthesises an invalid path whenever reading the manifest for the first time using sha1, like the one in the message above: "snapshot of commit 7cd60ece." It uses that path to set the corresponding field of the manifest object, which the extension runner will then use to move into the directory, presumably to make any resource references work well.

It's unclear why do this like this. The manifest has just been read from an actual real file existing in the directory tree. An installed_path. Arguably, it is that path that should be associated with the extension's manifest. (It indeed fixes the filterhook problem.)

pitkali added a commit to pitkali/critic that referenced this issue Jun 28, 2019
When extension.getManifest() is asked for manifest of a given sha1, it
reads the manifest from the snapshot directory. It then synthesises an
invalid path, for some reason. This makes the created manifest unusable
for actually running extensions.

But the extension has a snapshot on disk from which this manifest was
read! So return the install_path of that snapshot.

This fixes ability to run non-LIVE versions of filterhook role, which
uses getManifest to avoid reading the manifest too often.

Fixes: jensl#138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant