-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata Files and Associated Verbs #80
Conversation
This looks awesome @jbohren, I appreciate you taking the initiative to work on this. I have been wanting to do it for a while, but I am currently caught up in more low level refactors. I was thinking about the metadata file and the workflow, and it may be that something like the config based verb's, which is similar to how At the time, I was focused on implementing a replacement for cmi, but I don't think it is unreasonable to redesign the workflow now that we have an working tool. I could imagine something more like this:
I'm not 100% convinced of the common convenience of this workflow, but maybe some smoothing of edges around it could make it convenient, like having |
Yeah, I was also thinking something similar. As it currently stands, the following are true:
An alternative to using a single yaml file is to use a |
I agree that having a folder with multiple files is better. |
Done in f4696d2. |
With the new
|
This will require a rebase. |
I figured as much. |
Now featuring |
…an empty marker file
…ols metadata file
- Metadata is stored in a `.catkin_tools` directory with a simple README file - Individual yaml files are used for verb-sepcific metadata. I.e. `catkin build` creates/updates the file `.catkin_tools/build.yml` - When initializing the metadata directory, the metadata module checks to see if that directory is contained within another catkin_tools-based workspace.
I get the following with this PR:
|
Sorry about that, should be fine again now if you call build without having first called |
Yeah I just noticed that init was necessary. I know this is still wip, but here a few initial comments:
But great stuff overall, thanks for working on this! |
Thanks for the feedback! |
This PR has many +1's for me! There are several features that I already use via aliases, so I'll be happy to switch to a more standard version. Thanks @jbohren |
@wjwwood One thing that would be nice is to not have to specify the various keys which get stored in metadata explicitly. There's a lot of logic in |
One more point that just popped to mind: We have discussed multiple named configs in one workspace before (Release, Debug, x-compiling, ...). While for most users this is maybe not so relevant and implementing it is a low priority, if we introduce this config directory now, we might as well lay it out in a way with named "profiles" in mind. I'm thinking something like this layout:
I.e. As long as we named profiles are not implemented the init command could create such a folder layout, which might allow to seemlessly transition to named profiles later on:
(I'm not attached at all to how this is layed out exactly) |
(caveat: this PR already contains a lot of useful stuff. I don't want to extend its scope too much. We might rather get it merged and then open new issues to track possible improvements like I suggest in the following). If I understand correctly, you currently propose to have verb-specific metadata files in the I guess implementing this goes together with allowing multiple verbs to share part of their CLI argument definitions and parsing (i.e. all verbs that operate on source/builld/result spaces, all verbs that take packages are arguments, all verbs that take the |
I like this whole concept a lot, even so much as to rename "metadata" as "profiles".
As it currently stands, there's nothing preventing code from reading or writing an arbitrary yaml file in the metadata directory. The way I see it, verbs will likely read each-others metadata, but we should encourage verbs to only write to their own file. |
I wouldn't make the |
I agree. I didn't mean to suggest that. I was just saying that right now the It's also onerous to have to convert the spaces between relative (for config file) and absolute (for |
This is why I originally proposed separate commands for configure and build, because if you look at it as a configuration command then |
Yeah, I think this is still a good idea. Looking at the arguments that you can pass to Configure:--source Behavior:packages |
Yeah, and it works out that the configuration options are mostly in the Context object, so I sort of organically ended up with that separation. The two that don't line up with your list above are The |
262a8ac
to
5d09c1a
Compare
5d09c1a
to
a69725f
Compare
I think my unit tests have uncovered a huge bug when using catkin_tools with Python 3 where |
67e2ba9
to
139a3a3
Compare
139a3a3
to
8475598
Compare
Woot. @wjwwood Tests passing in https://travis-ci.org/catkin/catkin_tools/builds/36103845 |
Nice. |
Metadata Files and Associated Verbs
Great work @jbohren, can't thank you enough for investing the time in this 😄 |
Merge might have been a bit premature, the python3 compatibility is there, but now the verbose debug isn't displaying newlines correctly. I think you might be able to just use the "revert" button, otherwise, I can make a new PR. |
Lets make a new pull request/issue. |
Also, unless you are actively using it with Python3 you might just wait on that. I plan on switching over to the subprocess stuff I have in osrf_pycommon, and I went to some effort to make sure that works on Windows and Python3 and everything other corner of the matrix. |
Opened #93 which fixes it. Just needed to find the portable way to do it. |
Also as an aside, writing 2-3 portable python code is a huge pain. |
@wjwwood Is there anything preventing the readthedocs job from running? |
I just have to poke it, doing that now. Actually it is already done: http://catkin-tools.readthedocs.org/en/latest/ |
This MR suggests that an option |
Overview
_See documentation for the changes pending here: http://jbohren-ct.readthedocs.org/en/metadata-file/index.html_
This PR (wip) covers a multitude of usability improvements to catkin_tools. This is in part motivated by features which used to be supported by
rosbuild
such as context-aware building and partial cleaning of the workspace.The key architectural feature of this patch is the creation of a metadata directory called
.catkin_tools
in the root of a catkin workspace. This directory is not only used by the verbs to determine the location of the root of the workspace, but also it is used to store persistent information between builds. The API for interacting with this information is presented below.The information stored in the
.catkin_tools
directory is contained in independent "configuration profiles" between which a user can switch without having to create multiple workspaces or do his or her own bookkeeping of command-line arguments.Another focus of this patch is the organization and clarification of the command-line interface to catkin_tools verbs. This involves the addition of argument groups and the re-organization of arguments between verbs. For example, several of the "workspace configuration" arguments like the specification of source, build, and devel spaces have been moved from
catkin build
tocatkin config
. This simplifies the parameters tocatkin build
and makes it easier for newer users to figure out the important command-line options.This patch also adds several new verbs which take advantage of this metadata utility.
Example Workflow
This PR currently enables an initialization and build workflow like so (try it yourself):
Some cool context-aware aliases that this PR curently enables:
Related Issues
Once complete, this PR should address the needs of the following issues:
clean
verb.catkin build
with a buildspace created bycatkin_make
catkin_tools
moduleIRC Discussions
TODO(NE)
init
verb to mark a directory as a catkin_tools workspaceclean
verb which deletesbuid/
,devel/
and re-initializes.catkin_tools.yml
--cmake-cache-only
argument tocatkin clean
info
verb to dump workspace informationconfig.yml
file undercatkin_tools
which lists the default profileprofile
orconfigure
verb or something similar for managing profilesseparate "configuration-like" arguments out ofbuild
verbconfigure
verb to set build configuration without actually building--this
argument tobuild
to build the package defined by the currently-enclosing directoryContext
class (includes separating out verb-independent functionality ofcommon.py
,color.py
andrun_unix.py
)requireconfig
/init
call to usecatkin build
with stored configuration.catkin_build
marker ifbuild
config
orinit
are calleddon't store cmake/make args (for now)catkin config
catkin -h
catkin info
verb (duplicate behavior withcatkin config
) this will be resurrected later in timeremoveleave incatkin init
verb (duplicate behavior withcatkin config
) -- replace with alias toconfig --init
catkin init
havedon't add directory-creating functionalities, maybe at some point later add acatkin config --init
create directories like source spacecatkin mkspaces
for making the source space dir--workspace
and--profile
arguments work with all verbscatkin clean
display help if run with no arguments--start-with --this
so that you can runcatkin build --this --start-with foo_pkg
catkin init
(likeinitialized empty catkin workspace in...
) and thenTo build your workspace blah blah...
)CMAKE_PREFIX_PATH
persistence in contextOther Ideas
catkin build --from-paths DIR
argument for building all packages in a directoryConfiguration Profile (Metadata) Details
.catkin_tools
directoryprofiles.yml
file describing the active profile (if different fromdefault
)catkin build
creates/updates the file.catkin_tools/<PROFILE-NAME>/build.yml
catkin init
), the metadata module checks to see if that directory is contained within another catkin_tools-based workspace.See https://github.com/jbohren-forks/catkin_tools/blob/metadata-file/catkin_tools/metadata.py for metadata API documentation.