Skip to content
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

Disable -Werror for http parser. #1065

Closed
ocktech opened this issue Feb 6, 2018 · 15 comments
Closed

Disable -Werror for http parser. #1065

ocktech opened this issue Feb 6, 2018 · 15 comments
Assignees
Labels
Enhancement Improvement or enhancement. TransByAI Translated by AI/GPT.
Milestone

Comments

@ocktech
Copy link

ocktech commented Feb 6, 2018

I am getting this error when installing on ubuntu 17.10.

build http-parser-2.1
patching file Makefile
cc -I. -DHTTP_PARSER_STRICT=1 -Wall -Wextra -Werror -O0 -g -c http_parser.c
http_parser.c: In function ‘http_parser_parse_url’:'

This line is already in English and does not require translation.
http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
found_at = 1;
~~~~~~~~~^~~
http_parser.c:2096:7: note: here
case s_req_server:
^~~~
cc1: all warnings being treated as errors
Makefile:40: recipe for target 'http_parser.o' failed
make: *** [http_parser.o] Error 1
build http-parser-2.1 failed, ret=2

TRANS_BY_GPT3

@Daniate
Copy link

Daniate commented Mar 28, 2018

You should change the source code:

the file http_parser.c in 3rdparty/http-parser-2.1.zip

change

case s_req_server_with_at:
        found_at = 1;

      /* FALLTHROUGH */

to

case s_req_server_with_at:
        found_at = 1;

      /* fall through */

@winlinvip
Copy link
Member

Dup for #1159.

@jgbaldwin3
Copy link

jgbaldwin3 commented Aug 1, 2018

I had the configure failed when compile on Ubuntu Studio 18.04, with line # 2095 of "http-parser-2.1/http_parser.c" where the comment was FALLTROUGH and not FALLTHROUGH, note the first "H" is missing.

For the user that may not know how to update the source in the zip file, the following commands show how I did it and verified it working:

cd ~ && git clone https://github.com/ossrs/srs && cd srs/trunk
./configure && make

===> configure FAILS -- update http-parser source zip file

mkdir temp
cd temp
unzip ../http-parser-2.1.zip
grep -n "FALLT" ./http-parser-2.1/http_parser.c
sed -e s/FALLTROUGH/FALLTHROUGH/ -i ./http-parser-2.1/http_parser.c
grep -n "FALLT" ./http-parser-2.1/http_parser.c
mv ../http-parser-2.1.zip ../http-parser-2.1-orig.zip
zip ../http-parser-2.1.zip http-parser-2.1/*

===> back to srs/trunk folder to configure and make

cd ../..
./configure && make

===> test

./objs/srs -c conf/srs.conf
tail -f ./objs/srs.log
ps -aF

@huanghe2015
Copy link

huanghe2015 commented Aug 17, 2018

With the help of the original poster, I will also share my setup situation (Ubuntu 18.04):

deploy@ubuntu:~/SRS/srs-2.0-r4/trunk$ ./configure --full && make
regenerate config: --prefix=/usr/local/srs --with-hls --with-hds --with-dvr --with-nginx --with-ssl --with-ffmpeg --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --with-stream-caster --with-http-api --with-librtmp --with-research --with-utest --without-gperf --without-gmc --without-gmp --without-gcp --without-gprof --without-arm-ubuntu12 --without-mips-ubuntu12 --log-trace
check gcc/g++/gdb/make
depends tools are ok
Ubuntu detected, install tools if needed
install libtool
Reading package lists... Done
Analyzing dependency tree for packages
Reading status information... Done
libtool is already the newest version (2.4.6-2).
0 upgraded, 0 newly installed, 0 to remove, and 0 not upgraded.
W: --force-yes is deprecated, use options starting with --allow instead.
install libtool success
Ubuntu install tools success
SED is sed_utility
st-1.9t is ok.
build http-parser-2.1
patching file Makefile
cc -I. -DHTTP_PARSER_STRICT=1  -Wall -Wextra -Werror -O0 -g  -c http_parser.c
**http_parser.c:** In function '**http_parser_parse_url**':
http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
         found_at = 1;
         ~~~~~~~~~^~~
http_parser.c:2096:7: note: here
       case s_req_server:
       ^~~~
cc1: all warnings being treated as errors
Makefile:40: recipe for target 'http_parser.o' failed
make: *** [http_parser.o] Error 1
build http-parser-2.1 failed, ret=2
deploy@ubuntu:~/SRS/srs-2.0-r4/trunk$ 

TRANS_BY_GPT3

@winlinvip winlinvip changed the title Parse error when installing Disable -Werror for http parser. Aug 18, 2018
@winlinvip winlinvip changed the title Disable -Werror for http parser. Disable -Werror for http parser. Aug 18, 2018
@winlinvip winlinvip added the Enhancement Improvement or enhancement. label Aug 18, 2018
@winlinvip winlinvip added this to the srs 3.0 release milestone Aug 18, 2018
@winlinvip
Copy link
Member

We don't need the -Werror to compile the http parser.

@winlinvip winlinvip reopened this Aug 18, 2018
@winlinvip
Copy link
Member

winlinvip commented Aug 19, 2018

SRS3 has no problem. We don't plan to solve the compilation issue in SRS2, so everyone needs to handle it themselves.

TRANS_BY_GPT3

@huanghe2015
Copy link

huanghe2015 commented Aug 19, 2018

Then remember to release the new version as soon as possible! @winlinvip

TRANS_BY_GPT3

@fannigurt
Copy link

fannigurt commented Dec 4, 2018

SRS3没有问题。SRS2不打算解决编译问题了,需要大家自己处理下。

Translation:

There is no problem with SRS3. SRS2 does not intend to solve the compilation problem, you need to handle it yourself.
So don't forget to
git checkout 3.0release after the cloning repo

TRANS_BY_GPT3

@winlinvip
Copy link
Member

Fixed by a554dd8 in 2.0.263

@huanghe2015
Copy link

huanghe2015 commented Apr 9, 2019

Looks like many similiar errors:
There are too many similarities:

src/core/ngx_murmurhash.c: In function 'ngx_murmur_hash2':
src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[2] << 16;
         ~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
     case 2:
     ^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
         h ^= data[1] << 8;
         ~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
     case 1:
     ^~~~
cc1: all warnings being treated as errors
objs/Makefile:429: recipe for target 'objs/src/core/ngx_murmurhash.o' failed

TRANS_BY_GPT3

@xuie0000
Copy link

xuie0000 commented Apr 26, 2019

SRS3 has no problem. We don't plan to solve the compilation issue for SRS2, so everyone needs to handle it themselves.

I switched to compiling 3.0 release, but I still encounter an nginx error (this error is caused by the -Werror flag added to the nginx configuration on Ubuntu 18.04) ... I used ./configure --with-nginx && make.

TRANS_BY_GPT3

@xuie0000
Copy link

xuie0000 commented Apr 26, 2019

For each configuration compilation of ngnix, -Werror will be automatically added. Modify this part to disable the decompression, and it should work normally after the change!

diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh
index 63e9f707..245c99d9 100755
--- a/trunk/auto/depends.sh
+++ b/trunk/auto/depends.sh
@@ -515,9 +515,12 @@ if [ $__SRS_BUILD_NGINX = YES ]; then
     else
         echo "Building nginx-1.5.7";
         (
-            rm -rf ${SRS_OBJS}/nginx-1.5.7 && cd ${SRS_OBJS} && 
-            unzip -q ../3rdparty/nginx-1.5.7.zip && cd nginx-1.5.7 && 
-            ./configure --prefix=`pwd`/_release && make ${SRS_JOBS} && make install &&
+            #rm -rf ${SRS_OBJS}/nginx-1.5.7 && 
+	    cd ${SRS_OBJS} && 
+            #unzip -q ../3rdparty/nginx-1.5.7.zip && 
+	    cd nginx-1.5.7 && 
+            #./configure --prefix=`pwd`/_release && 
+	    make ${SRS_JOBS} && make install &&
             cd .. && rm -rf nginx && ln -sf nginx-1.5.7/_release nginx
         )
     fi

TRANS_BY_GPT3

@weldevan
Copy link

weldevan commented Sep 6, 2019

I did all the process on a virtual machine, opened test ports and the ports are open, but when I connect to the server, it gives me this error.

Failed to connect

Failed to connect to Server

The connection timed out. Make sure you have set up a valid broadcast service and no firewall is blocking the connection.

OK
https://prnt.sc/p2t03q
https://prnt.sc/p2t2as
firewall ports are open

TRANS_BY_GPT3

@weldevan
Copy link

weldevan commented Sep 7, 2019

How do I install it on a VPS?

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Sep 12, 2021
@hanxinle
Copy link

build srs1.0relese met this error. I solved it by :
Change Makefile in 3rdparty/http-parser-2.1.zip by delete -Werror in the line start with "CFLAGS".

then,
both ./configure and make OK.

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement or enhancement. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

9 participants