[SERVER-5575] Building Mongo fails with the --64 flag on OSX Created: 11/Apr/12  Updated: 07/Apr/15  Resolved: 06/Apr/15

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.1.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Barrie Segal Assignee: Andy Schwerin
Resolution: Done Votes: 1
Labels: build
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MacOS version 10.7.3, xcode version 4.1, scons version: 2.0.1, and python version: 2 7 2 'final' 0


Attachments: Text File SConscript.client.patch     Text File SConscript.client.patch    
Backwards Compatibility: Fully Compatible
Operating System: OS X
Participants:

 Description   

When using OSX 10.6+, the --64 flag is not necessary (the 64-bit version will be built automatically), but when it is included, it causes an error:

$ sudo scons --prefix=/opt/mongo  --64 --full install
 
Install file: "build/darwin/64/client_build/libmongoclient.a" as "libmongoclient.a"
Install file: "libmongoclient.a" as "/opt/mongo/lib/libmongoclient.a"
scons: *** [/opt/mongo/lib/libmongoclient.a] AssertionError : Installing source ['libmongoclient.a', 'build/darwin/64/client_build/libmongoclient.a'] into target ['/opt/mongo/lib/libmongoclient.a']: target and source lists must have same length.
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.0.1/SCons/Action.py", line 1046, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.0.1/SCons/Tool/install.py", line 79, in installFunc
    "Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target)))
AssertionError: Installing source ['libmongoclient.a', 'build/darwin/64/client_build/libmongoclient.a'] into target ['/opt/mongo/lib/libmongoclient.a']: target and source lists must have same length.
scons: building terminated because of errors.

The following compiles just fine:
$ sudo scons --prefix=/opt/mongo install

(The above was done using commit 82b5219b3a2989f99bd33f3300eae22aeeac947c)



 Comments   
Comment by Jonathan Reams [ 06/Apr/15 ]

We removed the --64 flag in SERVER-9562.

Comment by Ultrabug [ 11/Sep/12 ]

A bit more infos on this case. We've experienced the same issue on x86 boxes [1] but this patch introduced an installation problem on amd64 boxes [2] which could lead to some unusable systems when /usr/lib is a symlink to /usr/lib64 as mongodb overwrites /usr/lib when the proposed patch is applied.

[1] https://bugs.gentoo.org/show_bug.cgi?id=433507
[2] https://bugs.gentoo.org/show_bug.cgi?id=434664

Comment by Steven Hartland [ 06/Sep/12 ]

Had the same issue here on FreeBSD amd64 when building 2.2.0 release. The attached patch also fixed the issue for us.

Comment by Thomas Dziedzic [ 02/Sep/12 ]

Just encountered this with mongodb 2.2.0 on archlinux, the proposed patch does fix this specific error.

Although I have encountered another error due to the --sharedclient flag:

Install file: "build/linux2/normal/client_build/libmongoclient.a" as "libmongoclient.a"
Install file: "build/linux2/normal/mongo/stripped/mongofiles" as "/build/pkg/usr/bin/mongofiles"
Install file: "build/linux2/normal/mongo/stripped/mongoimport" as "/build/pkg/usr/bin/mongoimport"
scons: *** [/build/pkg/usr/lib/libmongoclient.so] Source `libmongoclient.so' not found, needed by target `/build/pkg/usr/lib/libmongoclient.so'.

Comment by Victor Guerra [ 13/Jul/12 ]

Actually this problem rises when trying to install using the '--full' flag and seems to be broken since March 7th ( d67ce1cd31f6ea2e766d5c201ab5430735cbb3b8 ).

As stated on the previous comments, installation of libmongoclient.a brakes. I am attaching a simple patch that makes the problem go away, simply by substituting the builder env.Install by env.InstallAs on src/SConstruc.client when dealing with the installation of the library file.

Comment by Marc Bastien [ 12/Apr/12 ]

On a related note, building mongo with the --full flag generates a similar error:

$ sudo scons --prefix=/opt/mongo --full install
...(complete output truncated for brevity)...
Install file: "build/darwin/normal/client_build/libmongoclient.a" as "libmongoclient.a"
Install file: "libmongoclient.a" as "/opt/mongo/lib/libmongoclient.a"
scons: *** [/opt/mongo/lib/libmongoclient.a] AssertionError : Installing source ['libmongoclient.a', 'build/darwin/normal/client_build/libmongoclient.a'] into target ['/opt/mongo/lib/libmongoclient.a']: target and source lists must have same length.
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.0.1/SCons/Action.py", line 1046, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/scons-2.0.1/SCons/Tool/install.py", line 79, in installFunc
    "Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target)))
AssertionError: Installing source ['libmongoclient.a', 'build/darwin/normal/client_build/libmongoclient.a'] into target ['/opt/mongo/lib/libmongoclient.a']: target and source lists must have same length.
scons: building terminated because of errors.

Generated at Thu Feb 08 03:09:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.