Opened 11 years ago
Closed 11 years ago
#39230 closed defect (fixed)
clang-{3.0,3.1,3.2}, clang-3.3 @3.3-r180025: can't stage to destroot in non-root install (no +no_root variant)
Reported by: | posita (Matt Bogosian) | Owned by: | larryv (Lawrence Velázquez) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.3 |
Keywords: | Cc: | su-v, larryv (Lawrence Velázquez), jeremyhu (Jeremy Huddleston Sequoia), cooljeanius (Eric Gallager) | |
Port: | clang-3.0 clang-3.1 clang-3.2 clang-3.3 |
Description
Built on 10.6.8 with Xcode 4.2. Build commands tried (all with same error):
% port install clang-3.3 ... % port install clang-3.3 configure.compiler=llvm-gcc-4.2 ... % port install clang-3.3 +no_root ... % port install clang-3.3 +no_root configure.compiler=llvm-gcc-4.2 ...
Error tail:
... :info:destroot chown: /__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/destroot/__PATH__/libexec/llvm-3.3/lib/c++/v1/vector: Operation not permitted :info:destroot chown: /__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/destroot/__PATH__/libexec/llvm-3.3/lib/c++/v1: Operation not permitted :info:destroot chown: /__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/destroot/__PATH__/libexec/llvm-3.3/lib/c++: Operation not permitted :info:destroot make[3]: *** [installheaders] Error 1 :info:destroot make[3]: Leaving directory `/__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/trunk/projects/libcxx' :info:destroot make[2]: *** [install-local] Error 2 :info:destroot make[2]: Leaving directory `/__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/trunk/tools/clang/runtime/libcxx' :info:destroot make[1]: *** [libcxx/.makeinstall] Error 2 :info:destroot make[1]: Leaving directory `/__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/trunk/tools/clang/runtime' :info:destroot make: *** [install] Error 1 :info:destroot make: Leaving directory `/__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/trunk' :info:destroot Command failed: cd "/__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/trunk" && /Developer/usr/bin/make -w install-clang DESTDIR=/__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/destroot :info:destroot Exit code: 2 :error:destroot org.macports.destroot for port clang-3.3 returned: command execution failed :debug:destroot Error code: CHILDSTATUS 16558 2 :debug:destroot Backtrace: command execution failed while executing "system -nice 0 $fullcmdstring" ("eval" body line 1) invoked from within "eval system $notty $nice \$fullcmdstring" invoked from within "command_exec destroot" (procedure "portdestroot::destroot_main" line 2) invoked from within "$procedure $targetname" :info:destroot Warning: targets not executed for clang-3.3: org.macports.activate org.macports.destroot org.macports.install
Attachments (2)
Change History (15)
Changed 11 years ago by posita (Matt Bogosian)
comment:1 Changed 11 years ago by larryv (Lawrence Velázquez)
Cc: | jeremyhu@… removed |
---|---|
Owner: | changed from macports-tickets@… to jeremyhu@… |
comment:2 Changed 11 years ago by posita (Matt Bogosian)
Incidentally (but unsurprisingly) this issue likely plagues other versions as well (I have confirmed a similar error when attempting to install clang-3.2).
Note that clang-3.3 and -3.2 build just fine. It's the install phase in which they fail.
I should also note that this instance of MacPorts itself was configured with the following options:
./configure --prefix="${HOME}/.site" --with-no-root-privileges \ --with-install-user="$(id -n -u)" --with-install-group="$(id -n -g)" \ --with-applications-dir="${HOME}/Applications/MacPorts" \ --with-frameworks-dir="${HOME}/Library/Frameworks" \ --with-directory-mode=2750
comment:3 Changed 11 years ago by larryv (Lawrence Velázquez)
Line 36749:
:info:destroot chown -R root:wheel /__PATH__/var/macports/build/___PATH___var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/destroot/__PATH__/libexec/llvm-3.3/lib/c++
Changing file ownership requires superuser privileges.
comment:4 Changed 11 years ago by posita (Matt Bogosian)
Shouldn't it avoid using root:wheel explicitly in a local (non-root) user install of MacPorts (e.g., with ... --with-no-root-privileges --with-install-user="$(id -n -u)" --with-install-group="$(id -n -g)" ... )? As far as I can see, there's no setuid, so root:wheel doesn't appear necessary. I might have missed something?
comment:6 Changed 11 years ago by posita (Matt Bogosian)
For version 3.3, the offending chown command can be found on line 38 of the libcxx/Makefile:
1 ## 2 # libcpp Makefile 3 ## 4 ... 32 33 # The installheaders target is used by clang's runtime/libcxx makefile. 34 installheaders:: 35 mkdir -p $(HEADER_DIR)/c++/v1/ext 36 rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* \ 37 $(HEADER_DIR)/c++/v1/ 38 >>>> chown -R root:wheel $(HEADER_DIR)/c++ <<<< 39 chmod 755 $(HEADER_DIR)/c++/v1 40 chmod 644 $(HEADER_DIR)/c++/v1/* 41 chmod 755 $(HEADER_DIR)/c++/v1/ext 42 chmod 644 $(HEADER_DIR)/c++/v1/ext/* 43 ...
When I commented out line 38 in /PATH/var/macports/build/_PATH_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-3.3/clang-3.3/work/trunk/projects/libcxx/Makefile, my build completed without issue.
I do not know enough about port files to know how to apply a patch conditioned on a non-root install. I'm hoping the above info makes it easy for someone with more expertise....
comment:8 follow-up: 9 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)
We should be able to just delete the chown … no need to make it conditional on non-root installs
Changed 11 years ago by larryv (Lawrence Velázquez)
Attachment: | remove-chown-libcxx.patch added |
---|
fix for clang-3.0, clang-3.1, clang-3.2
comment:9 Changed 11 years ago by larryv (Lawrence Velázquez)
The attached patch should take care of this.
comment:10 follow-up: 13 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Owner: | changed from jeremyhu@… to larryv@… |
---|
Thanks. Please push your change.
comment:13 Changed 11 years ago by larryv (Lawrence Velázquez)
Port: | clang-3.0 clang-3.1 clang-3.2 added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Summary: | clang-3.3 @3.3-r180025 can't stage to destroot in non-root install (no +no_root variant) → clang-{3.0,3.1,3.2}, clang-3.3 @3.3-r180025: can't stage to destroot in non-root install (no +no_root variant) |
Sure thing. r108565 for 3.0 through 3.2 only, since this was fixed in 3.3 stable.
build log