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

mrustc: new port #13551

Merged
merged 1 commit into from
Jan 18, 2022
Merged

mrustc: new port #13551

merged 1 commit into from
Jan 18, 2022

Conversation

evanmiller
Copy link
Contributor

@evanmiller evanmiller commented Jan 1, 2022

Description

mrustc is an alternative Rust compiler suitable for bootstrapping Rust. The immediate motivation is to provide a basic Rust compiler on Snow Leopard, which isn't supported by the main rust port.

In the future mrustc might be used as a stage0 compiler for rust, but that's beyond the scope of this work.

mrustc requires a run-time C compiler. Since the system GCC on 10.6 cannot compile mrustc's generated C files (which use thread-local storage), I have patched things to use clang-mp-9.0 as the default run-time compiler on all platforms. This default can be overridden at run-time with CC. The choice of default compiler will be a good candidate for port variants in the future.

Tested through compiling and running a basic "Hello, world!" Rust program, so I think it's ready for others to play around with.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.6.8
Xcode x.y

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@evanmiller
Copy link
Contributor Author

Installing dependency (9 of 25) 'xz' with variants '' ... [FAIL]

Anyone know why this fails on CI?

@herbygillot
Copy link
Member

Anyone know why this fails on CI?

I've triggered the CI jobs to re-run.

@evanmiller
Copy link
Contributor Author

Updated the code and added a test target (which passes locally).

@mascguy
Copy link
Member

mascguy commented Jan 3, 2022

@catap Kirill, you might be interested in this too!

@catap
Copy link
Contributor

catap commented Jan 3, 2022

@mascguy thanks, it is interesting. I haven't got a time to finish 10.6 :) maybe someone else can do it.

@evanmiller FYI I've backported LLVM changes: https://reviews.llvm.org/D115250?id=392731 maybe you may suggest to use this patch at upstream of this tool

lang/mrustc/Portfile Outdated Show resolved Hide resolved
lang/mrustc/Portfile Outdated Show resolved Hide resolved
@evanmiller
Copy link
Contributor Author

Updated the code and adopted @cjones051073's suggestions regarding the run-time compiler.

This build may fail due to some recent changes in mrustc, reported here: thepowersgang/mrustc#210

@evanmiller
Copy link
Contributor Author

I have isolated and fixed the recent local build failures described in the linked issue.

Updated the code and Portfile to consolidate patches and have better GCC compatibility.

I have a slight preference to wait until thepowersgang/mrustc#192 is merged, but if CI passes this PR should be ready as-is.

@pmetzger
Copy link
Member

@evanmiller Let us know when you want this committed.

@evanmiller
Copy link
Contributor Author

@pmetzger Will do. Still working through a GCC-related issue over here: thepowersgang/mrustc#214

@evanmiller
Copy link
Contributor Author

This is OK to commit; I will address any remaining issues as they are resolved upstream.

@pmetzger pmetzger merged commit 59e48b1 into macports:master Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

7 participants