Merged
Conversation
880c396 to
f5b45b6
Compare
jdm
approved these changes
Nov 19, 2025
83f7fa6 to
32c419a
Compare
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Assertions .h is also included in `c` files, so using namespaces is not an option to avoid the collision. js::LogLevel, collides with the hilog LogLevel enum. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
32c419a to
79183e7
Compare
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Member
Author
|
Todo: add ci configuration for ohos with debugmozjs |
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Member
Author
|
This PR did change a bit since the initial review, so it might make sense to be reviewed again. I'm not super happy with inlining the function declaration in every file it is used, but I don't think it would make the patching easier, if I wrapped the logging in a new header file. |
jschwe
added a commit
to jschwe/mozjs
that referenced
this pull request
Nov 25, 2025
* Fix OHOS define Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix indentation Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Avoid name collision by not importing header Assertions .h is also included in `c` files, so using namespaces is not an option to avoid the collision. js::LogLevel, collides with the hilog LogLevel enum. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix vprintf impl Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Update patches Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Bump mozjs version Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Completely inline function declaration Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * ohos: Add debug-mozjs ci configuration Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> (cherry picked from commit dfae36e)
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 26, 2025
* Fix OHOS define (#666) * Fix OHOS define Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix indentation Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Avoid name collision by not importing header Assertions .h is also included in `c` files, so using namespaces is not an option to avoid the collision. js::LogLevel, collides with the hilog LogLevel enum. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix vprintf impl Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Update patches Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Bump mozjs version Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Completely inline function declaration Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * ohos: Add debug-mozjs ci configuration Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> (cherry picked from commit dfae36e) * Fix visibility in declaration Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Add a CI test that ensures ohos binaries can link Compiling the unit-tests assures, that linking succeeds. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Bump version again Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Remove system headers patch Not needed anymore, since we don't include this file. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.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.
Extracted from #583.
target_is_ohoswas not working as expected. This presumably originated in a seemingly harmless suggestion,but surprisingly the expected return type / values for these functions is
True | None, and notTrue | False(The other functions liketarget_is_xxdon't return anything explicitly if theifdoes not match, which results in aNoneimplicitly I guess). ReturningFalsedoes not give the expected result. I noticed this while working on #583 - normally logs are still visible in servo, since we setup a thread that redirects output from stdout / stderr to the logging system on ohos (except in production mode).Fixing the ohos define also revealed some issues with the patches:
LogLeveldefined inhilog/log.hcollides with aLogLevelin thejsnamespace. Some of the header files we included hilog in, have this collision, and are also used from C files, so we can't just namespace the import (without the patch getting quite ugly).To avoid these issues we just copy the function declaration, and use raw integers instead of the enum in the function signature.