[Scons-users] Command with empty action turns a normal file target into a directory

Lem Ming ramboman777 at gmail.com
Wed Jun 23 19:16:22 EDT 2021


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20210623/09caa557/attachment-0001.htm>


More information about the Scons-users mailing list