Page MenuHomePhorge

Packages: Load'em from .cache
Needs ReviewPublic

Authored by avivey on Feb 4 2022, 11:05.
Referenced Files
Unknown Object (File)
Wed, Apr 17, 05:53
Unknown Object (File)
Tue, Apr 16, 04:59
Unknown Object (File)
Thu, Apr 11, 09:10
Unknown Object (File)
Tue, Apr 9, 19:58
Unknown Object (File)
Mon, Apr 8, 23:51
Unknown Object (File)
Mon, Apr 8, 23:48
Unknown Object (File)
Mon, Apr 8, 07:30
Unknown Object (File)
Mon, Apr 8, 07:27

Details

Reviewers
None
Group Reviewers
O1: Blessed Committers
Maniphest Tasks
T15068: Distribution mechanism for arc extensions
Summary

(This used to be T21485 on secure-dot, but it never got anywhere)

This is the basis of the client-side support for Packages:

  • Installed packages are under ~/.cache/arcanist-packages/<identifier>-<version>.
  • A package has a manifest file called .arcpackage.
  • A package can be Requested from any config source, as packages, an array of objects.

This change includes:

  • loading requested packages that are installed
  • list all installed packages
  • a flow to install a package (but not to configure loading it).

To configure a package, this goes in any config file:

{
  "packages": [
    {
      "identifier": "pk1",
      "version": "1.12"
    },
    {
      "identifier": "aviv.demo1",
      "version":"1.0"
    }
  ]
}

and a manifest looks like this:

.arcpackage
{
    "identifier": "aviv.demo1",
    "version": "1.0",
    "Description": "An important demo package"
}

The --install-from-tgz flow is obviously just temporary, to be replaced later with better setup.

Test Plan

image.png (159×853 px, 18 KB)

Also used --install-from-tgz on a package.

Diff Detail

Repository
rARC Arcanist
Branch
packages
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/packages/ArcanistPackagesLoader.php:68XHP16TODO Comment
Advicesrc/workflow/ArcanistPackagesWorkflow.php:157XHP16TODO Comment
Advicesrc/workflow/ArcanistPackagesWorkflow.php:182XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 62
Build 62: arc lint + arc unit

Event Timeline

avivey requested review of this revision.Feb 4 2022, 11:05
avivey retitled this revision from start: read packages info from config to Packages: Load'em from .cache.Feb 4 2022, 11:07
avivey edited the test plan for this revision. (Show Details)

This is my primary jab at Packages - think of it maybe as an RFC.

The design is basically borrowed from VSCode - download stuff into a known location, then load what's needed at run-time.
This assumes local disk is trusted, and that disk space is practically infinite/free. We can add the security stuff on the installation flow.

(I have not tried this patch but I checked with ls -la the mess in my .cache to understand best practices from other software)

What about ~/.cache/arcanist/packages instead?