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

Make Function Env immutable #1663

Merged
merged 11 commits into from
Nov 20, 2020
Merged

Make Function Env immutable #1663

merged 11 commits into from
Nov 20, 2020

Conversation

MarkMcCaskey
Copy link
Contributor

@MarkMcCaskey MarkMcCaskey commented Oct 1, 2020

Alternative / related to #1625

Resolves #1612

Review

  • Add a short description of the the change to the CHANGELOG.md file

Work in progress, we still have to update Emscripten
@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Oct 1, 2020
@bors
Copy link
Contributor

bors bot commented Oct 1, 2020

try

Build failed:

@MarkMcCaskey
Copy link
Contributor Author

bors try-

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Oct 1, 2020
@bors
Copy link
Contributor

bors bot commented Oct 1, 2020

try

Build failed:

@Hywan
Copy link
Contributor

Hywan commented Oct 1, 2020

I agree Env must be immutable, and let the user use interior mutability (with Cell-like types) if necessary. Thanks for addressing that!

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Oct 2, 2020
@bors
Copy link
Contributor

bors bot commented Oct 2, 2020

try

Build failed:

@jubianchi jubianchi added the 1.0 Wasmer at 1.0 label Nov 20, 2020
@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Nov 20, 2020
@bors
Copy link
Contributor

bors bot commented Nov 20, 2020

try

Build failed:

@MarkMcCaskey
Copy link
Contributor Author

bors try-

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Nov 20, 2020
@bors
Copy link
Contributor

bors bot commented Nov 20, 2020

Comment on lines +70 to +71
# enables internal features used by the deprecated API.
deprecated = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: really wish we didn't have to do this. Deprecated ought to be built on top of the API. Or put another way, anything deprecated does should be supported by our real API as something that other library consumer may also want to do.

Not that I'm offering an alternative. IIUC we considered wrapping it in a Mutex and rejected that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not that I'm offering an alternative. IIUC we considered wrapping it in a Mutex and rejected that?

That was a different PR, if it were as simple as just conditionally putting something behind a mutex, then I agree. I tried 2-3 times to make it work without editing the API and this is the only way I've been able to make it work.

I agree that it kind of sucks, but I figure the deprecated API won't be around forever so 🤷

lib/api/src/externals/function.rs Outdated Show resolved Hide resolved
lib/api/src/externals/function.rs Outdated Show resolved Hide resolved
lib/api/src/externals/function.rs Outdated Show resolved Hide resolved
lib/deprecated/runtime-core/src/vm.rs Outdated Show resolved Hide resolved
lib/vm/src/instance.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@nlewycky nlewycky left a comment

Choose a reason for hiding this comment

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

IMO given how all the parts deprecated needs are now unsafe and documented as non-stable, you could remove the deprecated feature. A pro of this is that we don't have two possible builds of lib/api, with deprecated enabled and disabled. Maybe that doesn't matter.

lib/c-api/wasmer_wasm.h Outdated Show resolved Hide resolved
Copy link
Member

@syrusakbary syrusakbary left a comment

Choose a reason for hiding this comment

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

Looks great to merge, once the "deprecated" comment from Nick is addressed :)

@MarkMcCaskey
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 20, 2020

@bors bors bot merged commit 3c788dd into master Nov 20, 2020
@bors bors bot deleted the feature/make-env-immutable branch November 20, 2020 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Wasmer at 1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling a host function with environment in parallel results in data race
5 participants