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

mozjs68: new port #13902

Merged
merged 1 commit into from
Feb 27, 2022
Merged

mozjs68: new port #13902

merged 1 commit into from
Feb 27, 2022

Conversation

evanmiller
Copy link
Contributor

Description

gjs is out of date; newer versions require an updated mozjs. A gjs update can be prepared after this and #13897 are merged.

One major improvement over the mozjs60 Portfile is that mozglue is now compiled statically. This eliminates the need for two of the patches, and also avoids a file conflict over libmozglue.dylib with mozjs60.

After #13817 is merged, this mozjs68 port can be made available on 10.6+ (already compiled and tested locally on 10.6.8 / x86_64). mozjs78 and mozjs91 will be explored later.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.6.8
Xcode x.y

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@evanmiller
Copy link
Contributor Author

CI on macOS 11 says

checking that libclang is new enough... 
 ERROR: The libclang located at None is too old (need at least 4.0).
  
 Please make sure to update it or point to a newer libclang using
 --with-libclang-path.

Will dig into it later.

@evanmiller evanmiller force-pushed the mozjs68 branch 2 times, most recently from cb803f0 to cb9b3fe Compare February 6, 2022 18:20
@evanmiller
Copy link
Contributor Author

Will dig into it later.

The Rust (or bindgen) components need an LLVM. I've set the Portfile up to require a MacPorts Clang, and then point mozjs68 to the corresponding llvm-config via an environment variable. It's not clear to me if there will be an issue if this LLVM version does not match the LLVM of the installed Rust. Reading the source comments, it looks like Rust is actually not used at all in the JS interpreter; so if there is some kind of issue here, I think it will only affect the exposed Rust bindings, which at the moment is a fairly niche use case.

@evanmiller
Copy link
Contributor Author

Updated to support Snow Leopard (x86_64 only).

@kencu
Copy link
Contributor

kencu commented Feb 15, 2022

I installed this, and it works. I didn't run the full test suite though -- should have I guess.

It supports javascript async/await structures nicely (as do 52 and 60) and I tried to use it to add full async/await support back into TenFourFox, by symlinking this js into the TenFourFox bundle instead of the js45-era js that is in there now, but it wouldn't work to allow TFF to support GitHub normally, for example. Maybe someday!

I put that question here, BTW:

classilla/tenfourfox#653

@evanmiller
Copy link
Contributor Author

I would guess with the deep connection between the JS runtime and the DOM that Firefox links into libmozjs rather than running the js binary in a separate process. So my uninformed expectation is that at the very least a full rebuild would be necessary (and likely additional glue code).

To add to the "Maybe someday" wish-list, if we get a bootstrapped Rust rolling on 10.6 then perhaps forking a newer version of Firefox will become a possibility, at least on x86_64.

After this is merged I'll see about tricking the build into working on PPC. As I said above I believe that Rust is not actually used for any of the core code – the story changes with mozjs78 though.

@mascguy
Copy link
Member

mascguy commented Feb 26, 2022

LGTM. Anyone else?

@evanmiller
Copy link
Contributor Author

@mascguy Once this is merged, maybe time to move the gobject_introspection update out of -devel? Then we can get a gjs update rolling.

@mascguy
Copy link
Member

mascguy commented Feb 26, 2022

@mascguy Once this is merged, maybe time to move the gobject_introspection update out of -devel? Then we can get a gjs update rolling.

Done: 3eec87e

@mascguy mascguy merged commit 281bced into macports:master Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants