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

feat: add a feature flag to build from source #439

Closed
Tracked by #30593
wusyong opened this issue Dec 13, 2023 · 6 comments
Closed
Tracked by #30593

feat: add a feature flag to build from source #439

wusyong opened this issue Dec 13, 2023 · 6 comments

Comments

@wusyong
Copy link
Member

wusyong commented Dec 13, 2023

This is an feature request starting from zulip: https://servo.zulipchat.com/#narrow/stream/263398-general/topic/Spidermonkey.20dylib.20in.20mozjs/near/406266292
Basically, I hope we can offer a feature flag to toggle building mozjs's spidermonkey from source.
Because 99% of people always stuck on building mozjs when they want to try servo.
It would be awesome if beginners can turn the flag off and download mozjs's spidermonkey binary without compiling and bindgen.
rusty_v8 already has mechanism to do so.

@wusyong
Copy link
Member Author

wusyong commented Dec 13, 2023

Currently I'm testing linking existing static libraries and including generated rust files. It seems working so far.
The static libs need to be linked are: libjs_static.a, mozjs-sys's libjsglue.a, and mozjs's libjsglue.a.
And the generated rust files are: jsapi.rs and gluebindings.rs.
I'm not sure where to put the files yet. But if there's no suggestion, I'll start by putting them in OUT_DIR without any additional directory path.
And I still hope we can push #409, so there will be less files to worry about.

@sagudev
Copy link
Member

sagudev commented Dec 13, 2023

Great stuff, we would probably need two variants one with debug-mozjs feature and one without. Although we could just make release version and if debug-mozjs feature is activated we build it from source.

@sagudev
Copy link
Member

sagudev commented Dec 13, 2023

We would need to extend CI, to automagically produce prebuilds and then make tags for every commit (given that mozjs is not versioned), although this could result a lot of tags.

@wusyong
Copy link
Member Author

wusyong commented Dec 13, 2023

Great stuff, we would probably need two variants one with debug-mozjs feature and one without. Although we could just make release version and if debug-mozjs feature is activated we build it from source.

I guess one release version (with streams feature) is good enough for now. We don't have enough resources to support multiple version at the moment.

We would need to extend CI, to automagically produce prebuilds and then make tags for every commit (given that mozjs is not versioned), although this could result a lot of tags.

Maybe we can produce prebuilds on version release. It's also a good improvement for servo since it's still using git dependency I believe. prebuilds per version release seems pretty reasonable and should be more stable for users.

@wusyong
Copy link
Member Author

wusyong commented Mar 28, 2024

Closed by #450
@sagudev Thanks for reviewing!

@wusyong wusyong closed this as completed Mar 28, 2024
@sagudev
Copy link
Member

sagudev commented Mar 28, 2024

Thank you for all hard work.

I will update companion PR later today.

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

No branches or pull requests

2 participants