Closed Bug 878607 Opened 7 years ago Closed 7 years ago

bootstrap: Selecting 'mp-clang-3.2' for 'clang' failed; successful after manual installation of clang-3.2

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla25

People

(Reporter: JustinVallon, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.29.13 (KHTML, like Gecko) Version/6.0.4 Safari/536.29.13

Steps to reproduce:

Downloaded bootstrap.py from https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py.

Ran bootstrap.py, with MacPorts 2.1.3 (up-to-date as of 2013-06-02)


Actual results:

Failed at:

Executing as root: sudo /opt/local/bin/port select --set clang mp-clang-3.2
Selecting 'mp-clang-3.2' for 'clang' failed: The specified group 'clang' does not exist.



Expected results:

Seems like it shouldn't fail.  After installing clang-3.2, the "port select" was successful, and bootstrap.py was able to continue
This was caused by bug 887814.

I'd note that I had to install MacPorts manually, which installed version 2.1.3. (Once bootstrap.py had supposedly installed 'port' I opened a new Terminal and reran bootstrap.py, but it still thought it needed to install homebrew/port. I tried installing it again and rebooting this time, but still the same thing.)
Blocks: 887814
Just to be clear, bootstrap.py runs to successful completion if I revert bug 887814.
Two people running supposedly the same MacPorts tree experience different behavior. Why?

Can the differing installs reconcile their MacPorts setups and propose a fix?
The log BenWa attached in bug 887814 contains "port definitions are more than two weeks old, consider using selfupdate", so I'm not sure he is using the latest MacPorts (2.1.3).
BenWa, can you check the version of MacPorts in that VM of yours, please?

Can you then check whether you still get an error after running:

  sudo port selfupdate
  sudo port upgrade outdated
  port select --set clang mp-clang-3.2
I get following output:

$ sudo port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.1.3 installed,
MacPorts base version 2.1.3 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated

$ sudo port upgrade outdated
Error: No ports matched the given expression

$ sudo port select --set clang mp-clang-3.2
Selecting 'mp-clang-3.2' for 'clang' succeeded. 'mp-clang-3.2' is now active.

$ sudo python bootstrap.py 

Looks like you have MacPorts installed. We will install all required packages via MacPorts.

Executing as root: /opt/local/bin/port select --set python python27
Selecting 'python27' for 'python' succeeded. 'python27' is now active.
Executing as root: /opt/local/bin/port select --set clang clang-3.2
Selecting 'clang-3.2' for 'clang' failed: The specified version 'clang-3.2' is not valid.
Traceback (most recent call last):
  File "bootstrap.py", line 143, in <module>
    sys.exit(main(sys.argv))
  File "bootstrap.py", line 134, in main
    dasboot.bootstrap()
  File "/tmp/tmp4Ufu8F/mozboot/bootstrap.py", line 78, in bootstrap
    sys.path.append(include)
  File "/tmp/tmp4Ufu8F/mozboot/osx.py", line 136, in install_system_packages
  File "/tmp/tmp4Ufu8F/mozboot/osx.py", line 243, in ensure_macports_packages
  File "/tmp/tmp4Ufu8F/mozboot/base.py", line 103, in run_as_root
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'/opt/local/bin/port', u'select', u'--set', u'clang', u'clang-3.2']' returned non-zero exit status 1

(In reply to Jonathan Watt [:jwatt] from comment #5)
> BenWa, can you check the version of MacPorts in that VM of yours, please?
> 
> Can you then check whether you still get an error after running:
> 
>   sudo port selfupdate
>   sudo port upgrade outdated
>   port select --set clang mp-clang-3.2
Flags: needinfo?(bgirard)
Jonathan,

I made modification to osx.py in my local copy and it fixed the issue. Now, I am able to run the tool successfully.

Original Line:
self.run_as_root([self.port, 'select', '--set', 'clang', MACPORTS_CLANG_PACKAGE])

Modified Line:
self.run_as_root([self.port, 'select', '--set', 'clang', 'mp-' + MACPORTS_CLANG_PACKAGE])
Yes, that's essentially what I said in comment 1 and comment 2.
So it sounds like we should revert bug 887814?
I also see the breakage reported by :jwatt. I believe this change was incorrect and should be reverted. The MacPorts package name is clang-2.3, but it is installed as mp-clang-2.3 to avoid overwriting existing copies of clang (see http://trac.macports.org/ticket/29171). As osx.py is using MacPorts, we should be using the MacPort-installed mp-clang-2.3.
(In reply to Arthur Edelstein from comment #10)
> I also see the breakage reported by :jwatt. I believe this change was
> incorrect and should be reverted. The MacPorts package name is clang-2.3,
> but it is installed as mp-clang-2.3 to avoid overwriting existing copies of
> clang (see http://trac.macports.org/ticket/29171). As osx.py is using
> MacPorts, we should be using the MacPort-installed mp-clang-2.3.

Sorry, I should have written 3.2, not 2.3 here.
I reverted bug 887814.

https://hg.mozilla.org/mozilla-central/rev/b453f2f37de1
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Flags: needinfo?(bgirard)
Happening for me again:
./mach bootstrap

Looks like you have MacPorts installed. We will install all required packages via MacPorts.

Executing as root: sudo /opt/local/bin/port select --set python python27
Selecting 'python27' for 'python' succeeded. 'python27' is now active.
Executing as root: sudo /opt/local/bin/port select --set clang mp-clang-3.2
Selecting 'mp-clang-3.2' for 'clang' failed: The specified group 'clang' does not exist.
Error running mach:

    ['bootstrap']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

CalledProcessError: Command '[u'sudo', u'/opt/local/bin/port', u'select', u'--set', u'clang', u'mp-clang-3.2']' returned non-zero exit status 1

  File "/Users/cabanier/mozilla_integrate/src/python/mozboot/mozboot/mach_commands.py", line 24, in bootstrap
    bootstrapper.bootstrap()
  File "/Users/cabanier/mozilla_integrate/src/python/mozboot/mozboot/bootstrap.py", line 85, in bootstrap
    instance.install_system_packages()
  File "/Users/cabanier/mozilla_integrate/src/python/mozboot/mozboot/osx.py", line 168, in install_system_packages
    getattr(self, 'ensure_%s_packages' % choice)()
  File "/Users/cabanier/mozilla_integrate/src/python/mozboot/mozboot/osx.py", line 291, in ensure_macports_packages
    self.run_as_root([self.port, 'select', '--set', 'clang', 'mp-' + MACPORTS_CLANG_PACKAGE])
  File "/Users/cabanier/mozilla_integrate/src/python/mozboot/mozboot/base.py", line 113, in run_as_root
    subprocess.check_call(command, stdin=sys.stdin)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)

I had xcode 5.0 installed earlier but downgraded to 4.6 again.
If this is fixed, is there a workaround? What is it? I am on Mac OS 10.8.4, have Xcode 4.6.3 installed.

sh-3.2# python bootstrap.py

Looks like you have MacPorts installed. We will install all required packages via MacPorts.

Executing as root: /opt/local/bin/port select --set python python27
Selecting 'python27' for 'python' succeeded. 'python27' is now active.
Executing as root: /opt/local/bin/port select --set clang mp-clang-3.2
Selecting 'mp-clang-3.2' for 'clang' failed: The specified group 'clang' does not exist.
Traceback (most recent call last):
  File "bootstrap.py", line 142, in <module>
    sys.exit(main(sys.argv))
  File "bootstrap.py", line 133, in main
    dasboot.bootstrap()
  File "/tmp/tmph7aEKo/mozboot/bootstrap.py", line 89, in bootstrap
    # after this script has finished executing.
  File "/tmp/tmph7aEKo/mozboot/osx.py", line 168, in install_system_packages
  File "/tmp/tmph7aEKo/mozboot/osx.py", line 291, in ensure_macports_packages
  File "/tmp/tmph7aEKo/mozboot/base.py", line 113, in run_as_root
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'/opt/local/bin/port', u'select', u'--set', u'clang', u'mp-clang-3.2']' returned non-zero exit status 1
I was also facing the same problem with the latest release. In my case it was Selecting 'mp-clang-3.3' for 'clang' failed: The specified group 'clang' does not exist.

So i just installed clang 3.3 using Macports and reran bootstrap.py and it worked fine...
After I upgraded, I was getting the error about clang-3.3 also. I also got the correct version from MacPorts and it worked.

Note to self (or anyone else who gets to it quicker) that this could be documented better in https://developer.mozilla.org/en-US/docs/Simple_Firefox_build/Linux_and_MacOS_build_preparation. This problem could be mentioned as a possible problem.

I wonder if fetching mach from git (and how does one do that?) and running "mach bootstrap" would have worked. Probably not. This command probably just does a fetch and run of the bootstrap.py file.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.