Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Update documentation for linking-related construction variables.
Add a few more live links.

From Will Toohey:
- Fix compile_commands.json having incorrect include paths for clean builds
when a variant dir is used, duplicate=0, and a relative CPPPATH is used in
a child SConscript.

RELEASE 4.10.1 - Sun, 16 Nov 2025 10:51:57 -0700

Expand Down
3 changes: 3 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ FIXES
directory for each writer before doing the move, instead of depending
on a one-time uuid to make a path to the file.

- Fix compile_commands.json having incorrect include paths for clean builds when a
variant dir is used, duplicate=0, and a relative CPPPATH is used in a child SConscript.

IMPROVEMENTS
------------

Expand Down
1 change: 0 additions & 1 deletion SCons/Node/FS.py
Original file line number Diff line number Diff line change
Expand Up @@ -3305,7 +3305,6 @@ def built(self) -> None:
self._specific_sources = False
self._labspath = ""
self._save_str()
self.cwd = None

self.scanner_paths = None

Expand Down
2 changes: 2 additions & 0 deletions test/CompilationDatabase/fixture/SConstruct_variant
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ env.Program('build2/main', 'build2/test_main.c')
env.VariantDir('build3','src', duplicate=0)
env.InstallAs('build3/test_main_copy.c', 'src/test_main.c')
env.Program('build3/main', 'build3/test_main_copy.c')

SConscript('src/SConscript_cpppath', variant_dir='build4', duplicate=0, exports={'env': env})
2 changes: 2 additions & 0 deletions test/CompilationDatabase/fixture/src_SConscript_cpppath
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Import('env')
env.Object('test_main.c', CPPPATH=['inc'])
24 changes: 22 additions & 2 deletions test/CompilationDatabase/variant_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

test.verbose_set(1)
test.file_fixture('fixture/SConstruct_variant', 'SConstruct')
test.file_fixture('fixture/src_SConscript_cpppath', 'src/SConscript_cpppath')
test.file_fixture('test_main.c', 'src/test_main.c')
test.run()

Expand Down Expand Up @@ -84,6 +85,12 @@
"directory": "%(workdir)s",
"file": "%(variant3_src_file)s",
"output": "%(output3_file)s"
},
{
"command": "%(exe)s mygcc.py cc -o %(output4_file)s -c -I%(inc_build4)s -I%(inc_src)s %(src_file)s",
"directory": "%(workdir)s",
"file": "%(src_file)s",
"output": "%(output4_file)s"
}
]
""" % {'exe': sys.executable,
Expand All @@ -92,8 +99,11 @@
'output_file': os.path.join('build', 'test_main.o'),
'output2_file': os.path.join('build2', 'test_main.o'),
'output3_file': os.path.join('build3', 'test_main_copy.o'),
'output4_file': os.path.join('build4', 'test_main.o'),
'variant_src_file': os.path.join('build', 'test_main.c'),
'variant3_src_file': os.path.join('build3', 'test_main_copy.c')
'variant3_src_file': os.path.join('build3', 'test_main_copy.c'),
'inc_build4': os.path.join('build4', 'inc'),
'inc_src': os.path.join('src', 'inc'),
}

if sys.platform == 'win32':
Expand Down Expand Up @@ -122,6 +132,12 @@
"directory": "%(workdir)s",
"file": "%(abs_variant3_src_file)s",
"output": "%(abs_output3_file)s"
},
{
"command": "%(exe)s mygcc.py cc -o %(output4_file)s -c -I%(inc_build4)s -I%(inc_src)s %(src_file)s",
"directory": "%(workdir)s",
"file": "%(abs_src_file)s",
"output": "%(abs_output4_file)s"
}
]
""" % {'exe': sys.executable,
Expand All @@ -131,12 +147,16 @@
'abs_output_file': os.path.join(test.workdir, 'build', 'test_main.o'),
'abs_output2_file': os.path.join(test.workdir, 'build2', 'test_main.o'),
'abs_output3_file': os.path.join(test.workdir, 'build3', 'test_main_copy.o'),
'abs_output4_file': os.path.join(test.workdir, 'build4', 'test_main.o'),
'output_file': os.path.join('build', 'test_main.o'),
'output2_file': os.path.join('build2', 'test_main.o'),
'output3_file': os.path.join('build3', 'test_main_copy.o'),
'output4_file': os.path.join('build4', 'test_main.o'),
'abs_variant3_src_file': os.path.join(test.workdir, 'build3', 'test_main_copy.c'),
'variant_src_file': os.path.join('build', 'test_main.c'),
'variant3_src_file': os.path.join('build3', 'test_main_copy.c')
'variant3_src_file': os.path.join('build3', 'test_main_copy.c'),
'inc_build4': os.path.join('build4', 'inc'),
'inc_src': os.path.join('src', 'inc'),
}

if sys.platform == 'win32':
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/mygcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def fake_gcc():
sys.exit(0)

compiler = sys.argv[1].encode('utf-8')
opts, args = getopt.getopt(sys.argv[2:], 'co:xf:K:')
opts, args = getopt.getopt(sys.argv[2:], 'co:xf:K:I:')
for opt, arg in opts:
if opt == '-o':
out = arg
Expand Down