| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was previously a private method of the branch and merge
plugin, but it's useful to other plugins, so has been moved to the
SystemBranchDirectory class, where everything else can get to it.
It has an unpleasant amount of coupling to other classes, but in a *good*
object oriented design it would either be a tiny module on its own,
or not exist and leave all its users to re-implement the same logic
multiple ways, so we've opted for a less clean, but more useful design.
It is left un-covered by the unit tests, since it requires a great deal
of instrumentation to test, at which point it may be best to leave it
to integration tests.
|
| |
|
|
|
|
|
|
|
|
| |
This is used to split a large iterable into more manageable chunks.
This is important when a consumer can only handle so much input at once
e.g. A program can take a large, but finite number of arguments, xargs
exists to handle this for shell programs.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug was triggered by the fix to CachedRepo.resolve_ref and without
this fix, the resolve_ref fix will break the test suite.
The bug is that log_dict_diff calls the status method with an msg
keyword argument that may contain percentage characters. status
interprets the value of msg as a format string, and the percentage
characters trigger formatting to happen.
The fix for that is to not interpolate the value of key and dictA[key]
and dictB[key] into msg before calling status, but letting status
do that. Thus the msg values are changed to reference %(key)s instead
and passing in a value for key as a separate argument. Ditto for
dictA[key] and dictB[key].
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The workspace needs to be able to list all its system branches, and the
system branches need to be able to list all their git repositories.
This is broadly the same thing, just with a different directory to look
out for, so provide that utility in morphlib.util.
find_leaf() is rewritten to use find_leaves(), this is less efficient
since it waits until every leaf is found.
I felt it was better to reduce the code than maintain a slightly more
optimal algorithm.
The find_leaf() algorithm could become more optimal if it could lazily
check for at least one result in a generator.
|
|
|
|
|
|
|
|
|
| |
This will be useful in the next commit, where we want
to construct an environment to run a command from a
dictionary.
The cliapp runcmd method expects that the values in this
dictionary are strings, so we need to convert them before.
|
| |
|
|
|
|
| |
It is now a tested helper function in morphlib.util
|
|
|
|
|
|
|
| |
These will be used to find workspace and system branch root directories.
Also accidentally removed some whitespace from ends of lines. Too lazy
to split that into a separate commit.
|
|\
| |
| |
| |
| |
| | |
'origin/baserock/richarddale/check-repo-alias-option'
Reviewed-By: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
| |
This has no tests, as the ability to run them requires root privilidges
or a more recent kernel and user namespace support.
|
|
|
|
| |
ciapp is not imported, but morphlib.Error is an appropriate exception
|
|
|
|
|
| |
Ensure that trove-id meets the same requirements as repo aliases in terms of
naming.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Define a specific set of 4 architectures that Morph supports, and only
expose that value to morphologies.
Since GNU triplets are very common we also expose a GNU triplet. Other
morphologies should work out their configuration based on MORPH_ARCH.
This commit also removes the morphlib.util.arch() function, which
detected the machine Morph is running on via 'uname -m'. Morph's
architecture names do not necessarily map to the output of 'uname -m'
so we should not rely on it anywhere.
|
|
|
|
|
|
| |
In the future we will allow this to be modified to provide a
cross-bootstrap mode, but for now we use the same target as
the host compiler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reorganise the build_artifact() and build_artifacts() functions to
allow more complex work when setting up chunk builds in
build_artifact().
The staging area now holds the BuildEnvironment object (the
environment variables that should be set during build). This makes sense
because all build commands should be run inside the staging area and
therefore through the StagingArea object.
The BuildEnvironment object is now considered immutable after it is
created. The environment is used in cache key computation when
computing what artifacts are required; if it changes after that point
we risk either computing different artifact keys for the same artifact
or missing data in the cache key that should be included in the hash.
Better to force changes into a separate 'extra_env' variable.
|
|\
| |
| |
| |
| |
| | |
'origin/baserock/richardholland/environment-logging' into staging
Added a "pragma: no cover" to make the test suite pass.
|
|/
|
|
|
|
|
|
| |
Added function log_dict_diff to identify and record changes in dicts
to the debug log
This new function was then implemented in app.py to log changes in the
environment
|
| |
|
|
|
|
|
|
|
|
| |
This way everyone who needs json or an OrderedDict doesn't have to worry
about it.
Currently morph2 is the only one that needs this complex behaviour,
other users of the json module don't need object_pairs_hook.
|
| |
|
|
|
|
|
|
|
| |
This makes a non-backward-compatible change to morph which switches it to using
tarballs instead of bundles when initialising cached git repositories. This is
faster because it doesn't require index-pack --fix-thin operations on the
machine running morph.
|
|
|
|
|
|
|
|
|
|
|
| |
Trove has a fixed structure for repositories and prefixes. By taking advantage
of this, we can simplify the repo-alias configuration in morph somewhat and
thus make it easier for others to add their own aliases and prefixes later,
without worrying that they'll miss out on default ones created by the Baserock
team.
We override process_args in the application class to achieve this because
cliapp's setup() hook is not quite right for our purposes.
|
|
|
|
|
|
|
|
|
|
|
| |
Code for creating caches is repeated through the codebase because
there wasn't a useful function for creating caches.
Now the functions in BuildCommand have been moved into morphlib.util,
where they will be more usefully reachable.
Stubs have been left in BuildCommand so they can be overridden by
subclasses of BuildCommand and not break external plugins.
|
|
|
|
|
|
|
|
|
| |
This was done with the aid of the pep8 script, available by running
`easy_install pep8`.
It may be worth making this part of ./check, but that will require
putting pep8 into the development tools stratum.
This should be easy, given pep8 has no external dependencies.
|
| |
|
| |
|
| |
|
|
|
|
| |
This can happen when we run morph in a chroot without /dev/urandom
|
| |
|
| |
|
|
|
|
| |
This makes it easy to add a test case.
|
| |
|
| |
|
|
|