New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #38279 (closed defect: fixed)

Opened 14 months ago

Last modified 12 months ago

rust @0.5: multiple issues

Reported by: egall@… Owned by: g5pw@…
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: larryv@…
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

rust.diff (6.4 KB) - added by g5pw@… 14 months ago.
Diff of the rust directory
main.log (68.3 KB) - added by g5pw@… 13 months ago.
Segfault during build

Change History

comment:1 Changed 14 months ago by g5pw@…

  • Status changed from new to assigned
  • Owner changed from macports-tickets@… to g5pw@…

Thank you for this. Will fix tomorrow.

comment:2 Changed 14 months ago by egall@…

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 ; follow-ups: ↓ 4 ↓ 5 Changed 14 months ago by larryv@…

  • 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 14 months ago by larryv@…

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 ; follow-up: ↓ 6 Changed 14 months ago by egall@…

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 ; follow-up: ↓ 19 Changed 14 months ago by larryv@…

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 follow-ups: ↓ 8 ↓ 14 Changed 14 months ago by 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.

comment:8 in reply to: ↑ 7 ; follow-up: ↓ 9 Changed 14 months ago by g5pw@…

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 14 months ago by egall@…

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 14 months ago by egall@… (previous) (diff)

comment:10 follow-up: ↓ 12 Changed 14 months ago by 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.

Changed 14 months ago by g5pw@…

Diff of the rust directory

comment:11 Changed 14 months ago by larryv@…

  • Cc larryv@… added

Cc Me!

comment:12 in reply to: ↑ 10 ; follow-up: ↓ 13 Changed 14 months ago by egall@…

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 14 months ago by egall@… (previous) (diff)

comment:13 in reply to: ↑ 12 Changed 13 months ago by g5pw@…

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 13 months ago by g5pw@…

Segfault during build

comment:14 in reply to: ↑ 7 Changed 13 months ago by egall@…

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 follow-up: ↓ 16 Changed 13 months ago by 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

comment:16 in reply to: ↑ 15 Changed 13 months ago by larryv@…

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 13 months ago by larryv@…

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 13 months ago by egall@…

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

Double Edit: now that's closed so double nvm

Last edited 13 months ago by egall@… (previous) (diff)

comment:19 in reply to: ↑ 6 Changed 13 months ago by egall@…

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 13 months ago by egall@… (previous) (diff)

comment:20 Changed 12 months ago by egall@…

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 12 months ago by larryv@…

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.