conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.2k stars 979 forks source link

[bug] GnuToolchain's make_args does not handle empty values correctly #17171

Open valgur opened 1 hour ago

valgur commented 1 hour ago

Describe the bug

Conan: 2.8.0

When using the GnuToolchain generator in the following manner

tc = GnuToolchain(self)
tc.make_args["PREFIX"] = ""
...
tc.generate()

where an empty string is passed as a value, the resulting make command fails with:

libbpf/1.4.6: RUN: make PREFIX -j16
make: *** No rule to make target 'PREFIX'.  Stop.

Expected:

libbpf/1.4.6: RUN: make PREFIX= -j16
...

The make_args and configure_args properties should always map "" and any other falsy values besides None to a <key>= command-line argument.

Also, the make_args should probably never create arguments without a = symbol altogether. Any --xyz flags to make seem better suited to the args keyword in autotools.make(args=[...]).

How to reproduce it

No response

valgur commented 1 hour ago

/cc @franramirez688