Bug 200315 - lang/rust: No rule to make target 'prepare_install'
Summary: lang/rust: No rule to make target 'prepare_install'
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-19 03:10 UTC by Justin Yang
Modified: 2016-03-13 13:25 UTC (History)
4 users (show)

See Also:


Attachments
Allow installation by more than just root (337 bytes, patch)
2015-05-20 17:35 UTC, Chris Hutchinson
no flags Details | Diff
Same as above. But with files. (401 bytes, patch)
2015-05-20 22:38 UTC, Chris Hutchinson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Yang 2015-05-19 03:10:22 UTC
I just update my ports tree and try to install the latest (1.0) `lang/rust` port, however, it fails with the following errors:

...skip...
cfg: including install rules
gmake: stat: GNUmakefile: 拒绝访问 (Access denied)
gmake: stat: makefile: 拒绝访问 (Access denied)
gmake: stat: Makefile: 拒绝访问 (Access denied)
gmake: stat: prepare_install: 拒绝访问 (Access denied)
gmake: *** No rule to make target 'prepare_install'。 停止 (Stopped)。
/usr/ports/lang/rust/work/rustc-1.0.0/mk/install.mk:14: recipe for target 'install' failed
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.0.0'
*** Error code 2

Stop.
make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust

===>>> make stage failed for lang/rust
===>>> Aborting update


===>>> You can restart from the point of failure with this command line:
       portmaster <flags> lang/rust 

My computer runs FreeBSD 10.1 amd64, upgraded from 10.0 by compiling from source using GENERIC kernel. If more information is needed, don't hesitate to tell me. Thanks.
Comment 1 John Marino freebsd_committer freebsd_triage 2015-05-19 09:11:16 UTC
as a bystander:

1) I think "(Access denied)" is probably the issue
2) You are using portmaster which is known to be crap.  Try to reproduce the error using poudriere. In other words, the second that it's apparent that portmaster is being used, just automatically assume that's the issue.
Comment 2 Justin Yang 2015-05-19 13:08:46 UTC
Thanks! I just go into the `/usr/ports/lang/rust` and run `make clean && make install clean`, it goes without any issues and installs rust successfully. So I guess maybe it's the `portmaster` that leads to this issue.
Comment 3 Justin Yang 2015-05-20 05:03:03 UTC
Hi,

I'm back. I find the issue is raised by `sudo` rather than `portmaster`. If I go into the `/usr/ports/lang/rust` and run `sudo make install clean`, it will fail with errors "Access denied" shown. However, if I run it as root, say, just `make install clean`, it builds and installs without any problems. A bit strange.

P.S.: My `sudo` version is 1.8.13, compiled from ports:

justin@darkgeek-freebsd.pts/1 ~ % pkg info sudo
sudo-1.8.13
Name           : sudo
Version        : 1.8.13
Installed on   : Tue Mar 24 09:58:09 CST 2015
Origin         : security/sudo
Architecture   : freebsd:10:x86:64
Prefix         : /usr/local
Categories     : security
Licenses       : sudo
Maintainer     : garga@FreeBSD.org
WWW            : http://www.sudo.ws/
Comment        : Allow others to run commands as root
Options        :
	AUDIT          : on
	DISABLE_AUTH   : off
	DISABLE_ROOT_SUDO: off
	DOCS           : on
	INSULTS        : off
	LDAP           : off
	NLS            : on
	NOARGS_SHELL   : off
	OPIE           : off
	SSSD           : off
Shared Libs required:
	libintl.so.8
Shared Libs provided:
	libsudo_util.so.0
Annotations    :
Flat size      : 3.22MiB
Description    :
This is the CU version of sudo.
Comment 4 Chris Hutchinson 2015-05-20 15:27:48 UTC
I was looking at this for use in another project.
I ran into the same issue. I'll have a patch [to correct this] shortly.

--Chris
Comment 5 Chris Hutchinson 2015-05-20 16:56:56 UTC
If you're anxious. It's the permissions of the source.
changing the Make file from:

post-extract:
	@${MKDIR} ${WRKSRC}/dl
	${LN} -sf ${DISTDIR}/${RUST_BOOT} ${WRKSRC}/dl

to:

post-extract:
	cd ${WRKSRC}
	find . -type d -exec chmod 0755 {} \;
	@${MKDIR} ${WRKSRC}/dl
	${LN} -sf ${DISTDIR}/${RUST_BOOT} ${WRKSRC}/dl

worked for me. :)

--Chris
Comment 6 Chris Hutchinson 2015-05-20 17:35:25 UTC
Created attachment 156979 [details]
Allow installation by more than just root

lang/rust PATCH to allow installation by normal users.
The permissions in the [source] tar ball are [currently]
too restrictive. The attached patch corrects that.

--Chris
Comment 7 Chris Hutchinson 2015-05-20 22:38:05 UTC
Created attachment 156991 [details]
Same as above. But with files.

Same as above. But I previously neglected to include file perms.
This one takes care of the files rooted in those directories.
Comment 8 Justin Yang 2015-05-21 01:43:16 UTC
Hi,

Thanks for your patch. I applied it to my ports tree and tried to build it. However, it failed with the following errors:

...skip...
cleaning destination tmp/dist/rustc-1.0.0-dev-x86_64-unknown-freebsd-image
prepare: tmp/dist/rustc-1.0.0-dev-x86_64-unknown-freebsd-image/bin
mkdir: tmp/dist: Permission denied
/usr/ports/lang/rust/work/rustc-1.0.0/mk/dist.mk:208: recipe for target 'prepare-host-dirs-dir-x86_64-unknown-freebsd' failed
gmake: *** [prepare-host-dirs-dir-x86_64-unknown-freebsd] Error 1
/usr/ports/lang/rust/work/rustc-1.0.0/mk/install.mk:14: recipe for target 'install' failed
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.0.0'
*** Error code 2

Stop.
make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust

Looks we still miss something?
Comment 9 Chris Hutchinson 2015-05-21 03:39:25 UTC
(In reply to Justin Yang from comment #8)
> Hi,
> 
> Thanks for your patch. I applied it to my ports tree and tried to build it.
> However, it failed with the following errors:
> 
> ...skip...
> cleaning destination tmp/dist/rustc-1.0.0-dev-x86_64-unknown-freebsd-image
> prepare: tmp/dist/rustc-1.0.0-dev-x86_64-unknown-freebsd-image/bin
> mkdir: tmp/dist: Permission denied
> /usr/ports/lang/rust/work/rustc-1.0.0/mk/dist.mk:208: recipe for target
> 'prepare-host-dirs-dir-x86_64-unknown-freebsd' failed
> gmake: *** [prepare-host-dirs-dir-x86_64-unknown-freebsd] Error 1
> /usr/ports/lang/rust/work/rustc-1.0.0/mk/install.mk:14: recipe for target
> 'install' failed
> gmake[2]: *** [install] Error 2
> gmake[2]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.0.0'
> *** Error code 2
> 
> Stop.
> make[1]: stopped in /usr/ports/lang/rust
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/ports/lang/rust
> 
> Looks we still miss something?

Bummer. Just in case. Did you perform the following:

cd /usr/ports/lang/rust
make deinstall
make clean
make rmconfig

before you attempted the make install?
Oh, and you used the second patch that included the file
permissions, right? Not the first one I posted.

If so. You may want to wait for 1.0.0b4, which won't come
with a prebuilt clang. But use the version in BASE. You can
follow along here:

https://reviews.freebsd.org/D2466

Best wishes.

--Chris
Comment 10 Justin Yang 2015-05-21 03:59:50 UTC
(In reply to Chris Hutchinson from comment #9)
Thanks, and yes, I did deinstall the package and clean it before installing. In addition, I use the second patch you provide.

I think I'd better wait for the next update.
Comment 11 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2015-07-14 22:39:54 UTC
Hi!

I believe this is fixed in the Ports tree. Can you confirm this?

Thanks!
Comment 12 Justin Yang 2015-07-15 04:45:49 UTC
(In reply to Jean-Sebastien Pedron from comment #11)
Hi,

If I build `lang/rust` in poudriere, everything is fine. However, if I have `lang/rust` installed on computer and then compile it from ports by `make install clean`, it throws the following errors:

===
...skip...
note: /usr/bin/ld: warning: libedit.so.7, needed by /usr/local/lib/librustc_driver-7d23ff90.so, may conflict with libedit.so.0
x86_64-unknown-freebsd/stage0/lib/rustlib/x86_64-unknown-freebsd/bin/rustc.o: In function `main::ha415815a2dd502c0faa':
driver.0.rs:(.text._ZN4main20ha415815a2dd502c0faaE+0x1): undefined reference to `main::heb37d758b258944e7cd'
x86_64-unknown-freebsd/stage0/lib/rustlib/x86_64-unknown-freebsd/bin/rustc.o: In function `main':
driver.0.rs:(.text.main+0x14): undefined reference to `rt::lang_start::ha870adcc74760422qgw'
cc: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
/usr/ports/lang/rust/work/rustc-1.1.0/mk/target.mk:170: recipe for target 'x86_64-unknown-freebsd/stage0/lib/rustlib/x86_64-unknown-freebsd/bin/rustc' failed
gmake[2]: *** [x86_64-unknown-freebsd/stage0/lib/rustlib/x86_64-unknown-freebsd/bin/rustc] Error 101
gmake[2]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.1.0'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust
===

Not sure how to deal with it. Thanks.
Comment 13 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2015-07-16 06:43:08 UTC
Hi Justin!

Yeah, rust can't compile if there is an incompatible version installed because it picks the incompatible libraries first.

However, this is indicated in the port's Makefile:
  CONFLICTS_BUILD=        rust \
                          rust-nightly

The port should refuse to compile from the beginning. Is your Ports tree up-to-date?
Comment 14 Justin Yang 2015-07-29 04:11:55 UTC
(In reply to Jean-Sebastien Pedron from comment #13)
Hi,

Sorry for my delay. I have updated my ports tree to the latest and try to build `lang/rust` port. However. it won't stop at the beginning but proceed to build.

I have rust installed before this building:
justin@darkgeek.pts/2 ~ % pkg info | grep rust
rust-1.1.0                     Language with a focus on memory safety and concurrency

The Makefile does have an entry about conflict:
justin@darkgeek.pts/2 ~ % grep 'CONFLICTS_BUILD' /usr/ports/lang/rust/Makefile 
CONFLICTS_BUILD=	rust \

Thanks.
Comment 15 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2015-07-29 07:40:20 UTC
You're right, apparently a port can't conflict with itself, I missed that part.

I will prepare another fix.

Thank you!
Comment 16 Thomas Zander freebsd_committer freebsd_triage 2015-12-13 12:18:02 UTC
The directory permission patch has been incorporated a while ago, as well as the CONFLICTS handling.
Comment 17 synthmeat 2016-03-06 19:57:00 UTC
This is still an issue on 10.2, rust 1.7, with either portmaster or root clean install.

cleaning destination tmp/dist/rustc-1.7.0-x86_64-unknown-freebsd-image
prepare: tmp/dist/rustc-1.7.0-x86_64-unknown-freebsd-image/bin
mkdir: tmp/dist: Permission denied
/usr/ports/lang/rust/work/rustc-1.7.0/mk/dist.mk:126: recipe for target 'prepare-host-dirs-dir-x86_64-unknown-freebsd' failed
gmake: *** [prepare-host-dirs-dir-x86_64-unknown-freebsd] Error 1
/usr/ports/lang/rust/work/rustc-1.7.0/mk/install.mk:20: recipe for target 'install' failed
gmake[2]: *** [install] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/rust/work/rustc-1.7.0'
*** Error code 2

Stop.
make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust
Comment 18 Thomas Zander freebsd_committer freebsd_triage 2016-03-13 13:25:37 UTC
(In reply to synthmeat from comment #17)

continue tracking the issue via bug 207930