Commit Graph

90 Commits

Author SHA1 Message Date
David Greenspan
0b803b1aa9 Take glasser's suggestions on 4106e8c 2015-04-13 19:51:51 -07:00
David Glasser
a1e002a250 meteor run sees changes to .meteor/versions
`meteor run` doesn't always write changes to `.meteor/versions`: it only
does so if its release (or checkout-ness) matches `.meteor/release`.  So
it preferred to just remember the value of `.meteor/versions` from
rebuild to rebuild rather than forgetting what it knew and re-reading
the possibly-not-updated file.

However, if some other process changes `.meteor/versions`, it would
ignore that change.  With this fix, if `.meteor/versions` changes then
that is considered to be the previous versions list, not the last
version list from the same process.  For example, this would commonly
happen due to using `meteor update` to update packages (without changing
the tool, which would cause the runner to stop).

Fixes #3582.
2015-04-01 14:39:46 -04:00
David Greenspan
4a4680b5d2 Exclude published package from previousSolution
When you `meteor publish` a package (not from an app), a
ProjectContext is created that gets the Version Solver
"previousSolution" from the .versions file in the project directory.
From the point of view of the Version Solver, the package itself is
a root dependency, so if the version changes from last time, you
may be asked to pass --allow-incompatible-update!  That isn't right.
However, the ProjectContext created by `meteor publish` doesn't know
it is created for a particular package.  But it does have the package
marked as "explicitly added."  So for now, the simplest thing to do
is to alter the input to the Version Solver based on the value of
explicitlyAddedLocalPackageDirs.

Oh, another wrinkle here is that we don't actually know the name of
the package we're publishing when we create the PackageContext, so it
can't be an option.

Example of a failing self-test that now passes:
'packages with organizations'
2015-03-30 16:58:47 -07:00
David Greenspan
1b85b8205e Enable detailed profiling of the constraint solver
See the report using METEOR_PROFILE=1
2015-03-13 10:47:52 -07:00
David Greenspan
83dc85478f Add "Select Package Versions" to METEOR_PROFILE
There's no detail yet, but I'm going to add some.  In the mean time,
you just get the total ms for "Selecting Package Versions...", and
if it runs a second time you'll get another report for "(Try 2)"!
2015-03-12 18:12:01 -07:00
David Greenspan
7c245285fe meteor update with no args patches indirect deps
With this change, `meteor update` with no arguments, in addition to
updating direct dependencies, updates patch versions of indirect
dependencies, so you will get your version 1.4.2 in the above example.

Background: As of the new solver, we already prefer patched versions 
when selecting a version for a new indirect dependency.  For example,
if 1.4.0 is the oldest version we could choose, we will take 1.4.1
instead if available.  However, if 1.4.2 came out, there would never
be an occasion to take it, unless you explicitly typed
`meteor update the-indirect-dependency`.  `meteor update` with no
args expands to `meteor update <all direct deps>`.

Also improve comments, tests, and code around CS.Input.
2015-03-12 16:24:05 -07:00
David Greenspan
0e53947a21 Don't refresh on package-version-parser error 2015-03-10 14:34:05 -07:00
David Greenspan
08bc9ab002 Nicer errors when tool encounters bad package name
Verified manually that `meteor update asdf.` displays an error,
not a stack trace.

Include the offending name in all error messages (as we do for
invalid versions).
2015-03-10 13:58:27 -07:00
Mitar
f2dfcfd7e1 Duplicate import. 2015-03-10 13:41:33 -07:00
David Greenspan
6aad026dcf Merge remote-tracking branch 'origin/devel' into use-logic-solver
Conflicts:
	packages/constraint-solver/package.js
	packages/package-version-parser/package.js
2015-03-10 01:43:19 -07:00
David Glasser
63f89e5602 Tell stats server which packages are local
Requires an annoying level of hackery to get the fake-warehouse tests to
pass.

See meteor/package-stats#1.
2015-03-05 13:49:18 -08:00
David Greenspan
f34e06e69c Change name of --breaking
Put in our improved name and usage docs
2015-03-05 11:43:31 -08:00
David Greenspan
c0a9601abf Fix to fix to e5f73a3 2015-02-09 21:54:57 -08:00
David Greenspan
aa645f86a7 Implement --breaking flag
--breaking:
Allow packages in your project to be upgraded or downgraded
to versions that are not semver-compatible with the current
versions, if required to resolve package version conflicts.

Fix behavior so that packages you're updating count too.
2015-02-09 17:12:24 -08:00
David Greenspan
cf4e1bd4e0 Add comment to previousSolution catalog refresh 2015-02-09 12:20:52 -08:00
David Greenspan
e5f73a3636 Potentially address issue 3653
See #3653
2015-02-09 08:29:11 -08:00
David Greenspan
45752e3203 parseConstraint -> parsePackageConstraint
In the return value, `name` has been changed to `package`,
and `vConstraint` is now `versionConstraint`.

`constraint.package` is better than `constraint.name`, where
`constraint` is a PackageConstraint.  It's also more consistent
with functions like parsePackageAtVersion which return an object
like `{package, version}`.

`vConstraint` was too cryptic.

Changes were discussed with Glasser in a code review.

Troposphere does not call parseConstraint or work with constraint
objects, so it doesn't need to change.

This is a breaking change to the package-version-parser API (or one
method of it, at least), but it is considered an internal API so we
are not worrying too much about it.
2015-02-02 13:13:31 -08:00
David Greenspan
e7ee6184a6 Change return value of utils.parsePackageAtVersion
name -> package, as per code review
2015-02-01 12:53:03 -08:00
David Glasser
0e0dfed6a8 Remove "control program" support
This was support code for a now unused system.
2015-01-29 14:03:10 -08:00
David Glasser
3d5e81bf23 Test the right packages with --test-app-path
Usually the project used for test-packages is a brand-new temporary
project. But you can also use --test-app-path, either for performance
reasons (to share the .meteor/local/isopacks cache between executions)
or because Cordova has issues with /tmp.  Previous to this change,
though, test-packages would leave packages in .meteor/packages from a
previous execution, even if they were packages that we are no longer
testing.

Fixes #3446.
2015-01-26 14:57:42 -08:00
Ben Newman
1aba3a8e7a Eliminate the need for getAppDir in tools/server/shell.js.
Summary:
Instead of expecting the child process to figure out where the
`.meteor/local` directory is, we now tell it explicitly via the
`METEOR_SHELL_DIR` environment variable.

Fixes #3437.

Test Plan:
Run `meteor shell` in a separate terminal and see that it still connects
to an app running from the same app directory.

Reviewers: glasser

Reviewed By: glasser

Differential Revision: https://phabricator.meteor.io/D11
2015-01-20 13:56:57 -05:00
David Glasser
f61ada859d Refresh catalog if release's tool has no build
This fixes a corner case where if you synced the catalog between the
creation of a release and the creation of its tool's build for your
platform, running `meteor --release R` would fail.

Fixes #3317.
2015-01-08 12:28:25 -08:00
David Greenspan
e885e78348 Change the format returned by PVP.parseConstraint
This is a breaking change to package-version-parser.

A PackageConstraint used to look like this:

```
{ name: String,
  constraintString: String,
  constraints: [{version: String|null,
                 type: String}]}
```

Now it looks like this:
```
{ name: String,
  constraintString: String,
  vConstraint: {
    raw: String,
    alternatives: [{versionString: String|null,
                    type: String}]}}
```

Where (vConstraint instanceof VersionConstraint) and
(vConstraint.raw === constraintString).

This achieves several desirable changes at once.

* `constraint.constraints` for the disjuncts in “1.0.0||2.0.0”
  was confusing.  `alternatives` is better.
* Having a class for VersionConstraint will come in handy because
  we can add methods to it, and we can use it in the constraint
  solver to represent the problem statement.
* The names “vConstraint” and “versionString” are a little verbose,
  but there really shouldn’t be a lot of code that dives into this
  structure, and I really wanted to avoid anyone ever writing:
  `constraint.constraint.alternatives[0].version`, and then wondering
  what sort of object that was (not a parsed PackageVersion! we could
  parse eagerly but that might be slow).
2015-01-07 20:10:44 -08:00
David Greenspan
ed5fd8e6cf Don’t use parseConstraint for “package@version”
At least, not directly.  When the tool wants to parse a string of the
form “package@version,” it now uses utils.parsePackageAtVersion.

This way, if I make a breaking change to PV.parseConstraint, I only have
to change a few call sites.
2015-01-07 19:04:55 -08:00
David Glasser
253ec1a9d0 Don't add all packages with --get-ready! 2015-01-05 09:51:38 -08:00
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
David Glasser
89a441eede publish in app: don't write, display versions
Typically, there is a delta due to adding the test slice of the
published package, but there's no reason to tell the user about this or
save it in .meteor/versions.
2014-12-11 22:36:45 -08:00
David Glasser
809b2b69f5 Don't compile web.cordova unibuilds unless needed
Specifically, we only compile them if there's a cordova platform in the
current project, or if we are publishing the package.

(Ideally, we wouldn't require every published package to have
web.browser and web.cordova unibuilds --- we'd just publish a 'web'
unibuild unless there's actually a difference between the two. But we
are not there yet.)

This adds an extra flag to isopack-buildinfo.json, so that we know to
rebuild all the isopacks when we add the first cordova platform (or
remove the last cordova platform).

The implementation around publish is a little clunky; if you're in a
non-Cordova app and run meteor publish, it will rebuild all the packages
with web.cordova, and the next time you prepare the app it will rebuild
them again without it. It does work though.

Fixes #3274.
2014-12-11 22:26:29 -08:00
David Glasser
1e5b7437a5 Refresh catalog only on relevant errors
Fixes #2846.  Fixes #2847. Fixes #2979.

Errors in the build process that could be fixed by refreshing the
catalog now cause the catalog to refresh, assuming we have not already
refreshed it recently and that we are not offline.

These commands now don't need to refresh at startup: remove, run, debug,
create, build, bundle, deploy, test-packages, rebuild, and self-test

It should be OK for create to throw SpringboardToLatestRelease even
without refreshing, since release.latestKnown is still something we know
about.
2014-12-10 19:03:05 -08:00
David Glasser
d7d51f9dac All downloads use downloadPackagesMissingFromMap
We now can make PackageMaps without a localCatalog, for cases like this
where we really want everything in the map to be downloaded.
2014-12-10 14:42:18 -08:00
David Glasser
d3ff3954bf PackageMap only has a local (not layered) catalog
No need to introduce the LayeredCatalog anywhere it's not needed.

Simplify some more things about LayeredCatalog:

- remove unused containingCatalog link from localCatalog to
  layeredCatalog

- because of that, simplify LayeredCatalog initialization to occur after
  localCatalog (no more circular references required)

- drop some other dead LayeredCatalog methods
2014-12-09 18:43:25 -08:00
David Glasser
4920ad1724 Use current previousSolution on runner rebuild 2014-12-08 22:02:50 -08:00
David Glasser
a937aa606d Soft refresh, versioned packages only
First half of #3213.
2014-12-01 19:48:06 -08:00
David Glasser
ab3d6c5bfb Clean up some #3006 comments 2014-12-01 18:29:20 -08:00
David Glasser
06fbe35d46 Support deploying to legacy Galaxy prototype 2014-12-01 17:42:13 -08:00
David Glasser
7d4757b3ac Show package changes and prerelease warnings
This reimplements functionality that had been removed as part of the
`isopack-cache` branch refactoring.

Information about package changes is encapsulated inside a
PackageMapDelta object on the ProjectContext.  It is the responsibility
of the command that prepares the ProjectContext to choose to call
projectContext.packageMapDelta.displayOnConsole at the appropriate time
if it wishes to display changes.

Part of #3006.
2014-12-01 01:26:35 -08:00
David Glasser
de9536172e Fix anticipated pre-release calculation
This commit fixes a 0.9.3 regression where the calculation of the
topLevelPrereleases object was not updated with the introduction of
disjunction constraints (||) and would always be empty.

topLevelPrereleases and useRCsOK are merged into a single
anticipatedPrereleases option which is now passed in to the
constraint-solver package rather than constructed inside it. (This
object will also be used in ProjectContext as part of PackageDelta
calculation.)

The usedRCs return flag is now called
neededToUseUnanticipatedPrereleases.
2014-12-01 01:26:34 -08:00
David Glasser
1d4c3e7387 comment tweaks 2014-11-25 09:35:34 -08:00
David Glasser
46d31e1ce7 Fix update-related bugs
- don't crash when listing upgraders (2 bugs, introduced on this branch)

- successfully write banners-shown file so that we sometimes print
  shorter banners (introduced with sqlite)

- in self-test tropohouse, keep the sadly necessary symlinks

autoupdate test file now passes!
2014-11-25 09:06:28 -08:00
David Glasser
3d8d5ce88c Fix runner restart on package.js scan failure
cordova-plugins now passes
2014-11-25 09:06:27 -08:00
David Glasser
1ad981ee10 hopefully implemented --from-checkout 2014-11-25 09:06:26 -08:00
David Glasser
aba516de9c maintain a .versions file in package source tree
for standalone packages only (packages in an app just use
.meteor/versions from the app)
2014-11-25 09:06:26 -08:00
David Glasser
602e6f5539 Include .versions file in source for publish 2014-11-25 09:06:25 -08:00
David Glasser
c55c76280b save pluginProviderPackageMap when compiling
move PackageMap to IsopackCache constructor
2014-11-25 09:06:24 -08:00
David Glasser
06114d6983 Fix 'meteor publish'
only works from inside an app! does not include a version lock file!
2014-11-25 09:06:24 -08:00
David Glasser
275456054f Drop test-runner-app from repo
ProjectContext now makes sure to turn the given directory into a project
directory if it isn't one yet.

Add --show-test-app-path to test-packages.
2014-11-25 09:06:23 -08:00
David Glasser
b07c3578ac package update works now 2014-11-25 09:06:23 -08:00
David Glasser
e88f588cfc Fix updating releases (not package update though)
Move run-upgrader command under 'admin'
2014-11-25 09:06:23 -08:00
David Glasser
e1572801d5 Revert "releaseFile.setRelease should be in-memory only"
This reverts commit 3735ff62d51af6c7e537d5c3fe35e79cebb68735.
2014-11-25 09:06:23 -08:00
David Glasser
11ab8edaa9 releaseFile.setRelease should be in-memory only
This will let us try several times for 'meteor update' and not write
until success.
2014-11-25 09:06:23 -08:00