Repository navigation
Leave the engine self-tests out of the APK - #269
Merged
Merged
Conversation
The self-test sources were about 40% of libhttrack's compiled code, and nothing in the app can reach -#test, which is the only entry point that runs them. Engine #2036 added the HTS_NO_SELFTEST guard around that call site, so define it here and drop the 24 self-test sources from the libhttrack source list. Both halves are needed. A self-test source compiled under the macro fails on the #error in htsselftest_int.h, and defining nothing while the sources are gone leaves hts_selftest undefined at link time. Measured on a release build at pin b0972289: the unsigned APK falls from 24430732 to 22612108 bytes, libhttrack.so from 8619880 to 7732952 on arm64-v8a and from 8943032 to 8015128 on x86_64. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
The review found the earlier comment overclaimed. A user can reach -#test by typing it into the Scan Rules field, which passes its tokens through unfiltered, so say the app never asks for a self-test instead. It also found the one real weakness: this repo now knows which engine sources are self-tests, and nothing links the two lists. Re-adding one of today's self-tests fails to compile on the #error in htsselftest_int.h, but an engine that later adds a self-test without that header would come back silently. So read the engine's own "if SELFTESTS" block and assert our source list shares nothing with it. Mutation-checked: adding htsopt_selftest.c back to the list turns the test red. TestSources gains the flattened Android.mk reader CodeqlScopeTest had, so the two tests parse the makefile the same way. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The engine's self-tests were about 40% of its own compiled sources, and the app never asks for them. So the build defines
HTS_NO_SELFTEST, which engine #2036 added for this, and drops the 24 self-test sources. The unsigned release APK falls from 24430732 to 22612108 bytes, andlibhttrack.soloses about 10% on both ABIs.Typing
-#testinto the Scan Rules field used to reach the self-test dispatcher, because that field passes its tokens through unfiltered. The engine now prints a refusal, and neither path ever crawled.The new test holds the engine's own
if SELFTESTSlist against the oneAndroid.mkbuilds, because nothing else links them.