Opened 11 years ago

Closed 11 years ago

#38279 closed defect (fixed)

rust @0.5: multiple issues

Reported by: cooljeanius (Eric Gallager) Owned by: g5pw (Aljaž Srebrnič)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: larryv (Lawrence Velázquez)
Port: rust

Description

  1. Rust currently doesn't work on 10.5 and lower: https://github.com/mozilla/rust/issues/4232

Something like the following could be added to fix this:

pre-fetch {
    if {${os.platform} == "darwin" && ${os.major} < 10} {
        ui_error "${name} only works with OS X 10.6 Snow Leopard or later."
        return -code error "incompatible OS X version"
    }
}
  1. Rust does not support universal binaries: https://github.com/mozilla/rust/issues/2024

Something like the following could be added to fix this:

supported_archs     i386 x86_64
universal_variant   no
  1. Rust's configure script doesn't recognize the --disable-dependency-tracking flag. This could be solve by either removing the universal variant as per #2 above, or by adding something like this to the portfile:
    configure.universal_args-delete --disable-dependency-tracking
    
  1. Seeing as Rust basically builds its own copy of llvm, it should use the same dependencies as llvm (i.e. libffi, llvm_select, and perl5).
  1. Besides the dependencies listed in #4 above, it should also include the dependencies listed in the Rust Language Tutorial, i.e. it should:
  • blacklist gcc versions lower than 4.4, and clang versions lower than 3
  • depend on either python26 or python27 (maybe just python_select as a placeholder)
  • use build.type gnu and depend on gmake
  • depend on curl

Attachments (2)

rust.diff (6.4 KB) - added by g5pw (Aljaž Srebrnič) 11 years ago.
Diff of the rust directory
main.log (68.3 KB) - added by g5pw (Aljaž Srebrnič) 11 years ago.
Segfault during build

Download all attachments as: .zip

Change History (23)

comment:1 Changed 11 years ago by g5pw (Aljaž Srebrnič)

Owner: changed from macports-tickets@… to g5pw@…
Status: newassigned

Thank you for this. Will fix tomorrow.

comment:2 Changed 11 years ago by cooljeanius (Eric Gallager)

Oh also, one more thing: it needs its license set. I'd put:

license             {MIT Apache-2}

but I'm not sure if it should have the brackets or not...

comment:3 in reply to:  description ; Changed 11 years ago by larryv (Lawrence Velázquez)

Cc: g5pw@… removed

Replying to egall@…:

1. Rust currently doesn't work on 10.5 and lower: https://github.com/mozilla/rust/issues/4232

Does that mean it doesn’t work on 10.5, or that it doesn’t work with 10.5’s compilers? There’s a difference.

2. Rust does not support universal binaries: https://github.com/mozilla/rust/issues/2024

Something like the following could be added to fix this:

supported_archs i386 x86_64
universal_variant   no

This doesn’t “fix” anything; it just codifies the restriction. And does Rust not support being built on PowerPC?

3. Rust's configure script doesn't recognize the --disable-dependency-tracking flag. This could be solve by either removing the universal variant as per #2 above, or by adding something like this to the portfile:

configure.universal_args-delete --disable-dependency-tracking

If Rust doesn’t support being build universal, this is a moot point.

4. Seeing as Rust basically builds its own copy of llvm, it should use the same dependencies as llvm (i.e. libffi, llvm_select, and perl5).

It builds its own copy of LLVM? Why? Can we make it use ours?

5. Besides the dependencies listed in #4 above, it should also include the dependencies listed in the Rust Language Tutorial, i.e. it should:

  • blacklist gcc versions lower than 4.4, and clang versions lower than 3
  • depend on either python26 or python27 (maybe just python_select as a placeholder)

No. Pick one or the other.

  • use build.type gnu and depend on gmake

A dependency is not necessary; OS X comes with GNU Make.

  • depend on curl

Why? Does the build process download something? It should not be doing that.

comment:4 in reply to:  3 Changed 11 years ago by larryv (Lawrence Velázquez)

Replying to larryv@…:

Why? Does the build process download something? It should not be doing that.

Ugh, it does. #38285.

comment:5 in reply to:  3 ; Changed 11 years ago by cooljeanius (Eric Gallager)

Replying to larryv@…:

Replying to egall@…:

2. Rust does not support universal binaries: https://github.com/mozilla/rust/issues/2024

Something like the following could be added to fix this:

supported_archs i386 x86_64
universal_variant   no

This doesn’t “fix” anything; it just codifies the restriction.

Right, that's what I meant.

3. Rust's configure script doesn't recognize the --disable-dependency-tracking flag. This could be solved by either removing the universal variant as per #2 above, or by adding something like this to the portfile:

configure.universal_args-delete --disable-dependency-tracking

If Rust doesn’t support being build universal, this is a moot point.

That's why I said "either... or..." there.

4. Seeing as Rust basically builds its own copy of llvm, it should use the same dependencies as llvm (i.e. libffi, llvm_select, and perl5).

It builds its own copy of LLVM? Why? Can we make it use ours?

I've been trying to get it to do that, but I've had no luck getting it to work that way so far...

5. Besides the dependencies listed in #4 above, it should also include the dependencies listed in the Rust Language Tutorial, i.e. it should:

  • blacklist gcc versions lower than 4.4, and clang versions lower than 3
  • depend on either python26 or python27 (maybe just python_select as a placeholder)

No. Pick one or the other.

How about using variants?

  • use build.type gnu and depend on gmake

A dependency is not necessary; OS X comes with GNU Make.

What about on platforms other than OS X?

comment:6 in reply to:  5 ; Changed 11 years ago by larryv (Lawrence Velázquez)

Replying to egall@…:

Replying to larryv@…:

It builds its own copy of LLVM? Why? Can we make it use ours?

I've been trying to get it to do that, but I've had no luck getting it to work that way so far...

Ugh. That’s rather unfortunate.

  • depend on either python26 or python27 (maybe just python_select as a placeholder)

No. Pick one or the other.

How about using variants?

Using variants for a build dependency isn’t really appropriate. The simplest (and in my opinion, best) option is just to add a port:python27 build dependency. If Aljaž wants, he could try testing for a recent-enough system Python before resorting to the dependency.

  • use build.type gnu and depend on gmake

A dependency is not necessary; OS X comes with GNU Make.

What about on platforms other than OS X?

This should be handled in base, like the BSD Make dependency is.

comment:7 Changed 11 years ago by larryv (Lawrence Velázquez)

Given its breadth of topics, this ticket should have been reported as multiple tickets.

Hope I got everything. Sorry for pounding you with tickets, Aljaž :P

I took care of the dependency tracking issue in r103711. If Rust can’t be built universal after all, the configure.universal_args-delete line can be removed.

comment:8 in reply to:  7 ; Changed 11 years ago by g5pw (Aljaž Srebrnič)

Replying to larryv@…:

Given its breadth of topics, this ticket should have been reported as multiple tickets.

Hope I got everything. Sorry for pounding you with tickets, Aljaž :P

I took care of the dependency tracking issue in r103711. If Rust can’t be built universal after all, the configure.universal_args-delete line can be removed.

Thanks for the work, Larry, yeah, I woke up to a full inbox :) will work through it!

egall, could you PM me what did you try regarding #38288?

comment:9 in reply to:  8 Changed 11 years ago by cooljeanius (Eric Gallager)

Replying to g5pw@…:

egall, could you PM me what did you try regarding #38288?

All I did basically was try running port select llvm manually beforehand, followed by then trying setting

configure.env-append CFG_LLVM_ROOT=${prefix}

in the portfile, but I don't think it got passed through... You can see my development version of the portfile at: https://github.com/cooljeanius/LocalPorts/blob/master/lang/rust/Portfile (it contains a lot of other unnecessary stuff that I added just because though; feel free to ignore those parts)

Last edited 11 years ago by cooljeanius (Eric Gallager) (previous) (diff)

comment:10 Changed 11 years ago by g5pw (Aljaž Srebrnič)

Ok, I just hit a wall. I nearly got it working, but I get a segmentation fault seemingly out of nowhere, A new pair of eyeballs would be useful. I'm attaching the diff.

Changed 11 years ago by g5pw (Aljaž Srebrnič)

Attachment: rust.diff added

Diff of the rust directory

comment:11 Changed 11 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:12 in reply to:  10 ; Changed 11 years ago by cooljeanius (Eric Gallager)

Replying to g5pw@…:

Ok, I just hit a wall. I nearly got it working, but I get a segmentation fault seemingly out of nowhere, A new pair of eyeballs would be useful. I'm attaching the diff.

Could we see the log of the segfault? Is it a segfault while compiling or a segfault while running? (Also, while you're at it, try re-checking each of the sub-issues that larryv opened and see if any of them contain any inspiration)

Last edited 11 years ago by cooljeanius (Eric Gallager) (previous) (diff)

comment:13 in reply to:  12 Changed 11 years ago by g5pw (Aljaž Srebrnič)

Replying to egall@…:

Could we see the log of the segfault? Is it a segfault while compiling or a segfault while running? (Also, while you're at it, try re-checking each of the sub-issues that larryv opened and see if any of them contain any inspiration)

I'll attach the main.log. Segfault is while running the stage0 compiler, or at least I think it is.

Changed 11 years ago by g5pw (Aljaž Srebrnič)

Attachment: main.log added

Segfault during build

comment:14 in reply to:  7 Changed 11 years ago by cooljeanius (Eric Gallager)

Replying to larryv@…:

Given its breadth of topics, this ticket should have been reported as multiple tickets.

I just realized you missed listing #38285 here for the bootstrapping issue

comment:15 Changed 11 years ago by cooljeanius (Eric Gallager)

Also we might want to keep an eye on what Homebrew is doing with their Rust formula (you know, for reference purposes): https://github.com/mxcl/homebrew/commit/bfd7b21699495591ada37fef3f9326439badf03a

comment:16 in reply to:  15 Changed 11 years ago by larryv (Lawrence Velázquez)

Replying to egall@…:

Also we might want to keep an eye on what Homebrew is doing with their Rust formula (you know, for reference purposes): https://github.com/mxcl/homebrew/commit/bfd7b21699495591ada37fef3f9326439badf03a

Yeah, g5pw and I were talking about that on IRC a few hours ago. Other than two of the patches, there isn’t really anything useful there.

Can’t get at the Fink package, if there is one, on account of their website being down. I’m currently checking out the FreeBSD port.

comment:17 Changed 11 years ago by larryv (Lawrence Velázquez)

I’ve merged my branch back into trunk in r104052. This takes care of most but not all issues (#38383, for instance).

comment:18 Changed 11 years ago by cooljeanius (Eric Gallager)

If the only issue related to this that's still open is #38383 (nice number btw), I'd say we can close this one.

Edit: actually #38286 is still open so nvm

Version 1, edited 11 years ago by cooljeanius (Eric Gallager) (previous) (next) (diff)

comment:19 in reply to:  6 Changed 11 years ago by cooljeanius (Eric Gallager)

Replying to larryv@…:

  • use build.type gnu and depend on gmake

A dependency is not necessary; OS X comes with GNU Make.

What about on platforms other than OS X?

This should be handled in base, like the BSD Make dependency is.

Opened a separate issue for this: #38451

Edit: was fixed in r104303

Last edited 11 years ago by cooljeanius (Eric Gallager) (previous) (diff)

comment:20 Changed 11 years ago by cooljeanius (Eric Gallager)

Now that rust is at version 0.6 (as of r105535), this ticket can be closed, since this ticket was about version 0.5.

comment:21 Changed 11 years ago by larryv (Lawrence Velázquez)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.