Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Introduce feature to only allow initialization once. #447

Merged
merged 1 commit into from
Nov 14, 2018

Conversation

paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Nov 14, 2018

See #22039


This change is Reviewable

@jdm
Copy link
Member

jdm commented Nov 14, 2018

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 2ccdca9 has been approved by jdm

@bors-servo
Copy link
Contributor

⌛ Testing commit 2ccdca9 with merge 5baf536...

bors-servo pushed a commit that referenced this pull request Nov 14, 2018
Introduce feature to only allow initialization once.

See #22039

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/447)
<!-- Reviewable:end -->
@CYBAI
Copy link
Member

CYBAI commented Nov 14, 2018

servo/servo#22039

(Just help to reference the issue correctly)

@@ -2,7 +2,7 @@
name = "mozjs"
description = "Rust bindings to the Mozilla SpiderMonkey JavaScript engine."
repository = "https://github.com/servo/rust-mozjs"
version = "0.9.3"
version = "0.9.4"
Copy link
Member

Choose a reason for hiding this comment

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

One thing I'm confused is that I've bumped the version to 0.9.4 at c16e7e2 but GitHub didn't show it 🤔

version = "0.9.4"

@bors-servo
Copy link
Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: jdm
Pushing 5baf536 to master...

@bors-servo bors-servo merged commit 2ccdca9 into servo:master Nov 14, 2018
@paulrouget
Copy link
Contributor Author

@CYBAI I can't see the commits from PR #445

@CYBAI
Copy link
Member

CYBAI commented Nov 14, 2018

Hmm, @paulrouget can you see 9d5d8a9 in the PR?

Btw, mozjs on crates.io is already on 0.9.4 (https://crates.io/crates/mozjs). Not sure why GitHub didn't show the commit 🤔

@paulrouget
Copy link
Contributor Author

Can't see the commit here: https://github.com/servo/rust-mozjs/commits/master/Cargo.toml but I see it here: https://github.com/servo/rust-mozjs/commits/master

Anyway. Gonna bump to 0.9.5 and publish.

@nox
Copy link
Contributor

nox commented Dec 8, 2018

Why not use std::sync::Once, and why is this feature only needed on Android in Servo? AFAIK SM should never be initialised multiple times, on all platforms, so I don't understand why this behaviour is enabled by a feature.

@nox
Copy link
Contributor

nox commented Dec 8, 2018

Cc @asajeffrey, who reverted most of 066b4ab when he updated to SM 60 in #430.

@nox
Copy link
Contributor

nox commented Dec 8, 2018

From SpiderMonkey's own documentation:

It is currently not possible to initialize SpiderMonkey multiple times (that is, calling JS_Init, JSAPI methods, then JS_ShutDown in that order, then doing so again). This restriction may eventually be lifted.

JS_Init should never be called multiple times, so this shouldn't be a feature at all.

@jdm
Copy link
Member

jdm commented Dec 8, 2018

It is specific to the way that we're using Servo inside Firefox Reality. The feature simply prevents us from calling shut down; it doesn't actually change how many times we initialize the library.

@asajeffrey
Copy link
Member

Hmm, might be worth finding another name for the feature? It seems to be more about shutdown than init, perhaps never_shutdown would be better?

@jdm
Copy link
Member

jdm commented Dec 10, 2018

I have an open pull request that removes it entirely.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants