Closed ginty closed 4 years ago
a lot of good work on this PR @ginty , I am reviewing the changes you have made , primarily to increase my understanding of rust.
@coreyeng, any objection to merging this?
I've built my prog gen branch on top-of this and would like to open a PR for that soon to handle it in manageable pieces rather than dumping a huge change at the end.
Ah, sorry. I didn't have a chance to look at it when it was first opened and its slipped my mind since.
Nope, no objection from me! Looks good!
Sorry about the size of this, another update that should have been fairly self-contained but which ended up requiring a lot of tangential infrastructure...
This adds a new global Origen command called
origen proj
which is for creating workspaces/views of a project comprised of multiple packages which can each be pulled from Git, DesignSync, a symlink, or a tarball and potentially other revision control tools in future.Potential applications include things like building a test program directory from a collection of sub-blocks. The features of the command are likely to continue to evolve for a while as driven by use cases.
I held off documenting it until the doc system is available, but I'll demo at the core team this week and in a nutshell:
To enable this command quite a lot of basic infrastructure has been added and/or improved:
Macros
origen::macros
and loaded that first. Everything in there is available everywhere inorigen
,cli
andpyapi
.exit_success!()
,exit_pass!()
,exit_fail!()
andexit_error!()
error!
macro to generate anorigen::Error
, typical use example:Logger
log_trace
for really low level stuff, thinkprintln!("I am here")
type statements for debugging. This level is currently unique in that it doesn't appear in the logfile by default and only when the highest verbosity is enabled. All other log items always appear in the log file regardless of the console log level.println!()
for all log levels and also a macro calleddisplayln!()
which is just likeprintln!()
but which will also write to the log in addition to the console. See here for documentation on the log macros - https://github.com/Origen-SDK/o2/blob/0839b160bcf0ee2c5ef85e774069665aa66da138/rust/origen/src/utility/logger.rs#L1-L54User Model
origen::USER
.password-cache
.Revision Control API
RevisionControlAPI
trait that all drivers should support - https://github.com/Origen-SDK/o2/blob/548650f8ed8e7b774ccf072f6e935dac2a67d6e0/rust/origen/src/revision_control/mod.rs#L46dssc
command and captures and processes the output.Utilities
I made a top-level utility module and generally I think a lot of what is currently in
origen::core
could move into here in due course withorigen:;core
eventually becomingorigen::model
.There's quite a few useful helpers for working with files and dirs in
origen::utility::file_utils
- https://github.com/Origen-SDK/o2/blob/548650f8ed8e7b774ccf072f6e935dac2a67d6e0/rust/origen/src/utility/file_utils.rsutility::command_helpers
contains functions for logging STDOUT and STDERR from child processes - https://github.com/Origen-SDK/o2/blob/548650f8ed8e7b774ccf072f6e935dac2a67d6e0/rust/origen/src/utility/command_helpers.rsI also moved logger into
origen::utility
since I was working on it.General Points of Interest
origen c
command could be interesting and which uses TOML or other config files for the parameters.When writing this README I learned that if you type
y
when looking a file in Github it turns the url into a permalink, good for links in PRs like this!I think there might be some conflict with #107 due to some of the file moves in here, but I'll take care of that once that is merged.