diff options
author | fergus.henderson <fergushenderson@users.noreply.github.com> | 2008-07-29 22:19:10 +0000 |
---|---|---|
committer | fergus.henderson <fergushenderson@users.noreply.github.com> | 2008-07-29 22:19:10 +0000 |
commit | 03163a50882914f4c4fe85d45490baccb9605357 (patch) | |
tree | 21b8fe5481bd10e4b08af16443e07dabbdc04fef /include_server/macro_eval_test.py | |
parent | a59ffb549e7e423e48b46726de6563c96646e6b2 (diff) | |
download | distcc-git-03163a50882914f4c4fe85d45490baccb9605357.tar.gz |
This is based on klarlund's original version of this patch (klarlund/d3b3):
gvn --project https://distcc.googlecode.com/svn/trunk review klarlund/d3b3
Fix Issue 7: Compiling with -I/usr/include/FOO or ... in pump mode
Problem:
Default system include directories are the directories on the default include
search path, such as /usr/include, that is determined by the compiler. Distcc
will not send default system include directories to the distcc compilation
servers. Nevertheless, distcc on the server blindly rewrites -I options such
as -I/usr/include/foo to -I/tmp/distccNNN/usr/include/foo.
This doesn't work, since the files in /usr/include/foo are not sent to the
distccd server.
Solution:
The present solution keeps the rewriting on the server, because we would like
to not manage starting the compiler, parsing its output, and storing the
default system paths on the server
Instead, we use the existing mechanism for defining relative symbolic links
under the server root. We escape from the root by using a sufficient number
of '../'s.
All this is tremendously complicated by:
-- The possibility that other links encountered may point into the system
default dirs in which case the usual mirroring of the reachable places
should not take place, because the routing of such links will go through
the link created for the system directory.
-- The fact that determination of default-system-dirness is lazy: a
deeply-seated link in a default system dir may become obsolete if it is
later determined that a higher directory than the parent directory of the
link is in fact also a default system dir. In that case, a new symlink,
sitting in a place higher than the previous one will need to be created.
Tests:
make check
benchmarks: samba (still 3X faster than with distcc), linux 2.6 kernel, and
a couple of others
TODO: better testing
TODO:
> In compiler_defaults.py, _MakeLinkFromMirrorToRealLocation:
> Maybe comment each of the 'if' cases with an example of how this case
> might be triggered. eg the real_prefix == rooted_system_dir is
> triggered when we see /usr/include/foo, and the later see
> /usr/include.
Diffstat (limited to 'include_server/macro_eval_test.py')
-rwxr-xr-x | include_server/macro_eval_test.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include_server/macro_eval_test.py b/include_server/macro_eval_test.py index fd4bb1a..292cf35 100755 --- a/include_server/macro_eval_test.py +++ b/include_server/macro_eval_test.py @@ -26,6 +26,8 @@ import basics import parse_file import cache_basics import macro_eval +import shutil +import tempfile import unittest NotCoveredError = basics.NotCoveredError @@ -36,7 +38,8 @@ class MacroEvalTest(unittest.TestCase): basics.opt_debug_pattern = 1 - caches = cache_basics.SetUpCaches() + self.tmp = tempfile.mkdtemp() + caches = cache_basics.SetUpCaches(self.tmp) self.includepath_map = caches.includepath_map self.canonical_path = caches.canonical_path @@ -45,7 +48,7 @@ class MacroEvalTest(unittest.TestCase): def tearDown(self): - pass + shutil.rmtree(self.tmp) def test__SubstituteSymbolInString(self): @@ -194,7 +197,7 @@ class MacroEvalTest(unittest.TestCase): def test_ResolveExpr(self): # Erect the edifice of caches. - caches = cache_basics.SetUpCaches() + caches = cache_basics.SetUpCaches(self.tmp) parse_file_obj = parse_file.ParseFile(caches.includepath_map) symbol_table = {} |