Command with empty action turns a normal file target into a directory

Lem Ming <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAOQj6-DOXAH_oeV4mOBTPfKjQU_Tjv+hM+_P29gmEO=YuWB=XQ@mail.gmail.com>
I am new to scons. I am trying to create custom actions that deal with
targets and sources. I created an empty function to use as an action in a
Command object. When the Command is executed, it is supposed to change
nothing (to my understanding), but it changes one of the targets into a
directory.

Here is how to recreate the situation:
- Create the following files:
Makefile:
```
exec:
touch target.txt
mkdir target2
touch source.txt
mkdir source2
scons
rm .sconsign.dblite
scons

clean:
rm -r target.txt target2 source.txt source2 .sconsign.dblite
```

SConstruct:
```
#!/usr/bin/env python3

def some_action(target, source, env):
    pass

Command(['target.txt', 'target2'], ['source.txt', 'source2'], some_action)
```
- Execute `make exec`

What I expected:
```
target.txt # type: normal file
target2    # type: directory
source.txt # type: normal file
source2    # type: directory
```

What happened:
```
target.txt # type: directory
target2    # type: directory
source.txt # type: normal file
source2    # type: directory
```

Some info about my setup:
- os: Fedora 33
- scons version: 4.0.1

Question:
- What is causing this behavior?

--
Lem

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.