Skip to content

Moving a target into a subdir of its current location with same name as target yields stacktrace #4282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bdbaddog opened this issue Dec 19, 2022 · 2 comments · May be fixed by #4284
Open
Assignees
Labels

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Dec 19, 2022

Describe the bug
Here's a sample SConstruct which demonstrates the issue.

env=Environment()

if ARGUMENTS.get('dir', 0):
    env.Program('dir1/main/main','main.c')
else:
    env.Program('dir1/main','main.c')

If you run as

scons
# followed by
scons dir=1

Or the reverse

You'll get a stack trace.

Required information

  • Link to SCons Users thread discussing your issue.
  • Version of SCons
    Any
  • Version of Python
    Any
  • Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc)
    Any
  • How you installed SCons
    N/A
  • What Platform are you on? (Linux/Windows and which version)
    N/A
  • How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues.
    See description above
  • How you invoke scons (The command line you're using "scons --flags some_arguments")
    See description above
@bdbaddog bdbaddog added this to the NextRelease milestone Dec 19, 2022
@bdbaddog bdbaddog self-assigned this Dec 19, 2022
@bdbaddog
Copy link
Contributor Author

See https://github.com/bdbaddog/scons-bugswork/tree/main/4282 for a downloadable example

@bdbaddog
Copy link
Contributor Author

Sample Stacktrace:

TypeError: Directory /work/mongo/build/debug/mongo/tools/mongobridge found where file expected.:
  File "/work/mongo/SConstruct", line 5558:
    env.SConscript(
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/work/mongo/src/SConscript", line 37:
    env.SConscript('mongo/SConscript', exports=['env'])
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/work/mongo/src/mongo/SConscript", line 24:
    env.SConscript(
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/work/mongo/src/mongo/tools/SConscript", line 11:
    mongobridge = env.Program(
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py", line 255:
    return MethodWrapper.__call__(self, target, source, *args, **kw)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Builder.py", line 653:
    return self._execute(env, target, source, OverrideWarner(kw), ekw)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Builder.py", line 563:
    tlist, slist = self._create_nodes(env, target, source)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Builder.py", line 508:
    tlist = env.arg2nodes(target, target_factory, target=target, source=source)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py", line 478:
    v = node_factory(self.subst(v, **kw))
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py", line 1382:
    return self._lookup(name, directory, File, create)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py", line 1361:
    return root._lookup_abs(p, fsclass, create)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py", line 2398:
    result.diskcheck_match()
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py", line 2630:
    diskcheck_match(self, self.isdir,
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py", line 393:
    return self.func(*args, **kw)
  File "/work/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py", line 414:
    raise TypeError(errorfmt % node.get_abspath())

@mwichmann mwichmann modified the milestones: 4.5, NextRelease Mar 2, 2023
@bdbaddog bdbaddog modified the milestones: 4.6, 4.7 Nov 20, 2023
@mwichmann mwichmann modified the milestones: 4.7, 4.8 Mar 21, 2024
@mwichmann mwichmann modified the milestones: 4.8, NextRelease Jul 8, 2024
@mwichmann mwichmann modified the milestones: 4.8.1, NextRelease Sep 3, 2024
@mwichmann mwichmann removed this from the NextRelease milestone Sep 17, 2024
@mwichmann mwichmann added this to 4.9 Sep 17, 2024
@mwichmann mwichmann moved this to Backlog in Next Release Dec 16, 2024
@mwichmann mwichmann moved this from Backlog to Ready in Next Release Dec 16, 2024
@mwichmann mwichmann removed this from 4.9 Dec 16, 2024
@bdbaddog bdbaddog linked a pull request Apr 6, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

2 participants