-
Notifications
You must be signed in to change notification settings - Fork 198
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
Prep patches for supporting container overrides #3365
Conversation
As it doesn't by default today, even in a container.
Now clearly we should have *much* more useful information here, but this is a start.
There may be a serde bug going on here. But I think this is fallout from coreos@72a6a77 Basically we have `#[flatten]` in 3 places; in both the `base` and `derive` structs, *and* the `base` struct has the `extra` member. It seems that order matters here. In order to parse the derive config fields, it needs to be earlier in the struct. I am at this moment a bit uncertain why this didn't break other cases. But this is prep for supporting `override-remove` in `ex rebuild` too.
// TODO use cap-std-ext's https://docs.rs/cap-std-ext/latest/cap_std_ext/dirext/trait.CapStdExtDirExt.html#tymethod.open_dir_optional | ||
let p = Path::new(CLIENT_TREEFILES_DIR); | ||
if !p.exists() { | ||
return Ok(either::Left(std::iter::empty())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't follow what either
is used for here. Is this just a sneaky way to avoid having to write out the actual chained iterator type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A return value of impl T
must have exactly one type determined at compile time. Now, one can return e.g. Box<&dyn T>
which does dynamic dispatch.
More at https://internals.rust-lang.org/t/extending-impl-trait-to-allow-multiple-return-types/7921
either
is just a convenient enum for returning at most two different types from a function - encapsulated as a single type.
It implements Iterator
if both of its element types do, and delegates to them.
Trying it out:
|
This is prep for work on #3364
treefile: Don't bail out if
/etc/rpm-ostree
doesn't existAs it doesn't by default today, even in a container.
ex-rebuild: Print something in the case where we found no files
Now clearly we should have much more useful information here,
but this is a start.
treefile: Fix parsing of derived config fields
There may be a serde bug going on here. But I think this is
fallout from 72a6a77
Basically we have
#[flatten]
in 3 places; in both thebase
and
derive
structs, and thebase
struct has theextra
member.It seems that order matters here. In order to parse the derive
config fields, it needs to be earlier in the struct.
I am at this moment a bit uncertain why this didn't break other
cases.
But this is prep for supporting
override-remove
inex rebuild
too.