Skip to content
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

Even better model panics #1721

Merged
merged 9 commits into from
Mar 27, 2023
Merged

Conversation

IamTheCarl
Copy link
Contributor

Finishes off the last changes needed to resolve #1569
Yes it even cleans up the syn AST stuff.

image

My only complaint is that the stack trace is really long but I don't think there's much we can do about that at this time.

@IamTheCarl
Copy link
Contributor Author

I'm not experienced with CI so I have to ask, these checks that seem to run with every commit I make, they don't cost you extra money every time I trigger them, right?

I'm working on fixing that merge conflict.

@IamTheCarl IamTheCarl changed the title Better model panics Even better model panics Mar 24, 2023
@hannobraun
Copy link
Owner

Thank you for the pull request, @IamTheCarl! I'll take a look soon (most likely later today).

A note: I generally prefer rebase over merge to fix conflicts, because all those merge commits end up making the pull request harder to review for me. A merge tends to make more sense, if I've already reviewed a pull request, but more changes were necessary (because then I can just ignore the previous commits and focus on the new commits when I review again). This is documented in CONTRIBUTING.md ([1], [2]).

I'm not experienced with CI so I have to ask, these checks that seem to run with every commit I make, they don't cost you extra money every time I trigger them, right?

It doesn't. CI resources are provided by GitHub for free, fortunately.

It still makes sense to keep CI usage down, to not waste resources, to not compete with other ongoing builds (number of concurrent builds per project is restricted, I believe), and not least for your own convenience (CI turnaround times are annoyingly long). You can do most of what the CI build ends up doing locally, by running just ci (also documented in CONTRIBUTING.md).

@hannobraun
Copy link
Owner

Ah, I forgot to comment on something.

My only complaint is that the stack trace is really long but I don't think there's much we can do about that at this time.

Yeah, don't worry about that. It's better to have stack traces, because once we have them, we can improve upon them. I already have some ideas, like expandable status messages (#1496).

Copy link
Owner

@hannobraun hannobraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pull request, @IamTheCarl, looks good!

I left one comment that I'd like to see addressed. And since I'm already requesting changes, I don't see that leftover debug message being removed. That would be nice too.

Other than that, this is good to go!

Comment on lines 151 to 162
let attrs = item.attrs;
let vis = item.vis;
let sig = item.sig;
let statements = item.block.stmts;

let item = quote::quote! {
#(#attrs)* #vis #sig {
fj::abi::initialize_panic_handling();
#(#statements)*
}
};

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to be adding the new and improved code here, without removing the old and busted one. initialize_panic_handling says it can be called multiple times, but I think that's not enough reason to keep the old code around 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I Had removed the old version and that println but for some reason merging brought a lot of the old stuff back. I missed those two.
I'm going to have to give this re-basing thing a try.

I'll try to fix that up today.

@hannobraun
Copy link
Owner

Looks good to go now! Thank you, @IamTheCarl!

@hannobraun
Copy link
Owner

Hmm, this pull request was no longer up-to-date with the main branch. GitHub wouldn't let me rebase, because there supposedly were conflicts, but merging worked without issue. Ah, whatever. I'm sure I could have rebased locally, but this is good enough 😄

@hannobraun hannobraun merged commit f091a4c into hannobraun:main Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print stack trace for panics that originate in model code
2 participants