[MacPorts] #58018: MacPorts fails to run after manual install via tarball

MacPorts noreply at macports.org
Mon Feb 4 01:54:34 UTC 2019


#58018: MacPorts fails to run after manual install via tarball
---------------------+--------------------
  Reporter:  dlo     |      Owner:  (none)
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:  2.5.4
Resolution:          |   Keywords:
      Port:          |
---------------------+--------------------

Comment (by ryandesign):

 Replying to [ticket:58018 dlo]:
 > (Side note: I would recommend explaining to more technical users why
 "sudo" is necessary for the default MacPorts installation as it remains
 unclear to me after a fair amount of searching around.)
 >
 > I decided to install MacPorts in my home directory, under
 $HOME/macports.
 >
 > My configure command:
 >
 > {{{
 > ./configure --with-no-root-privileges --prefix=$HOME/macports
 > }}}

 Installing without root privileges is possible but is not recommended
 because it is less secure. When started with root privileges, MacPorts
 drops to an unprivileged "macports" user. Thus, MacPorts cannot affect
 your files and it cannot affect your operating system files (because the
 "macports" user does not have permission to do that) except at those very
 limited times when MacPorts must elevate itself back to root in order to
 install files. This is more secure than a non-root installation in which
 MacPorts has the ability to affect your user files at any time and a
 badly-written Portfile or build system could harm your files. In addition,
 with a non-root MacPorts installation, any rogue process on your machine
 could overwrite MacPorts-installed files without your knowledge; with a
 root MacPorts installation, that would not be possible without you
 providing your administrator password.

 Configuring with a non-default prefix is possible but is not recommended
 because then you cannot benefit from our precompiled binaries and you will
 have to spend time compiling every port you want to install.

 I agree that we should add this information to our documentation.

 > I then ran:
 >
 > {{{
 > make && make install
 > }}}
 >
 > The last command seemed to run into a few failures, notably:
 >
 > {{{
 > chmod -h 555 "/Users/dan/macports/bin/portf" "/Users/dan/macports/bin
 /port-tclsh"
 > chmod: invalid option -- 'h'
 > Try 'chmod --help' for more information.
 > make[2]: *** [install] Error 1
 > make[1]: *** [install] Error 1
 > make: *** [install] Error 1
 > }}}
 >
 > Well, odd, I thought, but I didn't specify anything outside of the
 ordinary so figured that this must have been a false alarm. (After some
 digging, it turns out that coreutils / GNU chmod acts differently than the
 one bundled into macOS. May want to check for that in the configure
 step...).

 That's correct. I guess we expect you to be using BSD chmod, as provided
 by Apple with macOS. Placing GNU utilities before BSD utilities in your
 PATH is a sure way to break things on macOS, so don't do that.

 Replying to [comment:1 dlo]:
 > Update: after removing coreutils chmod from my $PATH, the `make install`
 step still fails with the same error.

 Did you run `make clean` first, and rerun the `./configure` step? If not,
 try that.


 > Anywho, I then ran `port install git` to test things out and got this
 error message:
 >
 > {{{
 > $ port install git
 > sources_conf must be set in
 /Users/dan/macports/etc/macports/macports.conf or in your
 /Users/dan/.macports/macports.conf file
 >     while executing
 > "mportinit ui_options global_options global_variations"
 > Error: /Users/dan/macports/bin/port: Failed to initialize MacPorts,
 sources_conf must be set in /Users/dan/macports/etc/macports/macports.conf
 or in your /Users/dan/.macports/macports.conf file
 > }}}

 The message is correct. `sources_conf` must be set in macports.conf. It is
 set there by default, so you either removed it or perhaps you have an
 ancient copy of macports.conf from a previous MacPorts installation from
 before the `sources_conf` option existed. Compare your macports.conf with
 our macports.conf.default and adopt all the changes that you can.

-- 
Ticket URL: <https://trac.macports.org/ticket/58018#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list