summaryrefslogtreecommitdiff
path: root/morphlib/plugins/build_plugin.py
Commit message (Collapse)AuthorAgeFilesLines
* Avoid creating and pushing temporary build branches when they aren't necessary.Richard Maw2014-08-121-32/+7
| | | | | | | | | | | | | | | | | | | | | Sorry about the big lump, I can split it into a nicer set of changes, but they didn't naturally emerge in a nice series. This creates a pushed_build_branch context manager, to eliminate code duplication between build and deploy. Rather than the build branch being constructed knowing whether it needs to push the branch, it infers that from the state of the repositories, and whether a local build would be possible. If there are no uncommitted changes and all local branches are pushed, then it doesn't create temporary branches or push them, and instead uses what it already has. It will currently create and use temporary build branches even for chunks that have no local changes, but it's pretty cheap, and doesn't require re-working the build-ref injection code to check whether there are local changes.
* Turn BuildBranch methods into regular functionsRichard Maw2014-08-121-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | Previously they were generator functions, which yielded interesting context at interesting times so that the caller could respond by printing status messages. The only benefits this had over callbacks were: 1. 1 fewer function scope to worry about. I don't have data on the amount of memory used for a function scope vs a generator, but it could be less cognitive load for determining which variables are defined in the callback's body. 2. It is possible to yield in the caller, so you could make that into a coroutine too, however this wasn't required in this case, as the yielded value was intended to be informational. The downsides to this are: 1. It's a rather peculiar construct, so can be difficult to understand what's going on, and the implications, which led to 2. If you call the function, but don't use the iterator it returned, then it won't do anything, which is very confusing indeed, if you're not used to how generator functions work.
* Use exact filenames to refer to morphology filesRichard Maw2014-07-101-7/+8
| | | | | | | | | | | | | | | | | | | Rather than repeatedly stripping and appending an optional .morph extension morphology names, instead always use the file path of the morphology relative to the definitions repository. This is an inversion of the previous logic, which would strip the .morph extension and use the "name" internally. The exception to this rule of always using the filename, is that `morph edit CHUNK` uses the name of the morphology as-defined in the stratum. This is based off Adam Coldrick's inital patch, but this version will allow the old style of providing the "name" by converting it into a path if it does not have either a / or a . in it. An unfortunate consequence of this change is that the show-dependencies command's output changed, so the test needed updating.
* Add distbuild-morphology command.Sam Thursfield2014-05-141-0/+23
| | | | | | | | | This is useful to build releases using distbuild. It avoids having the SHA1 fields in the artifact metadata files pointing to commits that exist only on temporary build branches. It also avoids file:// URLs in the repo fields. Note that the repo URL still points to the Trove used by the distbuild network, rather than being an upstream URL pointing to git.baserock.org.
* UI change: distbuild has its own subcommandRichard Ipsum2014-03-261-7/+39
|
* Modify morph to strip .morph extensions from parametersBen Brown2013-12-161-1/+1
|
* plugins: Use new build command as defaultRichard Maw2013-11-291-1/+1
| | | | The old build is still around for comparison.
* plugins: Add new build commandRichard Maw2013-11-291-0/+92
| | | | | | This uses all the new APIs, so the code is shared across morphlib and unit tested rather than everything being in one massive plugin that is only black-box tested.
* Improve docstring for "morph build-morphology"Lars Wirzenius2013-07-051-3/+20
|
* S7904: Add disk space checks before build & deployRichard Maw2013-06-051-1/+8
| | | | | | | The same check that cachedir and tempdir are large enough is used for both build and build-morphology. Deploy only checks for tempdir being large enough.
* Improve command descriptions in --helpSam Thursfield2012-10-261-8/+3
| | | | | Make sure all commands have one line of description, and reduce the size of some which had large amounts of text.
* Rename 'morph build' command to 'morph build-morphology'Jannis Pohlmann2012-09-071-2/+2
| | | | | | | | | | This is needed because we are replacing the current build command by a new one that builds from a local system branch. Since that will be the more common scenario, we want the new implementaiton to go by the name 'morph build'. This commit therefore renames 'morph build' and updates all the tests to use 'morph build-morphology' instead.
* Move cmd_build to a separate pluginRichard Maw2012-08-011-0/+47
It's such a small amount of code, it's possibly not worth it, but now all commands are in plugins.