Jason R. Coombs
Jason R. Coombs
After fixing #231 and rebasing onto those changes, I'm now able to elicit the intrinsic error by invoking the test selectively: ``` distutils feature/cpp-support @ tox -qq -- -q -p...
The issue seems to be that `self.linker_so_cxx` is not set ~~on macOS~~ [here](https://github.com/pypa/distutils/pull/228/files#diff-6ed3ec12221684cf8ef45abffe2d8fd7042ac8f936f68f434d885c68cc096ba5R266). ``` > /Users/jaraco/code/pypa/distutils/distutils/unixccompiler.py(56)_split_env() -> if os.path.basename(cmd[0]) == "env": (Pdb) u > /Users/jaraco/code/pypa/distutils/distutils/unixccompiler.py(271)link() -> env, linker_ne = _split_env(linker)...
@sciyoshi Since the issue is in the proposed diff, can you investigate?
> The issue seems to be that `self.linker_so_cxx` is not set ~on macOS~ [here](https://github.com/pypa/distutils/pull/228/files#diff-6ed3ec12221684cf8ef45abffe2d8fd7042ac8f936f68f434d885c68cc096ba5R266). It looks like in `test_cc_overrides_ldshared_for_cxx_correctly`, when [sysconfig.customize_compiler is called](https://github.com/pypa/distutils/pull/228/files#diff-5b14d375bfc18988ec8256ae25616ad57561f507ee3ae79b2818faa342cf5207R285), it causes `self.cc.linker_so_cxx` to become `[]` so...
I do see an asymmetry in these lines: https://github.com/pypa/distutils/blob/95088c5886327cca5c01426cc9ea0d1063677f26/distutils/sysconfig.py#L301-L322 There, I see `ldshared` is initialized using `get_config_vars('LDSHARED')`, but `ldcxxshared` is initialized to `""`. Why the discrepancy?
It looks like making the behavior symmetrical allows the tests to pass: ```diff diff --git a/distutils/sysconfig.py b/distutils/sysconfig.py index 31bdbec1b..847a26ba4 100644 --- a/distutils/sysconfig.py +++ b/distutils/sysconfig.py @@ -304,6 +304,7 @@ def customize_compiler(compiler):...
> Actually, I think the new error in `test_customize_compiler` is what I was attempting to fix by setting it to `""`. In PyPy only, it seems. Seems to be that...
My first instinct was to replace `None` with `''` for ldcxxshared, but that also seems improper, as it still invokes `compiler.set_executables(ldcxxshared=)` for either the empty string or just the parameters...
In fcef963, I found a satisfactory workaround - don't attempt to add flags if the value is None. It first required a refactor in 3e4b457. With this change, `Compiler.set_executable(linker_so_cxx=None)` will...
The only remaining failure is in diffcov, which is ignorable, since there's no coverage aggregation.