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

[REQUEST] mrustc as alternative Rust compiler #2643

Closed
ojeda opened this issue May 4, 2021 · 4 comments · Fixed by #2681
Closed

[REQUEST] mrustc as alternative Rust compiler #2643

ojeda opened this issue May 4, 2021 · 4 comments · Fixed by #2681
Labels
request Request for something

Comments

@ojeda
Copy link
Contributor

ojeda commented May 4, 2021

mrustc is a Rust compiler written in C++.

While it is mainly intended as a way to reduce the long bootstrap chain of rustc, it can compile some non-rustc code too.

@ojeda ojeda added the request Request for something label May 4, 2021
@dkm
Copy link
Member

dkm commented May 5, 2021

I would like to work on this but I'm not familiar with mrustc yet.
What would be the better solution for using mrustc?
Initial guess would be:

$ make
$ make LIBS

Then I can use bin/mrustc with the freshly built libstd to compile simple examples.

How do you get the assembly output ? Also, I don't see any tag/release. Do you expect to have mrustc build daily from the master branch or is there some prebuild tarball available somewhere?

@ojeda
Copy link
Contributor Author

ojeda commented May 5, 2021

How do you get the assembly output ?

I am not familiar with it either, but from what I understand, it is currently a transpiler to C without native codegen.

So I would have one entry in CE to show the C output; and perhaps another for that + GCC and/or + Clang.

Do you expect to have mrustc build daily from the master branch or is there some prebuild tarball available somewhere?

I think having a build from time to time when a major milestone is reached is enough for the moment (like when a newer Rust compiler version gets bootstrapped) . However, perhaps @thepowersgang would welcome nightlies nevertheless!

dkm added a commit to dkm/misc-builder that referenced this issue May 7, 2021
dkm added a commit to dkm/compiler-explorer that referenced this issue May 9, 2021
dkm added a commit to dkm/compiler-explorer that referenced this issue May 10, 2021
dkm added a commit to dkm/infra that referenced this issue May 10, 2021
Initially wanted to add existing versions, but small issues would require some
workaround to make it work. Instead, use nightly, at least until a new release
is published.

compiler-explorer/compiler-explorer#2643
@dkm
Copy link
Member

dkm commented May 10, 2021

I've a setup working locally. I think it's easier to focus on upcoming releases and ignore anything earlier because that would need some workarounds (not hard, but not sure this is worth it). When a simple fix is merged, I'll start pushing PR here to add the compiler. As a first goal, I'll treat the C as the final product (I still need to see how to display this correctly). Maybe there will be something to chain this C into another compiler, but that's a different topic.

dkm added a commit to dkm/compiler-explorer that referenced this issue May 22, 2021
Add the needed base for new mrustc compiler.
https://github.com/thepowersgang/mrustc

mrustc is transpiling Rust to C and is mainly used for bootstraping rustc.

This change treats the C output as the final product (as is assembly for
GCC/clang). It is not easily possible to automatically plug this C to other C
compilers to get assembly or executable.

fixes compiler-explorer#2643
dkm added a commit to dkm/misc-builder that referenced this issue May 22, 2021
Add builder for mrustc.
This is currently needed because mrustc does not provide binary snapshot for its
releases (and also because mrustc until recently would always invoke the local C
compiler as its last step, which is not wanted).

refs compiler-explorer/compiler-explorer#2643
dkm added a commit to dkm/infra that referenced this issue May 22, 2021
Initially wanted to add existing versions, but small issues would require some
workaround to make it work. Instead, use nightly, at least until a new release
is published.

refs compiler-explorer/compiler-explorer#2643
@dkm
Copy link
Member

dkm commented May 22, 2021

Hope to have everything correct here.
3 PR:

  • 1 for supporting mrustc in CE + updated amazon config for rust part (haven't skipped the tests this time /o)
  • builder script used to create a "packaged" mrustc for the github repository
  • corresponding invocation to builder script in the infra nightly script to have it correctly build

partouf pushed a commit to compiler-explorer/misc-builder that referenced this issue May 27, 2021
Add builder for mrustc.
This is currently needed because mrustc does not provide binary snapshot for its
releases (and also because mrustc until recently would always invoke the local C
compiler as its last step, which is not wanted).

refs compiler-explorer/compiler-explorer#2643
partouf pushed a commit to compiler-explorer/infra that referenced this issue May 27, 2021
Initially wanted to add existing versions, but small issues would require some
workaround to make it work. Instead, use nightly, at least until a new release
is published.

refs compiler-explorer/compiler-explorer#2643
partouf pushed a commit that referenced this issue May 27, 2021
Add the needed base for new mrustc compiler.
https://github.com/thepowersgang/mrustc

mrustc is transpiling Rust to C and is mainly used for bootstraping rustc.

This change treats the C output as the final product (as is assembly for
GCC/clang). It is not easily possible to automatically plug this C to other C
compilers to get assembly or executable.

fixes #2643
mattgodbolt pushed a commit that referenced this issue Aug 2, 2021
Add the needed base for new mrustc compiler.
https://github.com/thepowersgang/mrustc

mrustc is transpiling Rust to C and is mainly used for bootstraping rustc.

This change treats the C output as the final product (as is assembly for
GCC/clang). It is not easily possible to automatically plug this C to other C
compilers to get assembly or executable.

fixes #2643
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Request for something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants