Skip to content
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

Incorrect diagnostics output when calling a Python function as custom action #4573

Closed
aheyer opened this issue Mar 17, 2023 · 1 comment
Closed

Comments

@aheyer
Copy link

aheyer commented Mar 17, 2023

Configuration

Operating system: Windows 10 x64

PlatformIO Version (platformio --version): 3.1.1 (VS Code extension)

Description of problem

There is incorrect diagnostic output during the build process if a custom action is invoked via a custom Python script. This output can lead to false assumptions of the creator of the custom script because claimed action and in reality performed action do not match. In my case I copied the wrong file in my custom action because the diagnostic output showed the wrong order of parameters albeit strictly sticking to the docs I could succeeded from the beginning.

Steps to Reproduce

  1. Add a custom Python script to the project's platformio.ini with extra_scripts = post:myscript.py under an environment section
  2. Create an action function action_func with signature action_func(source, target, env) in the Python file myscript.py
  3. Register this function as action for a target, e.g. env.AddPostAction("generated_file_to_watch", action_func)
  4. Build the project
  5. Watch for an output line saying action_func(["generated_file_to_watch"], ["source_file"]). The list of source files (parameter source) depends on your choice of the generated file to watch (parameter target).

Actual Results

Output line of action_func(["generated_file_to_watch"], ["source_file"])

Expected Results

Output line of action_func(["source_file"], ["generated_file_to_watch"])
Because this is the order the signature of action_func demands according to your advanced scripting documentation. And in fact it's the order the function is called.

@ivankravets
Copy link
Member

This is the internals of SCons. Please file a feature request to https://github.com/SCons/scons/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants