-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Cannot pass more than one -D option to idf.py (IDFGH-1275) #3570
Comments
I figured out I had some slightly incorrect syntax. As defined, it needs to be "-D Foo=bar BAZ=zed", but that results in a sub-list under the define_cache_entry list. Then, when adding the -T option you end up with a mixture of the sub-list plus a separate individual string. With the change below, the syntax changes to specifying individual -D options for each cache entry you want to add, but each one ends up as a top-level string in the define_cache_entry list, which is what is needed for the options to actually take effect as expected.
|
Additional recommended change... with -T having nargs=+, you can't put the "action" (i.e. build) immediately after -T (or -D, for that matter without the change in my previous comment), yet the usage output of idf.py implies you should put the action at the end, resulting in very cryptic errors (that I had to debug the python code in a debugger to figure out).
|
Hmmm... OK, scratch the previous idf_ext.py patch... that introduced a new problem (it needs to translate to a single -D TEST_COMPONENTS='...' For now, I just moved the "build" positional arg to the beginning of my argument list, but that isn't obvious (per my previous comment) |
Thanks. I also am struggling with how quote -D options that have spaces in them... e.g. if I want to pass multiple paths to EXTRA_COMPONENT_DIRS (i.e. -D EXTRA_COMPONENT_DIRS="/foo /bar"). I get a cmake error: "define_property command is not scriptable" |
Is a component in your |
Nope, only a few "set" calls, but just to be sure I moved register_component to the very top and am still getting the error. |
Ugh... user error... the call stack from the make error clued me in that I was specifying my project directory and not the components sub-directory for EXTRA_COMPONENTS_DIR. Sorry for the noise, but appreciate your help. |
Glad to see it work out @bpietsch. Regarding MR, this issue (and your other one) should be closed once those changes I mentioned are synced to this repo. |
Changes argument parsing mechanism from argparse to a new one, that provides better support for extensions and options that are only applicable to specific subcommands, Breaking changes: 1. All global options should go before subcommands, i.e. `idf.py build -C ~/some/project` will not work anymore, only `idf.py -C ~/some/project build` is acceptable 2. To provide multiple values to an option like `--define-cache-entry` it's necessary to repeat option many times, i.e. `idf.py -D entry1 entry2 entry3` will not work, right way is: `idf.py -D entry1 -D entry2 -D entry3` At the moment there are 3 options like this: `--define-cache-entry` in base list and `--test-components` and `--test-exclude-components` in the unit test extensions 3. Drops `defconfig` and `bootloader-clean` subcommands Closes espressif#3570 Closes espressif#3571
I want to declare multiple cache entries via the -D option to idf.py, but each successive one overwrites the previous when they are being parsed. Ironically, the -T option in unit-test-app maps to -D, but explicitly overrides the action behavior to append rather than overwrite. I think the -D action just needs to do the same.
The text was updated successfully, but these errors were encountered: