puma: ctype.h missing from puma_http11.c
Describe the bug
#include <ctype.h>
needs to be added to ext/puma_http11/puma_http11.c
. Without this include compilation of Puma will fail due to error:
include the header <ctype.h> or explicitly provide a declaration for 'isspace'
1 error generated.
This seems to be fixed on 5.0.0.beta1 although it won’t help since beta doesn’t behave nicely and cannot be used in production.
To Reproduce Just try to compile puma.
Expected behavior Succesfully compiled Puma would be expected behaviour 😃
Desktop (please complete the following information): MacOS 15.5.5 and MacOS Big Sur Puma version 4.3.5
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 23
- Comments: 25 (6 by maintainers)
Links to this issue
Commits related to this issue
- Use Puma >=5.0.0.beta to workaround issue with Xcode 12 See https://github.com/puma/puma/issues/2304 — committed to Old-Growth/timber-cruise-ruby-getting-started by mattt 4 years ago
- [727] Upgrade puma to resolve compilation error Addresses: [737](https://github.com/GratefulGarmentProject/StockAid/issues/737) According to [Issue #2304](https://github.com/puma/puma/issues/2304) a... — committed to GratefulGarmentProject/StockAid by tamouse 4 years ago
- Update puma gem to fix failing installation on MacOS related to issue https://github.com/puma/puma/issues/2304 — committed to digITpro/catima by skyporter 4 years ago
- Update puma gem to fix failing installation on MacOS (#289) related to issue https://github.com/puma/puma/issues/2304 — committed to catima/catima by skyporter 4 years ago
- Update puma to 4.3.6 (#1533) There was a bug on Puma version 4.3.5, causing it to fail when trying to compile. It was fixed with [#2304]. This commit updates Gemfile.lock and removes the now redu... — committed to simpledotorg/simple-server by ogirginc 4 years ago
- Update Puma to 4.3.7 There's [a bug in Puma 4.3.5](https://github.com/puma/puma/issues/2304) which prevents some compilers from building the native extensions required for Puma. I was running into t... — committed to department-of-veterans-affairs/vets-api by ericboehs 4 years ago
- Update Puma to 4.3.7 (#5422) There's [a bug in Puma 4.3.5](https://github.com/puma/puma/issues/2304) which prevents some compilers from building the native extensions required for Puma. I was ru... — committed to department-of-veterans-affairs/vets-api by ericboehs 4 years ago
- Make puma install on Big Sur / rb 2.7 https://github.com/puma/puma/issues/2304 — committed to caius/zshrc by caius 4 years ago
- Update Puma to fix a compilation error https://github.com/puma/puma/issues/2304 — committed to hotline-webring/hotline-webring by gabebw 3 years ago
- Prevent puma build error :cat2: Refs. - https://github.com/puma/puma/issues/2342 - https://github.com/puma/puma/issues/2304 — committed to machupicchubeta/dotfiles by machupicchubeta 3 years ago
- Update puma Older versions of puma don't work on newer versions of OSX https://github.com/puma/puma/issues/2304 I had to bump this gem to get `bundle install` to work — committed to zendesk/samson by russell 3 years ago
- Update puma (#3918) * Update puma Older versions of puma don't work on newer versions of OSX https://github.com/puma/puma/issues/2304 I had to bump this gem to get `bundle install` to work ... — committed to zendesk/samson by russell 3 years ago
- require puma > 4.3.5 https://github.com/puma/puma/issues/2304 — committed to dunn/mastodon-twitter-poster by dunn 3 years ago
Until fixed by ctype and/or Apple default parameters, it’s workaround by setting the
-Wno-error
flag for gcc in puma’s bundler config.Or just install 4.3.5 with the flags:
I’m also seeing the same issue in macOS 10.15.6 in a new rails app when trying to install puma 4.3.5 I can install puma v 4.2 without any issues but I had to use @frederikspang’s suggestion above (
gem install puma:4.3.5 -- --with-cflags="-Wno-error=implicit-function-declaration"
) to install v 4.3.5 successfully.Fixed on master and 4.3.6.
For latest version of OSX:
Or just upgrade gem to
Would it be bad to include
ctype.h
anyway? And also important to note: I can reproduce this with MacOS 15.5.5 which is Catalina, not Big Sur.For puma 6, this helped:
Seeing this is reported for the new macOS version, Big Sur, it is probably related to something that changed in macOS.
I found a few similar issues when I started searching:
The paragraph that these issues all quote…
…is listed under a headline “Known Issues” at https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes, so it might even get fixed, making it work to compile Puma 4.3.5 in Big Sur.
I think this issue can be closed without action. If it persist when Big Sur is out of beta, maybe we can reconsider.
I don’t think it’s the linker cache. Clang now enables
-Werror=implicit-function-declaration
by default:Apple could back out of this particular change, but even if they do, it’s probably a good idea not to rely on the implicit function declaration anyway.
Went to open a PR and realized this is already fixed in
master
becauseisspace
is no longer used.v4.3.4
master
There doesn’t seem to be a stable branch for the 4.3.x line so I’m not sure if master is targeting 4.x or 5.0.
Now the
implicit-function-declaration
is breaking things, when you install puma with the correctgem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include
and then try to install it with bundle install it will fail because you might have added theimplicit-function-declaration
to bundle which would have added it here: ~/.bundle/config if you remove the following line and re run bundle install puma will compile correctlyIf you have openssl 3 installed with brew just install puma with the path like this:
@frederikspang’s solution is working well with my issue, thank you so much.