-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: add build check to ManagedEnvironment::{push,push_new} #832
Conversation
cli/flox-rust-sdk/src/models/environment/managed_environment.rs
Outdated
Show resolved
Hide resolved
cli/flox/src/commands/environment.rs
Outdated
@@ -1198,6 +1199,11 @@ impl Push { | |||
To rename your environment: 'flox edit --name <new name>' | |||
To pull and manually re-apply your changes: 'flox delete && flox pull -r {owner}/{name}' | |||
"}.into(), | |||
ManagedEnvironmentError::Build(_) => formatdoc! {" | |||
❌ Unable to push environment with compatibility errors on your system ({system}). |
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.
nonblocking product nit @ghudgins @jennymahmoudi: I don't think I would know as a user what compatibility errors
means. And because we're suppressing the underlying error, I don't actually know what to do next. I can't start with flox edit
; I'd actually have to flox activate
to see the error, and then do flox activate && flox edit && flox push
.
Also compatibility errors
makes it sound like it's a system specific issue, but this is the same error I get if I do:
flox init
# edit the manifest and misspell a package name
flox push
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.
I agree with the concerns reg. "compatibility".
The way its implemented now its ensuring that the environment can build on the current system.
I don't know if it becomes much clearer with the error present
(-v
will show it FYI)
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.
the AC calls to show both errors
And When the env fails to build
Then I see the failure from the build
And I see a message about push
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.
ok to add the error in a somewhat raw form now (and later/soon use the prettyfied version)?
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.
yes - we'll redo the error in a future ticket #602
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.
Also compatibility errors makes it sound like it's a system specific issue, but this is the same error I get if I do:
flox init
# edit the manifest and misspell a package name
flox push
Is this still a valid concern?
Can we have separate error messages for flox push
due to system compatibility issues vs misspelled package names?
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.
Yeah it's still a concern. At the moment I don't think it would be very easy to have a different message, but we could come back to that when we re-work our errors. Until then I think it would be simplest to say Unable to push environment that doesn't build
or whatever word we're currently using for build
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.
Ok I think it's fine to continue to use build since that's already being propagated through in the other error message.
Unable to push environment with build errors.
ManagedEnvironmentError::Build(_) => formatdoc! {" | ||
❌ Unable to push environment with compatibility errors on your system ({system}). | ||
|
||
{err} |
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.
The actual error still isn't getting printed:
ERROR: ❌ Unable to push environment with compatibility errors on your system (aarch64-darwin).
could not build environment
Use 'flox edit' to resolve errors, test with 'flox activate', and 'flox push' again.
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.
Well it is just not the helpful bits...
Fixing this tomorrow
Just wondering if we should display the entire chain or not just the root cause (esp. for these pkgdb ones).
Leaning towards the latter
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.
I bet we'll come back and change it anyways when we rework errors, so either's probably fine for now
Update cli/flox-rust-sdk/src/models/environment/managed_environment.rs Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com>
10e2681
to
151c705
Compare
https://github.com/flox/flox/actions/runs/7639418966/job/20812508062?pr=832#step:6:188 look like regressions form then upgrade to nixpkgs 23.11 |
151c705
to
3dad968
Compare
the string isn't matching up yet |
I think it's actually a regression from this PR. Prior to this PR, the first time the environment was built was at the line:
where
should fix it. Or you can invert all the |
thanks, yes that makes sense, added the |
@ghudgins moved the build error to the top (i guess that's what you were referring to? |
when I ran it, it didn't match the AC. I would want to see the error from the build and then an error underneath about the push with this text.
|
I thought we had decided on the build error is now above the other stuff there is some formatting/indentation weirdness but that's going to be fixed with the bigger logging/error polish |
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.
LGTM
implements #825