[Scons-users] repositories, link error on c++ (g++) objects
Dan McNaul
danmcnaul at gmail.com
Tue Mar 17 08:45:08 EDT 2015
William,
The VPATH environment variable gets set by the bash script b.nmk. The SConstruct pulls the VPATH value out of the environment and then plugs it into the Repository() call. The base (or the root) of the repository is the “official” directory. The “work” or “home” directory is “home1”. Take a look at scon_bug/official/g1r1/bld.out. This file is the output of building the “official” tree. The contents of VPATH are echo’d for you to see. Then take a look at scon_bug/home1/g1r1/bld.out. This is a build of a work or home tree. You can see that the Repository will look through home1 for its files and then official. This, of course, matches the documentation you provided in your link. Since home1 is empty, scons will get everything from official. You can compare the VPATH echo in the separate bld.out’s to see how it works. If you still question what is in Repository, you can modify the SConstruct to dump out Repository.
The bug I’m reporting is the build in home1. I think the expected result is for scons to report that “MyMain is up to date”. It didn’t. Scons tried to link MyMain (a c++) program with a c linker (gcc) using MyMain.o. As you can see in the home1/g1r1/bld.out, this resulted in a bunch of link errors. In the “official” build, scons worked correctly. It identified MyMain.cc as a c++ program and built the program with g++.
If you want to play with the test suite and/or Repositories, the README file tells you how to build the sample.
Dan
From: William Blevins
Sent: Tuesday, March 17, 2015 1:07 AM
To: SCons users mailing list
Subject: Re: [Scons-users] repositories, link error on c++ (g++) objects
Also, your questions can likely be answered by reading the appropriate User Guide section: http://www.scons.org/doc/production/HTML/scons-user.html#idp14845376
V/R,
William
On Tue, Mar 17, 2015 at 1:04 AM, William Blevins <wblevins001 at gmail.com> wrote:
Dan,
I have never used the repository functionality of SCons, but I can try to work through it with you.
I briefly looked at the attachment contents of issue #2999, and I'm not sure that I understand your use case. I cannot validate what options are given to repository in context to the example since "VPATH" is not defined.
V/R,
William
On Mon, Mar 16, 2015 at 2:24 PM, Dan McNaul <danmcnaul at gmail.com> wrote:
I apologize. I didn’t follow the procedures. I already created issue #2999 for this. I consider this a bug, maybe you don't. The issue has been around since I've
been using scons. The tests were run using scons_2.3.4.
When using repositories, scons builds the "official" repository root correctly.
Scons notices the ".cc" extension and uses g++ to do the build.
When doing the build in a "home" directory that searches the repository
("official"), scons picks up the ".o", but incorrectly chooses to link
it using gcc. This results in a long list of linking errors.
I have attached a test suite that recreates this problem. The tar file has a
README.
_______________________________________________
Scons-users mailing list
Scons-users at scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users
--------------------------------------------------------------------------------
_______________________________________________
Scons-users mailing list
Scons-users at scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150317/903e1738/attachment.html>
More information about the Scons-users
mailing list