-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
mrustc: update to 20220125 #13817
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: update to 20220125 #13817
Conversation
And I'd love to share the picture: Cc: @evanmiller @kencu |
@g5pw / @herbygillot the next step will be integrate it into existed rust port. Because it requires some patches to rust and rust's llvm.... well.. I suggest to install Do you have anything in mind? |
Great work - lots of nice effort here. Will be important if MacPorts is to not soon lose 10.6 support soon, for sure. BTW, I found something interesting here for you, on a separate but somewhat related topic. One of the fellows who is around MacPorts sometimes has written up a very detailed, exactly what happens when and in what code, description of how the darwin 10.7+ thread_local_storage program is implemented. Some details here I had not seen summarized before: |
Now that you have a rust that works on 10.6, perhaps that could be used to step-by-step move towards a current rustc manually, at least. Then that could be used either directly, or as a bootstrap for rust instead of the one usually pulled by rustup. I have done something very similar for ghc, and I use this to build all the current ports in macports that use ghc (shellcheck, pandoc, etc) on 10.6.8, and as a bootstrap compiler for newer ghc versions (every once in a while, I update them to the current releases): https://github.com/kencu/ghc-for-older-darwin-systems/releases |
@kencu it uses To be honest it still needs some patches to LLVM and rust to make it works, but this port includes full bootstrapped rust :) |
yep, I get it. But now that you have a working rustc, you could forget all about mrustc now, and use your working rust 1.39 to step up to the current rust, in a few steps, with whatever rust patches are needed of curse. This is exactly what I did with ghc. |
@kencu I'm too lazy to do it to be honest. To build rust This also includes to update patches to LLVM and rust. I do have everything ready for |
if mrustc is likely to get you to 1.54, sure, faster then. I haven’t looked at what the reach is for rust… for ghc it’s 2 jumps. |
@kencu a few jumps is simpler :) but rust supports quite strange policy and can't be build but rust compiler that is more than a moth old. |
I see you’re right about that… they can only build with the one before… yeah, that is a lot of steps. |
@kencu the issue that I need bootstrap not only rust, but also cargo... seems like insanity, isn't it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! Just a few minor comments from me
lang/mrustc/Portfile
Outdated
|
||
version 20220111 | ||
version 20220115 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter but the title says 20220125
(which I think is the correct value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed!
lang/mrustc/Portfile
Outdated
@@ -59,46 +62,120 @@ compiler.blacklist *gcc* | |||
# depends_run-append port:[string map {"macports-gcc-" "gcc"} ${configure.compiler}] | |||
#} | |||
|
|||
# https://github.com/thepowersgang/mrustc/pull/192 | |||
patchfiles-append patch-mrustc-macos-bootstrap.diff | |||
# Patches avaialble as git branch: https://github.com/catap/mrustc/tree/macports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avaialble
=> available
lang/mrustc/Portfile
Outdated
set pythonfullpath /usr/bin/python2.7 | ||
} else { | ||
set pythonfullpath ${prefix}/bin/python2.7 | ||
depends_lib-append port:python27 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be depends_run
? (depends_run
is used if there is no library linkage.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In llvm/clang, it is listed as depends_lib, because you need it for both build and run (depends_build + depends_run = depends_lib). Here you only need it for the build I believe, and not at runtime, so it could be depends_build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanmiller nope, the only reason to use python2.7 is make clang's cmake happy. After it is built, python2.7 is useless.
After a coffee I realized that you both mean. Thanks!
lang/mrustc/Portfile
Outdated
foreach f {rustc cargo} { | ||
xinstall -m 0755 -W ${worksrcpath}/output-${rust_version} $f \ | ||
${destroot}${prefix}/libexec/mrustc-${rust_version_major}/bin | ||
system -W ${destroot}${prefix}/bin/ "ln -s ../libexec/mrustc-${rust_version_major}/bin/$f ./mrustc-${f}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't wait to build some things with it :-)
} | ||
|
||
# Run a Hello, world! test | ||
test.env RUSTC_VERSION=${rust_version} MRUSTC_LIBDIR=output-${rust_version} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MRUSTC_LIBDIR
was intentional because it needs to know where the built libraries are before they are installed. (Otherwise the test
phase will look for libraries in ${prefix}
.)
lang/mrustc/files/0009-macOS-10.6-1.39.0-fix-build-issues-pre-Lion.patch
Outdated
Show resolved
Hide resolved
e7cdd3b
to
14be6b1
Compare
3d29286
to
ed61855
Compare
I’ll be keeping an eye on your mrustc fork as mrustc seems to be the only sane way to bootstrap for i686-apple-darwin |
707b926
to
8ce5058
Compare
I am seeing some build failures locally (10.6.8) that look like upstream bugs – something about non-UTF-8 C sources and then an unrecognized symbol in the generated C code. I will try again with your latest patches and report back. |
85d05ad
to
90e4cac
Compare
If you can now go clang -> mrustc -> rustc 1.54 then that is a real leap forward! Thanks, will try. |
@kencu I'll ping you when it's done. Right now I'm polishing it :) |
Figured it out. |
6a3a647
to
ad4222e
Compare
@kencu, @evanmiller, @Gcenx it's ready for review. Feel free to install Anyway, if your machine has enough RAM (enough means 8G) feel free to edit this port file and uncomment lines 180-181 what reduce building time significantly. The root cause of such memory consumption is paralell run of
P.S. I do have as the next step |
Have you tested GCC support since the Core2 patches were merged? Would be nice to support it at least with the base |
@evanmiller I've started with building Anyway, support of |
Last night I installed these:
and they seem to provide a working rustc and cargo, versions 1.54.
I'm not sure what you changed after that, but these seem to work. Now have to figure out how to get MacPorts to accept them as replacements for rust/cargo, until such time as they are used to bootstrap to current rust versions in the real ports. Looking good. |
@kencu I've updated used version of I also fixed a build of cargo which produces unworking cargo if Regarding integration: my plan is backport my legacy patch to current master and introduce a few After that I plan to rename current rust port to And when add a simple wrapper-port To be honest everything is ready and just wait to be delivered opened :) |
Restarted CI because it was too long for 10.15; probably overload machine. |
Lint says:
I think at this point I wouldn't worry about CI and I would just let the build bots tell you about any platform issues. |
It also: - switched to rust 1.54.0; - blacklisted unsupported compilers; - added full rust and cargo bootstrap; - fixed build on macOS 10.6; - claim myself as maintainer. See: https://trac.macports.org/ticket/64146
@kencu may I ask you to move forward with this version and force to bulldbots to test it? |
Description
It also:
Yeah, it brings rust to macOS 10.6.
This rust is installed under
/opt/local/libexec/mrustc-1.39
.See: https://trac.macports.org/ticket/64146
Type(s)
Tested on
macOS 10.6.8 10K549 x86_64
Xcode 3.2.6 10M2518
macOS 12.1 21C52 x86_64
Xcode 13.2.1 13C100
Verification
Have you
port lint --nitpick
?sudo port test
?sudo port -vst install
?