Skip to content

Conversation

@jschwe
Copy link
Member

@jschwe jschwe commented Nov 25, 2025

This PR re-applies #666, which was reverted due to linking failing.
The original issue was that when declaring the function OH_LOG_Print __attribute__((visibility("default"))) needs to be added, since (parts of) mozjs are compiled with -fvisibility=hidden.
To catch such issues in CI in the future, this PR also adds a final step to the ohos CI which compiles the unit-tests, which will invoke the linker, and thus catch similar link errors in our CI.

Companion PR in servo: servo/servo#40855

jschwe and others added 4 commits November 25, 2025 17:11
* 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)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Compiling the unit-tests assures, that linking succeeds.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe jschwe marked this pull request as ready for review November 25, 2025 18:22
Not needed anymore, since we don't include this file.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe jschwe added this pull request to the merge queue Nov 26, 2025
Merged via the queue into servo:main with commit 256cc57 Nov 26, 2025
38 checks passed
@jschwe jschwe deleted the jschwender/reapply_ohos_fix branch November 26, 2025 14:15
github-merge-queue bot pushed a commit to servo/servo that referenced this pull request Nov 26, 2025
Companion PR to servo/mozjs#671
Fixes issues with ohos related patches in spidermonkey, specifically
when compiling servo with --debug-mozjs.

Testing: Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
github-merge-queue bot pushed a commit to servo/servo that referenced this pull request Nov 26, 2025
Companion PR to servo/mozjs#671
Fixes issues with ohos related patches in spidermonkey, specifically
when compiling servo with --debug-mozjs.

Testing: Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
github-merge-queue bot pushed a commit to servo/servo that referenced this pull request Nov 27, 2025
Companion PR to servo/mozjs#671
Fixes issues with ohos related patches in spidermonkey, specifically
when compiling servo with --debug-mozjs.

Testing: Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
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.

2 participants