Page MenuHomeFreeBSD

lang/rust: Use LLVM from ports + cleanups
ClosedPublic

Authored by dumbbell on May 6 2015, 7:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 10 2024, 8:12 AM
Unknown Object (File)
Nov 9 2024, 2:39 AM
Unknown Object (File)
Nov 9 2024, 12:54 AM
Unknown Object (File)
Nov 9 2024, 12:54 AM
Unknown Object (File)
Nov 9 2024, 12:50 AM
Unknown Object (File)
Nov 9 2024, 12:39 AM
Unknown Object (File)
Nov 9 2024, 12:17 AM
Unknown Object (File)
Nov 9 2024, 12:17 AM

Details

Reviewers
jonathan
kwm
Summary

Other changes:

  • Perl is not required.
  • Python is a build dependency only.
  • rust doesn't build if it's already installed because it picks the libraries in /usr/local/lib first. I added a patch to remove these implicit lib search directories.
  • Install ${PREFIX}/lib/rustlib/manifest-rustc to be as close as possible to the official rust installer.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

dumbbell retitled this revision from to lang/rust: Update to 1.0.0-beta.4.
dumbbell updated this object.
dumbbell edited the test plan for this revision. (Show Details)
dumbbell added reviewers: kwm, robak.

See inline comment.

lang/rust/Makefile
5–6

That looks ugly and non intuitive, why dont you do it the other way around with RUST_VERSION being built out of PORTVERSION?

lang/rust/Makefile
5–6

I read the Porter's handbook again and I missed the paragraph about "1.0.0-beta.4" -> "1.0.0b4". Sorry, I'm fixing it.

dumbbell edited edge metadata.

Fix PORTVERSION

It should be 1.0.0b4, not 1.0.0.beta.4.

lang/rust/Makefile
5–6

how about DISTVERSION like graphics/ImageMagick uses?

96

Ugh this looks ugly. This might not work but could you try:


INSTALL_TARGET=install-strip

instead of the strip_CMD line?
or else replace it with:


@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/rust* \
${STAGEDIR}${PREFIX}/lib/*.so

${STAGEDIR}${PREFIX}/lib/rustlib/*.so

Yes it is longer but imo, it readable atleast :)

  • Use DISTVERSION instead of messing with PORTVERSION and RUST_VERSION.
  • Simplify stripping of binaries.

install-strip is not a valid target, rust doesn't use the autotools.

  • Add rust as a build conflict because the bootstrapped rustc adds -L/usr/local/lib as the first lib search path.
  • Remove perl5 as a dependency.
  • python2 is a build dependency only, not a runtime one.
  • Use LLVM 3.6 from Ports; this avoids the build of LLVM shipped with rust sources.
  • Clean staging directory in case a previous stage failed.
  • Fix paths given to ${STRIP_CMD}...

USE_LDCONFIG is useless now, libraries used by rustc are in ${LOCALBASE}/lib.

lang/rust/Makefile
45

There is no link with the llvm libraries, like the mesa ports do?

lang/rust/Makefile
45

No, there isn't.

23:22 <@kwm> jbeich: dumbell is working on a rust update
23:23 <@kwm> jbeich: https://reviews.freebsd.org/D2466
23:25 < brd\> will@ has one that he is about to commit too :(
23:27 <@kwm> brd\: oh, hmm. maybe merge the two?
23:32 < brd\> kwm: yeah, talking to him
23:33 < brd\> kwm: combined it is better :)

My version of this patch (before I knew anyone else was looking) has a few extra changes:

  • Use REINPLACE_CMD instead of patching curl/wget & forced-clang in configure. This is (still) required to pass poudriere builds.
  • Run the unit test suite, i.e. "gmake check".
  • Enable & ship the docs -- I determined that they only add a few % extra size, so they should at least be supported via PORTDOCS.
  • Set VERBOSE=1 unconditionally; its behavior is more like how FreeBSD usually builds things.

I also have a version of the port for the nightly builds (as lang/rust-devel). Given the pace of Rust's development, I think this port offers developers access to its newer features, although it would require updating more frequently.

My version does not have:

  • The manifest manipulation: would be nice if it was documented why this is necessary. Is this to account for removing files related to Rust's separate installer? Why bother? Is there a real concern someone might try to use the Rust install scripts?

That said, given that this update didn't hit ports before 1.0 shipped, we should rebase to 1.0 now. Anybody working on that?

In D2466#47594, @will wrote:

My version of this patch (before I knew anyone else was looking) has a few extra changes:

  • Use REINPLACE_CMD instead of patching curl/wget & forced-clang in configure. This is (still) required to pass poudriere builds.

Why are they required? What's the difference between Poudriere and a plain FreeBSD?

  • Run the unit test suite, i.e. "gmake check".
  • Enable & ship the docs -- I determined that they only add a few % extra size, so they should at least be supported via PORTDOCS.

Both points are nice!

  • Set VERBOSE=1 unconditionally; its behavior is more like how FreeBSD usually builds things.

I'm fine with that.

I also have a version of the port for the nightly builds (as lang/rust-devel). Given the pace of Rust's development, I think this port offers developers access to its newer features, although it would require updating more frequently.

I agree.

My version does not have:

  • The manifest manipulation: would be nice if it was documented why this is necessary. Is this to account for removing files related to Rust's separate installer? Why bother? Is there a real concern someone might try to use the Rust install scripts?

I did it to be as close as possible to the official Rust standalone installer and in case, developers expect to find this manifest.

That said, given that this update didn't hit ports before 1.0 shipped, we should rebase to 1.0 now. Anybody working on that?

Not me.

However, I worked on a port for Cargo (also ready, just waiting for this change or yours to land before pushing it to Phabricator).

Why are they required? What's the difference between Poudriere and a plain FreeBSD?

Because in poudriere, packages are built in a clean environment. Your "plain FreeBSD" machine presumably has wget or curl already installed, hence not failing. If you committed this change without accounting for a clean environment, the FreeBSD.org package builders (which use poudriere) would fail the build.

I did it to be as close as possible to the official Rust standalone installer and in case, developers expect to find this manifest.

Ok, fair enough.

That said, given that this update didn't hit ports before 1.0 shipped, we should rebase to 1.0 now. Anybody working on that?

Not me.

However, I worked on a port for Cargo (also ready, just waiting for this change or yours to land before pushing it to Phabricator).

Ok, I'm working on an update for 1.0.

And @riggs committed a third version of the update in rP386722 :-)

I think several changes you and I made are still relevant.

In version 1.0.0 source was restricted to owner rwx which means
only root can install. I had to prepend the following here

post-extract:
(cd ${WRKSRC}; \
	find . -type d -exec chmod 0755 {} \;)

which only covers directories

lang/rust/Makefile
61

In version 1.0.0 source was restricted to owner rwx which means
only root can install. I had to prepend the following here

(cd ${WRKSRC}; \
	find . -type d -exec chmod 0755 {} \;)

which only covers directories

dumbbell edited edge metadata.

Rebase the patch for the already committed rust 1.0.0 port

dumbbell retitled this revision from lang/rust: Update to 1.0.0-beta.4 to lang/rust: Use LLVM from ports + cleanups.May 29 2015, 10:31 PM
dumbbell updated this object.
dumbbell added a reviewer: jonathan.

Fix directory permissions in the source tree

Suggested by @portmaster_BSDforge.com.

jonathan edited edge metadata.
This revision is now accepted and ready to land.Jun 17 2015, 12:06 AM
dumbbell marked an inline comment as done.

Committed as rP390497.