-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Tracking issue for merging the cranelift and wasmtime repositories #1185
Comments
Has there been discussion of why we want to merge the Cranelift and Wasmtime repos somewhere? I know it's been on the cranelift meeting agenda for the past few weeks but I never saw context for it there either. |
|
The merge was discussed a few months ago. Originally we had wanted to do this as part of the move to the Bytecode Alliance GitHub org, but then had to put it on the backburner because it became clear that the complications @alexcrichton mentions above would take longer to work through. I'll give a longer explanation below, but to put one thing front-and-center, the merge is not in any way about tightly coupling Cranelift to Wasmtime. Speaking with my Mozilla hat on, that doesn't make sense, because SpiderMonkey is, if anything, the more important embedding. And neither does it make sense from a Bytecode Alliance perspective: as @bjorn3 points out, with Lucet we have another embedding that's in production and really important. And we're also big fans of rustc_codegen_cranelift, and certainly don't want that to not be supported. The current setup causes us to have significant inefficiencies in our workflows, because we often have to do things in Cranelift and a runtime in parallel, and coordinate landing and CI runs, etc. We realized this will become much worse over time, because we need to be able to fully test features that have tight compiler/runtime interactions. Right now, we have somewhat rudimentary support for testing these kinds of features in Cranelift, but with various upcoming features—such as Interface Types, Linking, and GC—we need something much more sophisticated. We came to the conclusion that by far the best way to do this is to have that runtime be Wasmtime, because otherwise we'd end up duplicating a lot of functionality. And we'd not really have something that's production-quality, meaning that the quality of the integration would always be worse than what it could be with Wasmtime. Unfortunately, this is currently not possible: circular dependencies are hugely painful across separate repositories, and just doesn't seem viable. Hence the plan to merge the repositories. We believe the downsides this brings are solidly outweighed by the advantage of improving the productivity of people working on both Cranelift and Wasmtime—and thus ultimately also benefit other embeddings of Cranelift. We’ll of course continue doing individual crate releases on crates.io, and we’ll make sure to have good Cranelift documentation independent from Wasmtime. We’ll provide more info about good workflows (including things around notification handling) based on these merged repositories once we get closer to actually doing the merge. |
Ok I've created a sample repository of what the final merge looks like -- https://github.com/alexcrichton/wasmtime/commits/cranelift-merge-afterwards -- which has merges of CI, fuzzers, documentation, etc. Feel free to play around in that repo and let me know if you find any issues! I've also created a script -- https://gist.github.com/alexcrichton/ef102cb315e548c92fd671c198da9aa2 -- to transfer all issues from one repository to another, while preserving labels. Tomorrow I'll work on how to transfer PRs in an "easy" fashion. |
Ok I've now also created a script -- https://gist.github.com/alexcrichton/8cb3f4ef7c25317ba6824ee31e3e53aa -- to rebase a PR on the I've updated the description above, and that should make it so we're all set from a tooling perspective. I think now we just need a good time to pull the trigger! |
I've created a zulip stream if folks want to chat about this as well, and also as a less "email the world on everything" way to coordinate. |
Ok unless there's any objects that come up, I plan on tackling this in the afternoon today and performing the actual merge. If you've got any concerns it's best to bring them up in zulip and @-mention me. One final question being considered is the final crate organization. The example above has |
And the merge is now done! Code has been moved, issues transferred, permissions sync'd, and PRs notified. If there are any remaining questsions feel free to reach out on Zulip! |
Discussed at yesterday's meeting I wanted to open an issue tracking progress for merging the wasmtime/cranelift repositories. I think there are three major work items that need to happen:
Performing the actual merge
There's a few different ways to do the merge here, but I'd like to propose that the following steps are done.
git filter-branch --tree-filter $HOME/rewrite-cranelift.sh HEAD
in the cranelift repository on the commit we want to merge in. The script looks like this.--allow-unrelated-histories
flagIf folks have workflows though that go beyond
cargo test
and want to make sure any scripts and such keep working, let me know! I'll try to make sure they work in the new repository.Transferring open issues
This will involve creating a script to migrate all open issues from the bytecodealliance/cranelift repository to bytecodealliance/wasmtime.
I think the general guidelines for this will be:
script: https://gist.github.com/alexcrichton/ef102cb315e548c92fd671c198da9aa2
Making it easier to migrate open PRs
I've created a script which should ideally make it easy to transfer PRs from one repository to another. The general gist of that script is something like this:
cranelift
repository at that time:before-merge
andafter-move
. Thebefore-merge
commit is the one we decided to merge into wasmtime. Theafter-move
commit is a single extra commit with the rewrite script from the first step applied.before-merge
, to make sure your PR is up-to-date. You may want to do this manually first.after-move
commit. Git should automatically detect all your renamed files, and everything should get moved around automatically.At that point you should have a local git commit you can push up to your wasmtime fork and send as a PR. We'll need to, however, close PRs as they're reopened on wasmtime.
Once this all actually happens I can drop a comment on each PR with precise instructions with an updated script that has all the variables sorted out.
The text was updated successfully, but these errors were encountered: