vmware-labs / webassembly-language-runtimes

Wasm Language Runtimes provides popular language runtimes (Ruby, Python, …) precompiled to WebAssembly that are tested for compatibility and kept up to date when new versions of upstream languages are released
Apache License 2.0
327 stars 27 forks source link

feat: try to find actual target directory to place wasi deps into #117

Closed Gentle closed 3 months ago

Gentle commented 1 year ago

Scenario: in a workspace setup, the library extracts the wasi-deps to every crate that links against libpython, this code tries to instead find the actually used cargo target directory

The code searches for the last occurrence of /wasm32-wasi/ in the OUT_DIR variable so this works also for setups where the user set the CARGO_TARGET_DIR environment variable

Example:

workspace/target <= I want the files to be put here workspace/library_a/target/wasm32-wasi/wasi-deps <= these three are currently being created workspace/library_b/target/wasm32-wasi/wasi-deps <= these three are currently being created workspace/library_c/target/wasm32-wasi/wasi-deps <= these three are currently being created

vmwclabot commented 1 year ago

@Gentle, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot commented 1 year ago

@Gentle, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 1 year ago

@Gentle, VMware has rejected your signed contributor license agreement. The merge can not proceed until the agreement has been resigned. Click here to resign the agreement. Reject reason:

Minimum required personal information is Name (First and Last) and Address (Country, State, Town/City), please update the Address column with town/city, state and country.

vmwclabot commented 1 year ago

@Gentle, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 1 year ago

@Gentle, VMware has approved your signed contributor license agreement.

Gentle commented 1 year ago

I'm sorry I had some busy weeks at work, I will add your proposed changes and thank you for reviewing

Angelmmiguel commented 1 year ago

No worries @Gentle, just ping us when the changes are ready. Thank you for your contribution :)

Gentle commented 4 months ago

I rewrote the patch, it now searches for the correct target directory in this order:

Gentle commented 4 months ago

there is a race condition with workspaces where many crates have wlr-libpy as a dependency: if two crates try to extract the same tarball at the same time, tar can error with File Already Exists.

To circumvent this, I added fslock as a dependency so we can make sure only one tar extraction runs at the same time

https://github.com/Gentle/webassembly-language-runtimes/commit/861dc47649e86c481424946e26093688fbaa45c9

should I add the diff to this PR?

ereslibre commented 3 months ago

Hello @Gentle,

Sorry for the long time to reply and thank you for your contribution. After some long discussions, this project is currently in the process of being archived. However, the development of this project will continue as an independent community fork present at https://github.com/webassemblylabs/webassembly-language-runtimes.

We would be grateful if you could recreate your contribution under that fork and we will work on applying it.

Gentle commented 3 months ago

thank you, I will move the PR