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

feat(decompression): improved ACL asserts when initializing a decompression_context #505

Merged
merged 3 commits into from
May 5, 2024

Conversation

Yusuf-PG
Copy link
Contributor

After running into an issue where ACL was failing to initialize the decompression_context, I noticed that ACL already has the info for why the initialization failed in the error_result, we just weren't showing it in the assert

Small change to the initialize and relocate functions that adds more useful info to the asserts when possible

@CLAassistant
Copy link

CLAassistant commented Apr 26, 2024

CLA assistant check
All committers have signed the CLA.

@Yusuf-PG
Copy link
Contributor Author

Sorry, only just realised that ACL targets C++11! I'll need to rewrite this to not use if constexpr

ACL_ASSERT(is_valid, "Invalid compressed tracks instance");
const error_result error = skip_safety_checks ? error_result() : tracks.is_valid(false);
const bool is_valid = skip_safety_checks || error.empty();
ACL_ASSERT(is_valid, "Invalid compressed tracks instance: %s", error.c_str());
Copy link
Owner

Choose a reason for hiding this comment

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

Minor tweak: we can't rely on '%s' as a format specifier because hosts can override the assert macro and might expect a unicode string when %s is present. To support this, we have to use ACL_ASSERT_STRING_FORMAT_SPECIFIER instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @nfrechette! This should be fixed now - I assume there isn't anything similar for %u I need to use?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, that's correct. Thank you!

@nfrechette nfrechette changed the title Improved ACL asserts when initialising a decompression_context feat(decompression): improved ACL asserts when initializing a decompression_context Apr 28, 2024
@nfrechette
Copy link
Owner

Good stuff! Thank you for the contribution.
It looks like appveyor CI is failing because the VM instances are slower than before, somehow and we time out. We'll ignore it for now and I'll see if I can fix that later.

@nfrechette
Copy link
Owner

Apologies for the slow reply, once CI completes, I'll merge this.
Thank you for your contribution, it is much appreciated :)

@nfrechette nfrechette added this to the v2.2 milestone May 2, 2024
@Yusuf-PG
Copy link
Contributor Author

Yusuf-PG commented May 2, 2024

@nfrechette it looks like appveyor might have timed out again? Seems like all the individual builds passed

@nfrechette nfrechette merged commit 1a56f72 into nfrechette:develop May 5, 2024
96 of 97 checks passed
@nfrechette
Copy link
Owner

Yeah, appveyor has been struggling. The builds had been hovering around 50-55mins for some time now, and it looks like a configuration change on their end pushed it over the 1h limit. I'll have to disable some of the slower tests with the older vs2015 toolchain which is fine since it's so ancient now.

Thank you for the contribution!

@nfrechette
Copy link
Owner

@all-contributors add @Yusuf-PG as code

Copy link
Contributor

@nfrechette

I've put up a pull request to add @Yusuf-PG! 🎉

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.

3 participants