Skip to content

Conversation

Rexogamer
Copy link

@Rexogamer Rexogamer commented Aug 1, 2025

Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

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

Hi @Rexogamer, thanks for submitting this PR as well as providing some context.

Could you please specify what's the exact problem that this PR tries to solve?

Looks like react-native uses the same flags but passes --build-id instead of --build-id=none: https://github.com/facebook/react-native/blob/87749470ccf596c5b3bc06fe46ba3239b684fd1b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt#L33

I think we can skip the comment and leave only the add_link_options(-Wl,--build-id) part if that helps.

Comment on lines +14 to +19
// Turn off build IDs for reproducibility (ensuring the same code will produce the same bundle when built)
// See https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids
// for more information
add_link_options(
-Wl,--build-id=none
)
Copy link
Member

@tomekzaw tomekzaw Aug 4, 2025

Choose a reason for hiding this comment

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

Suggested change
// Turn off build IDs for reproducibility (ensuring the same code will produce the same bundle when built)
// See https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids
// for more information
add_link_options(
-Wl,--build-id=none
)
add_link_options(-Wl,--build-id)

Comment on lines +14 to +19
// Turn off build IDs for reproducibility (ensuring the same code will produce the same bundle when built)
// See https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids
// for more information
add_link_options(
-Wl,--build-id=none
)
Copy link
Member

@tomekzaw tomekzaw Aug 4, 2025

Choose a reason for hiding this comment

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

Suggested change
// Turn off build IDs for reproducibility (ensuring the same code will produce the same bundle when built)
// See https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids
// for more information
add_link_options(
-Wl,--build-id=none
)
add_link_options(-Wl,--build-id)

@Rexogamer
Copy link
Author

the comments were added based on the feedback on the RNGH PR, but I don't mind removing them if you'd prefer that.

the links explain the issue but tl;dr these build IDs mean the app provides a different output when compiled, even if everything code-wise is the same. this causes issues for apps that want to be "reproducible" (i.e. when built, they'll be identical if the code is the same - which can help to determine whether the app has been secretly tampered with or similar).

the core line is strange - I ultimately left it alone for my patching because I got everything working without needing to touch it, but I too am curious if there's any reason they chose to include it.

@tomekzaw
Copy link
Member

tomekzaw commented Aug 6, 2025

Thanks for additional explanation. I don't see a reason why third-party libs should use --build-id=none while react-native uses the opposite (i.e. --build-id), it seems a bit weird. Once we have an answer, we can reconsider merging this PR.

@Rexogamer
Copy link
Author

I'll mark this as a draft and see if there's a reason why RN sets this flag

@Rexogamer Rexogamer marked this pull request as draft August 6, 2025 10:01
@Rexogamer
Copy link
Author

update: facebook/react-native#53089 has been merged, so this PR probably isn't needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants