-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
optionally pass env to AddBuildMiddleware callback #4380
Conversation
Thanks for the PR! Could you try |
Ahh, sorry, it should be If it works, we will update our docs. Sorry. |
uhmm, no, with def rewrite_source(node):
localenv = node.get_env()
return localenv.Object(node) i still end up missing a bunch of arguments:
which is curios.....with the nodes created just a couple lines prior you would think that should work. |
Should it be the same env? Could you print it? Please use your PR.
|
yeah, ok, just ran it with the debugger, regrettably scons is just throwing the default env back at us. |
I don't know if this is a bug or a feature. I've just asked core developers, see SCons/scons#4211 Meanwhile, if we plan to merge this PR to the PlatformIO Core, I would recommend following SCons architecture and passing the |
huh, it appears
what do mean by that? |
Do you mean this SCons/scons#4211 is not a bug and I can close it? |
Ok, I've just re-tested and reproduced this behavior in the SCons, see updated issue SCons/scons#4211 |
sure, fixed.
no that observation was between the env imported in the pre script and the one passed as a parameter. to be perfectly honest, i find scons architecture a little confusing, but i have yet to encounter a build tool that isn't confusing to a degree :D |
The project with over 20+years... Let's see how PlatformIO Core will look in the next 20+ years :) |
Both projects are doing great work, that's for sure. |
…allback” function when using Build Middlewares // Resolve #4380
Thanks for the PR! Merged and updated docs! https://docs.platformio.org/en/latest/scripting/middlewares.html |
It appears
env
is not yet fully when the pre-script is ran (env vs projenv?), however when Build Middlewares are employed as described, this incomplete environment is used to construct the env.Object entries, leading to missing compiler arguments.Similar problems are mentioned here
This PR optionally, as to not break compatibility, passes the current environment to the callback, in-line with how its handled with Pre & Post action callbacks
To reproduce the issue:
leads to:
Whereas:
leads to
Take note of
-DTARGET
and the include dirs forcbor
andlibusb_stm32