Opened 2 years ago

Closed 16 months ago

#6974 defect closed worksforme (worksforme)

"pip install twisted" fails with in XCode 5.1

Reported by: AlexeyMK Owned by:
Priority: normal Milestone:
Component: core Keywords: pip clang compiler
Cc: wsanchez Branch:
Author: AlexeyMK

Description

Using: XCode 5.1 Beta 5 clang 5.1

echo "int main() { exit(0); }" > test.c

cc -mno-fused-add test.c

/tmp » cc -mno-fused-madd test.c

clang: error: unknown argument: '-mno-fused-madd'

(clang 5.0 gives a warning, which is why the current version works).

We think this might be because clang-gcc is no longer supported in llvm 5.0, and -mno-fused-madd could be a GCC argument.

Either way, twisted should update the compiler flags for building before XCode 5.1 comes out (est. a few months).

PS. FWIW, figuring out how to submit a bug report to twisted was a lot harder than I expected, as a first-time contributor but reasonable developer. For example, not sure who to assign to and reading https://twistedmatrix.com/trac/wiki/UltimateQualityDevelopmentSystem didn't help (and was not obvious to find).

Change History (14)

comment:1 Changed 2 years ago by Alex

This flag isn't added by Twisted, it's added by Python; I believe because that flag was included when Python itself was compiled.

comment:2 Changed 2 years ago by exarkun

  • Author AlexeyMK deleted
  • Keywords changed from pip, clang, compiler to pip clang compiler
  • Resolution set to wontfix
  • Status changed from new to closed

Please try again using CPython compiled using the same compiler. If there is still an issue, feel free to re-open this ticket and we can try to figure out whether this should be fixed in Twisted or upstream in CPython.

comment:3 Changed 2 years ago by glyph

  • Cc wsanchez added
  • Resolution wontfix deleted
  • Status changed from closed to reopened

I think that the problem here is that Apple's build of Python was built with this option and therefore you can't build extensions for the system Python.

I don't think this is really our bug, per se, and we probably shouldn't have to do anything to fix it, but if this isn't fixed before the new Xcode is released we will need to try and figure out if we can come up with a workaround, so I'm going to reopen. I'd be surprised if this doesn't get fixed since if I understand the bug properly it will cause all C extensions to fail to build, but maybe Twisted's setup.py does something especially stupid.

comment:4 Changed 2 years ago by Alex

As far as I can tell Apple for real broke this on. Today I upgraded the Xcode CLI tools and now pip install --no-use-wheel twisted (I have a local wheel cache) totally results in clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

comment:5 Changed 2 years ago by glyph

So... still waiting for Xcode itself to finish upgrading, but I just upgraded the command-line tools and I can still build extension modules.

Do you have anything in your CFLAGS, Alex? -Weverything -Werror or something like that, maybe?

comment:6 Changed 2 years ago by glyph

Aah, nevermind. Xcode upgrade finished for real and it's totally busted here, too.

comment:7 Changed 2 years ago by glyph

For now, CFLAGS=-Wunused-command-line-argument-hard-error-in-future pip install --no-use-wheel twisted will work as a workaround, but the name of that option suggests to me that it's temporary.

Does this happen with a brewed Python as well?

comment:8 Changed 2 years ago by AlexeyMK

  • Author set to AlexeyMK

Glad to see this is getting some action. Going to use the CFLAGS argument for now - hopefully that's a start.

Also see: https://langui.sh/2014/03/10/wunused-command-line-argument-hard-error-in-future-is-a-harsh-mistress/index.html

comment:9 Changed 2 years ago by AlexeyMK

FYI: I've verified that the CFLAG solution works for XCode 5.1 (for now) from my end.

comment:10 follow-up: Changed 2 years ago by glyph

Okay, this is extra weird.

I don't need to set my CFLAGS to -Wunused-command-line-argument-hard-error-in-future. I just did this:

    export CFLAGS="";

and now the build works; the -mno-fused-madd argument just disappears from distutils' command-line list when there is any value in CFLAGS. So for my own personal workaround that's what I'm going with in the future.

comment:11 in reply to: ↑ 10 Changed 2 years ago by airtower

Replying to glyph:

Okay, this is extra weird.

I don't need to set my CFLAGS to -Wunused-command-line-argument-hard-error-in-future. I just did this:

    export CFLAGS="";

and now the build works; the -mno-fused-madd argument just disappears from distutils' command-line list when there is any value in CFLAGS. So for my own personal workaround that's what I'm going with in the future.

Can you tell me how and where you change this setting? I upgraded to Xcode 5.1 and I can't compile any of my apps and this thread seems to be the only place that has an answer. How did you change the CFLAGS ???

comment:12 Changed 2 years ago by wsanchez

airtower: It's an environment variable.

glyph: setting ARCHFLAGS apparently works and is less likely to interfere with the more commonly tweaked CFLAGS, so I recommend this as a workaround:

export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future";

comment:13 Changed 2 years ago by glyph

  • Summary changed from "pip install twisted" fails with in XCode 5.1 (currently in beta) to "pip install twisted" fails with in XCode 5.1

comment:14 Changed 16 months ago by wsanchez

  • Resolution set to worksforme
  • Status changed from reopened to closed

Xcode has since been fixed, so I think we can close this out.

Note: See TracTickets for help on using tickets.