Use direct inclusion, not submodules, to bring Javelin into Phabricator

Summary:
Submoduling is slightly convenient for developers but hellishly difficult for many users. Since we make about a dozen updates to Javelin per year, just include the source directly.

Even if we run `git submodule status` more often, this creates additional problems for users with PATH misconfigured.

Fixes T2062 by nuking it from orbit.

Test Plan: Loaded site, browsed around. Grepped for references to submodules.

Reviewers: btrahan, vrana

CC: aran

Maniphest Tasks: T2062

Differential Revision: https://secure.phabricator.com/D4581
This commit is contained in:
epriestley
2013-01-22 10:32:26 -08:00
parent 22c64c67ff
commit 07767fda00
70 changed files with 10264 additions and 117 deletions

View File

@@ -3192,7 +3192,7 @@ celerity_register_resource_map(array(
),
'sprite-icon-css' =>
array(
'uri' => '/res/698745d1/rsrc/css/sprite-icon.css',
'uri' => '/res/e7d63fcf/rsrc/css/sprite-icon.css',
'type' => 'css',
'requires' =>
array(
@@ -3238,7 +3238,7 @@ celerity_register_resource_map(array(
), array(
'packages' =>
array(
57036208 =>
'86c4a3b2' =>
array(
'name' => 'core.pkg.css',
'symbols' =>
@@ -3282,7 +3282,7 @@ celerity_register_resource_map(array(
36 => 'phabricator-object-item-list-view-css',
37 => 'global-drag-and-drop-css',
),
'uri' => '/res/pkg/57036208/core.pkg.css',
'uri' => '/res/pkg/86c4a3b2/core.pkg.css',
'type' => 'css',
),
'c90b892e' =>
@@ -3472,19 +3472,19 @@ celerity_register_resource_map(array(
'reverse' =>
array(
'aphront-attached-file-view-css' => '83f07678',
'aphront-crumbs-view-css' => '57036208',
'aphront-dialog-view-css' => '57036208',
'aphront-error-view-css' => '57036208',
'aphront-form-view-css' => '57036208',
'aphront-crumbs-view-css' => '86c4a3b2',
'aphront-dialog-view-css' => '86c4a3b2',
'aphront-error-view-css' => '86c4a3b2',
'aphront-form-view-css' => '86c4a3b2',
'aphront-headsup-action-list-view-css' => 'ec01d039',
'aphront-headsup-view-css' => '57036208',
'aphront-list-filter-view-css' => '57036208',
'aphront-pager-view-css' => '57036208',
'aphront-panel-view-css' => '57036208',
'aphront-table-view-css' => '57036208',
'aphront-tokenizer-control-css' => '57036208',
'aphront-tooltip-css' => '57036208',
'aphront-typeahead-control-css' => '57036208',
'aphront-headsup-view-css' => '86c4a3b2',
'aphront-list-filter-view-css' => '86c4a3b2',
'aphront-pager-view-css' => '86c4a3b2',
'aphront-panel-view-css' => '86c4a3b2',
'aphront-table-view-css' => '86c4a3b2',
'aphront-tokenizer-control-css' => '86c4a3b2',
'aphront-tooltip-css' => '86c4a3b2',
'aphront-typeahead-control-css' => '86c4a3b2',
'differential-changeset-view-css' => 'ec01d039',
'differential-core-view-css' => 'ec01d039',
'differential-inline-comment-editor' => 'ac53d36a',
@@ -3498,7 +3498,7 @@ celerity_register_resource_map(array(
'differential-table-of-contents-css' => 'ec01d039',
'diffusion-commit-view-css' => 'c8ce2d88',
'diffusion-icons-css' => 'c8ce2d88',
'global-drag-and-drop-css' => '57036208',
'global-drag-and-drop-css' => '86c4a3b2',
'inline-comment-summary-css' => 'ec01d039',
'javelin-aphlict' => 'c90b892e',
'javelin-behavior' => 'fbeded59',
@@ -3568,48 +3568,48 @@ celerity_register_resource_map(array(
'javelin-util' => 'fbeded59',
'javelin-vector' => 'fbeded59',
'javelin-workflow' => 'fbeded59',
'lightbox-attachment-css' => '57036208',
'lightbox-attachment-css' => '86c4a3b2',
'maniphest-task-summary-css' => '83f07678',
'maniphest-transaction-detail-css' => '83f07678',
'phabricator-busy' => 'c90b892e',
'phabricator-content-source-view-css' => 'ec01d039',
'phabricator-core-buttons-css' => '57036208',
'phabricator-core-css' => '57036208',
'phabricator-crumbs-view-css' => '57036208',
'phabricator-directory-css' => '57036208',
'phabricator-core-buttons-css' => '86c4a3b2',
'phabricator-core-css' => '86c4a3b2',
'phabricator-crumbs-view-css' => '86c4a3b2',
'phabricator-directory-css' => '86c4a3b2',
'phabricator-drag-and-drop-file-upload' => 'ac53d36a',
'phabricator-dropdown-menu' => 'c90b892e',
'phabricator-file-upload' => 'c90b892e',
'phabricator-filetree-view-css' => '57036208',
'phabricator-flag-css' => '57036208',
'phabricator-form-view-css' => '57036208',
'phabricator-header-view-css' => '57036208',
'phabricator-jump-nav' => '57036208',
'phabricator-filetree-view-css' => '86c4a3b2',
'phabricator-flag-css' => '86c4a3b2',
'phabricator-form-view-css' => '86c4a3b2',
'phabricator-header-view-css' => '86c4a3b2',
'phabricator-jump-nav' => '86c4a3b2',
'phabricator-keyboard-shortcut' => 'c90b892e',
'phabricator-keyboard-shortcut-manager' => 'c90b892e',
'phabricator-main-menu-view' => '57036208',
'phabricator-main-menu-view' => '86c4a3b2',
'phabricator-menu-item' => 'c90b892e',
'phabricator-nav-view-css' => '57036208',
'phabricator-nav-view-css' => '86c4a3b2',
'phabricator-notification' => 'c90b892e',
'phabricator-notification-css' => '57036208',
'phabricator-notification-menu-css' => '57036208',
'phabricator-object-item-list-view-css' => '57036208',
'phabricator-notification-css' => '86c4a3b2',
'phabricator-notification-menu-css' => '86c4a3b2',
'phabricator-object-item-list-view-css' => '86c4a3b2',
'phabricator-object-selector-css' => 'ec01d039',
'phabricator-paste-file-upload' => 'c90b892e',
'phabricator-prefab' => 'c90b892e',
'phabricator-project-tag-css' => '83f07678',
'phabricator-remarkup-css' => '57036208',
'phabricator-remarkup-css' => '86c4a3b2',
'phabricator-shaped-request' => 'ac53d36a',
'phabricator-side-menu-view-css' => '57036208',
'phabricator-standard-page-view' => '57036208',
'phabricator-side-menu-view-css' => '86c4a3b2',
'phabricator-standard-page-view' => '86c4a3b2',
'phabricator-textareautils' => 'c90b892e',
'phabricator-tooltip' => 'c90b892e',
'phabricator-transaction-view-css' => '57036208',
'phabricator-zindex-css' => '57036208',
'sprite-apps-large-css' => '57036208',
'sprite-gradient-css' => '57036208',
'sprite-icon-css' => '57036208',
'sprite-menu-css' => '57036208',
'syntax-highlighting-css' => '57036208',
'phabricator-transaction-view-css' => '86c4a3b2',
'phabricator-zindex-css' => '86c4a3b2',
'sprite-apps-large-css' => '86c4a3b2',
'sprite-gradient-css' => '86c4a3b2',
'sprite-icon-css' => '86c4a3b2',
'sprite-menu-css' => '86c4a3b2',
'syntax-highlighting-css' => '86c4a3b2',
),
));

View File

@@ -11,8 +11,7 @@ final class PhabricatorCaches {
/**
* Highly specialized cache for performing setup checks. We use this cache
* to determine if we need to run expensive setup checks (e.g., verifying
* submodule versions, PATH, the presence of binaries, etc.) when the page
* to determine if we need to run expensive setup checks when the page
* loads. Without it, we would need to run these checks every time.
*
* Normally, this cache is just APC. In the absence of APC, this cache

View File

@@ -63,8 +63,6 @@ dependencies:
somewhere/ $ git clone git://github.com/facebook/libphutil.git
somewhere/ $ git clone git://github.com/facebook/arcanist.git
somewhere/ $ git clone git://github.com/facebook/phabricator.git
somewhere/ $ cd phabricator
somewhere/phabricator/ $ git submodule update --init
= Installing APC (Optional) =
@@ -124,8 +122,7 @@ Since Phabricator is under active development, you should update frequently. To
update Phabricator:
- Stop the webserver.
- Run `git pull && git submodule update --init` in `libphutil/`,
`arcanist/` and `phabricator/`.
- Run `git pull` in `libphutil/`, `arcanist/` and `phabricator/`.
- Run `phabricator/bin/storage upgrade`.
- Restart the webserver.

View File

@@ -154,51 +154,6 @@ final class PhabricatorSetup {
$root = dirname(phutil_get_library_root('phabricator'));
self::writeHeader("GIT SUBMODULES");
if (!Filesystem::pathExists($root.'/.git')) {
self::write(" skip Not a git clone.\n\n");
} else {
list($info) = execx(
'(cd %s && git submodule status)',
$root);
foreach (explode("\n", rtrim($info)) as $line) {
$matches = null;
if (!preg_match('/^(.)([0-9a-f]{40}) (\S+)(?: |$)/', $line, $matches)) {
self::writeFailure();
self::write(
"Setup failure! 'git submodule' produced unexpected output:\n".
$line);
return;
}
$status = $matches[1];
$module = $matches[3];
switch ($status) {
case '-':
case '+':
case 'U':
self::writeFailure();
self::write(
"Setup failure! Git submodule '{$module}' is not up to date. ".
"Run:\n\n".
" cd {$root} && git submodule update --init\n\n".
"...to update submodules.");
return;
case ' ':
self::write(" okay Git submodule '{$module}' up to date.\n");
break;
default:
self::writeFailure();
self::write(
"Setup failure! 'git submodule' reported unknown status ".
"'{$status}' for submodule '{$module}'. This is a bug; report ".
"it to the Phabricator maintainers.");
return;
}
}
}
self::write("[OKAY] All submodules OKAY.\n");
self::writeHeader("BASIC CONFIGURATION");

View File

@@ -19,8 +19,8 @@ final class PhabricatorJavelinLinter extends ArcanistLinter {
require_once $root.'/scripts/__init_script__.php';
if ($this->haveSymbolsBinary === null) {
$binary = $this->getSymbolsBinaryPath();
$this->haveSymbolsBinary = Filesystem::pathExists($binary);
list($err) = exec_manual('which javelinsymbols');
$this->haveSymbolsBinary = !$err;
if (!$this->haveSymbolsBinary) {
return;
}
@@ -28,6 +28,10 @@ final class PhabricatorJavelinLinter extends ArcanistLinter {
$futures = array();
foreach ($paths as $path) {
if ($this->shouldIgnorePath($path)) {
continue;
}
$future = $this->newSymbolsFuture($path);
$futures[$path] = $future;
}
@@ -53,11 +57,18 @@ final class PhabricatorJavelinLinter extends ArcanistLinter {
self::LINT_MISSING_DEPENDENCY => 'Missing Javelin Dependency',
self::LINT_UNNECESSARY_DEPENDENCY => 'Unnecessary Javelin Dependency',
self::LINT_UNKNOWN_DEPENDENCY => 'Unknown Javelin Dependency',
self::LINT_MISSING_BINARY => '`javelinsymbols` Binary Not Built',
self::LINT_MISSING_BINARY => '`javelinsymbols` Not In Path',
);
}
private function shouldIgnorePath($path) {
return preg_match('@/__tests__/|externals/javelinjs/src/docs/@', $path);
}
public function lintPath($path) {
if ($this->shouldIgnorePath($path)) {
return;
}
if (!$this->haveSymbolsBinary) {
if (!$this->haveWarnedAboutBinary) {
@@ -68,9 +79,10 @@ final class PhabricatorJavelinLinter extends ArcanistLinter {
1,
0,
self::LINT_MISSING_BINARY,
"The 'javelinsymbols' binary in the Javelin project has not been ".
"built, so the Javelin linter can't run. This isn't a big concern, ".
"but means some Javelin problems can't be automatically detected.");
"The 'javelinsymbols' binary in the Javelin project is not ".
"available in \$PATH, so the Javelin linter can't run. This ".
"isn't a big concern, but means some Javelin problems can't be ".
"automatically detected.");
}
return;
}
@@ -114,7 +126,7 @@ final class PhabricatorJavelinLinter extends ArcanistLinter {
$celerity = CelerityResourceMap::getInstance();
$path = preg_replace(
'@^externals/javelin/src/@',
'@^externals/javelinjs/src/@',
'webroot/rsrc/js/javelin/',
$path);
$need = $external_classes;
@@ -175,20 +187,13 @@ final class PhabricatorJavelinLinter extends ArcanistLinter {
}
private function newSymbolsFuture($path) {
$javelinsymbols = $this->getSymbolsBinaryPath();
$javelinsymbols = 'javelinsymbols';
$future = new ExecFuture($javelinsymbols.' # '.escapeshellarg($path));
$future->write($this->getData($path));
return $future;
}
private function getSymbolsBinaryPath() {
$root = dirname(phutil_get_library_root('phabricator'));
$support = $root.'/externals/javelin/support';
return $support.'/javelinsymbols/javelinsymbols';
}
private function getUsedAndInstalledSymbolsForPath($path) {
list($symbols) = $this->loadSymbols($path);
$symbols = trim($symbols);