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

Start renaming preview1 to p1 and preview2 to p2 #478

Merged
merged 5 commits into from
Mar 4, 2024

Conversation

alexcrichton
Copy link
Collaborator

This is an initial start at renaming the "preview" terminology in WASI targets to "pX". For example the wasm32-wasi target should transition to wasm32-wasip1, wasm32-wasi-preview2 should transition to wasm32-wasip2, and wasm32-wasi-threads should transition to wasm32-wasip1-threads. This commit applies a few renames in the Makefile such as:

  • WASI_SNAPSHOT is now either "p1" or "p2"
  • The default p2 target triple is now wasm32-wasip2 instead of wasm32-wasi-preview2 (in the hopes that it's early enough to change the default).
  • Bindings for WASIp2 were renamed from "preview2" terminology to "wasip2".
  • The expected-defines files are renamed and the logic of which expectation was used has been updated slightly.

With this commit the intention is that non-preview2 defaults do not change. For example the default build still produces a wasm32-wasi sysroot. If TARGET_TRIPLE=wasm32-wasip1 is passed, however, then that sysroot is produced instead. Similarly a THREAD_MODEL=posix build produces a wasm32-wasi-threads sysroot target but you can now also pass TARGET_TRIPLE=wasm32-wasip1-threads to rename the sysroot.

My hope is to integrate this into the wasi-sdk repository and build a dual sysroot for these new targets for a release or two so both are supported and then in the future the defaults can be switched away from wasm32-wasi to wasm32-wasip1 as built-by-default.

This is an initial start at renaming the "preview" terminology in WASI
targets to "pX". For example the `wasm32-wasi` target should transition
to `wasm32-wasip1`, `wasm32-wasi-preview2` should transition to
`wasm32-wasip2`, and `wasm32-wasi-threads` should transition to
`wasm32-wasip1-threads`. This commit applies a few renames in the
`Makefile` such as:

* `WASI_SNAPSHOT` is now either "p1" or "p2"
* The default p2 target triple is now `wasm32-wasip2` instead of
  `wasm32-wasi-preview2` (in the hopes that it's early enough to change
  the default).
* Bindings for WASIp2 were renamed from "preview2" terminology to "wasip2".
* The expected-defines files are renamed and the logic of which
  expectation was used has been updated slightly.

With this commit the intention is that non-preview2 defaults do not
change. For example the default build still produces a `wasm32-wasi`
sysroot. If `TARGET_TRIPLE=wasm32-wasip1` is passed, however, then that
sysroot is produced instead. Similarly a `THREAD_MODEL=posix` build
produces a `wasm32-wasi-threads` sysroot target but you can now also
pass `TARGET_TRIPLE=wasm32-wasip1-threads` to rename the sysroot.

My hope is to integrate this into the wasi-sdk repository and build a
dual sysroot for these new targets for a release or two so both are
supported and then in the future the defaults can be switched away from
`wasm32-wasi` to `wasm32-wasip1` as built-by-default.
alexcrichton added a commit to alexcrichton/wasi-sdk that referenced this pull request Mar 2, 2024
This commit is a reflection of WebAssembly/wasi-libc#478 into this
repository where a few changes are happening:

* A new `wasm32-wasip1` sysroot is prepared matching `wasm32-wasi`
* A new `wasm32-wasip1-threads` sysroot is prepared matching `wasm32-wasi-threads`
* The `wasm32-wasi-preview2` target is renamed `wasm32-wasip2`

I've done a bit of makefile refactoring to deduplicate things a bit now
that there's a number of targets being built.

The long-term goal would be to remove the `wasm32-wasi` and
`wasm32-wasip1-threads` targets, but that's not proposed just yet at
this time.
@@ -86,15 +86,18 @@ jobs:
shell: bash
run: |
make -j4
WASI_SNAPSHOT=preview2 make -j4
make -j4 TARGET_TRIPLE=wasm32-wasip1
WASI_SNAPSHOT=p2 make -j4
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment for each of these make invocations describing what it's building? It's subtle that the first two differ between "wasm32-wasi" and "wasm32-wasip1".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure yeah, in lieu of comments I went ahead and added TARGET_TRIPLE for all of the invocations so it's more clear at-a-glance which each one is doing

@sunfishcode sunfishcode merged commit c9c7d06 into WebAssembly:main Mar 4, 2024
8 checks passed
@alexcrichton alexcrichton deleted the start-renaming-targets branch March 5, 2024 00:00
@alexcrichton alexcrichton restored the start-renaming-targets branch March 5, 2024 00:00
@alexcrichton alexcrichton deleted the start-renaming-targets branch March 5, 2024 00:00
alexcrichton added a commit to alexcrichton/wasi-sdk that referenced this pull request Mar 5, 2024
This commit is a reflection of WebAssembly/wasi-libc#478 into this
repository where a few changes are happening:

* A new `wasm32-wasip1` sysroot is prepared matching `wasm32-wasi`
* A new `wasm32-wasip1-threads` sysroot is prepared matching `wasm32-wasi-threads`
* The `wasm32-wasi-preview2` target is renamed `wasm32-wasip2`

I've done a bit of makefile refactoring to deduplicate things a bit now
that there's a number of targets being built.

The long-term goal would be to remove the `wasm32-wasi` and
`wasm32-wasip1-threads` targets, but that's not proposed just yet at
this time.
sunfishcode pushed a commit to WebAssembly/wasi-sdk that referenced this pull request Mar 6, 2024
* Start renaming preview1 to p1 and preview2 to p2

This commit is a reflection of WebAssembly/wasi-libc#478 into this
repository where a few changes are happening:

* A new `wasm32-wasip1` sysroot is prepared matching `wasm32-wasi`
* A new `wasm32-wasip1-threads` sysroot is prepared matching `wasm32-wasi-threads`
* The `wasm32-wasi-preview2` target is renamed `wasm32-wasip2`

I've done a bit of makefile refactoring to deduplicate things a bit now
that there's a number of targets being built.

The long-term goal would be to remove the `wasm32-wasi` and
`wasm32-wasip1-threads` targets, but that's not proposed just yet at
this time.

* Use $(CLANG_VERSION) instead of hardcoding
@yamt
Copy link
Contributor

yamt commented Mar 7, 2024

My hope is to integrate this into the wasi-sdk repository and build a dual sysroot for these new targets for a release or two so both are supported and then in the future the defaults can be switched away from wasm32-wasi to wasm32-wasip1 as built-by-default.

the name "p1" "p2" sound rather cryptic to me.
what's the motivation of the rename?

also, do you have any non-aesthetic reasons to rename preview1?
otherwise, i'm against it.

it's a bit concerning that this kind of change lands almost immediately.

@sunfishcode
Copy link
Member

The "p2" naming was discussed at the WASI-02-20 meeting.

@yamt
Copy link
Contributor

yamt commented Mar 8, 2024

The "p2" naming was discussed at the WASI-02-20 meeting.

thank you. i will take a look.

kateinoigakukun added a commit to kateinoigakukun/swift that referenced this pull request Mar 28, 2024
The WASI community is transitioning to a new naming for the "preview"
version in the target triple: wasm32-wasi -> wasm32-wasip1.
At this moment, we keep the old triple wasm32-wasi because it's already
widely used, but we should start using the new triple threaded target.

LLVM checks only if the OS field *starts* with "wasi", so "wasip1" is
still considered a valid `isOSWASI()` target.

See: WebAssembly/wasi-libc#478
kateinoigakukun added a commit to ruby/ruby.wasm that referenced this pull request Mar 28, 2024
…system

WASI community is going to be introducing pN suffix to the target triples
to distinguish the different versions of the WASI Preview versions (e.g.
`wasm32-unknown-wasip1` for WASI Preview1) to prepare the upcoming WASI
Preview2 and so on.

Other projects are also following this change:
* WebAssembly/wasi-libc#478
* rust-lang/compiler-team#607
kateinoigakukun added a commit to ruby/ruby.wasm that referenced this pull request Mar 28, 2024
…system

WASI community is going to be introducing pN suffix to the target triples
to distinguish the different versions of the WASI Preview versions (e.g.
`wasm32-unknown-wasip1` for WASI Preview1) to prepare the upcoming WASI
Preview2 and so on.

Other projects are also following this change:
* WebAssembly/wasi-libc#478
* rust-lang/compiler-team#607
kateinoigakukun added a commit to kateinoigakukun/swift that referenced this pull request Mar 29, 2024
The WASI community is transitioning to a new naming for the "preview"
version in the target triple: wasm32-wasi -> wasm32-wasip1.
At this moment, we keep the old triple wasm32-wasi because it's already
widely used, but we should start using the new triple threaded target.

LLVM checks only if the OS field *starts* with "wasi", so "wasip1" is
still considered a valid `isOSWASI()` target.

See: WebAssembly/wasi-libc#478
kateinoigakukun added a commit to kateinoigakukun/swift that referenced this pull request Mar 29, 2024
The WASI community is transitioning to a new naming for the "preview"
version in the target triple: wasm32-wasi -> wasm32-wasip1.
At this moment, we keep the old triple wasm32-wasi because it's already
widely used, but we should start using the new triple threaded target.

LLVM checks only if the OS field *starts* with "wasi", so "wasip1" is
still considered a valid `isOSWASI()` target.

See: WebAssembly/wasi-libc#478
kateinoigakukun added a commit to kateinoigakukun/swift that referenced this pull request Mar 29, 2024
The WASI community is transitioning to a new naming for the "preview"
version in the target triple: wasm32-wasi -> wasm32-wasip1.
At this moment, we keep the old triple wasm32-wasi because it's already
widely used, but we should start using the new triple threaded target.

LLVM checks only if the OS field *starts* with "wasi", so "wasip1" is
still considered a valid `isOSWASI()` target.

See: WebAssembly/wasi-libc#478
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

Successfully merging this pull request may close these issues.

3 participants