diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 38c3146a3..a8335efcf 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,8 +27,8 @@ jobs: run: | echo "pwd: $(pwd), who: $(whoami)" docker run --rm -v $(pwd):$(pwd) -w $(pwd)/trunk ossrs/srs:ubuntu20-cache \ - bash -c "./configure --jobs=2 && chmod 777 -R objs" - cd trunk && ./configure --jobs=2 && make -j2 + bash -c "./configure && chmod 777 -R objs" + cd trunk && ./configure && make - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b34cff63a..182d72726 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -134,7 +134,7 @@ jobs: run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest' # For regression-test - name: Run SRS regression-test - run: docker run --rm srs:test bash -c 'make && ./objs/srs -c conf/regression-test.conf && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v' + run: docker run --rm srs:test bash -c 'make && (./objs/srs -c conf/regression-test.conf; ./etc/init.d/srs status) && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v' coverage: name: coverage diff --git a/trunk/Dockerfile b/trunk/Dockerfile index 84f7aa267..e2e3a8e52 100644 --- a/trunk/Dockerfile +++ b/trunk/Dockerfile @@ -4,9 +4,8 @@ FROM ${ARCH}${IMAGE} AS build ARG BUILDPLATFORM ARG TARGETPLATFORM -ARG JOBS=2 ARG SRS_AUTO_PACKAGER -RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, JOBS: $JOBS, PACKAGER: ${#SRS_AUTO_PACKAGER}" +RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, PACKAGER: ${#SRS_AUTO_PACKAGER}" # https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image ENV DEBIAN_FRONTEND noninteractive @@ -24,7 +23,7 @@ WORKDIR /srs/trunk # Build and install SRS. # Note that SRT is enabled by default, so we configure without --srt=on. -RUN ./configure --jobs=${JOBS} --gb28181=on --sanitizer-static=on && make -j${JOBS} && make install +RUN ./configure --gb28181=on --sanitizer-static=on && make && make install # All config files for SRS. RUN cp -R conf /usr/local/srs/conf && \ diff --git a/trunk/Dockerfile.builds b/trunk/Dockerfile.builds index 71d4c803b..d67210220 100644 --- a/trunk/Dockerfile.builds +++ b/trunk/Dockerfile.builds @@ -1,74 +1,74 @@ ######################################################## FROM ossrs/srs:dev-cache AS centos7-baseline COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make FROM ossrs/srs:dev-cache AS centos7-no-webrtc COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --rtc=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --rtc=off && make FROM ossrs/srs:dev-cache AS centos7-no-asm COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --nasm=off --srtp-nasm=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --nasm=off --srtp-nasm=off && make FROM ossrs/srs:dev-cache AS centos7-all COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2 +RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make FROM ossrs/srs:dev-cache AS centos7-ansi-no-ffmpeg COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --cxx11=off --cxx14=off --ffmpeg-fit=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --cxx11=off --cxx14=off --ffmpeg-fit=off && make ######################################################## FROM ossrs/srs:dev6-cache AS centos6-baseline COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --cxx11=off --cxx14=off --sanitizer=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --cxx11=off --cxx14=off --sanitizer=off && make FROM ossrs/srs:dev6-cache AS centos6-all COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on --cxx11=off --cxx14=off --sanitizer=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=on --gb28181=on --cxx11=off --cxx14=off --sanitizer=off && make ######################################################## FROM ossrs/srs:ubuntu16-cache AS ubuntu16-baseline COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make FROM ossrs/srs:ubuntu16-cache AS ubuntu16-all COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2 +RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make ######################################################## FROM ossrs/srs:ubuntu18-cache AS ubuntu18-baseline COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make FROM ossrs/srs:ubuntu18-cache AS ubuntu18-all COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2 +RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make ######################################################## FROM ossrs/srs:ubuntu20-cache AS ubuntu20-baseline COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2 +RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make FROM ossrs/srs:ubuntu20-cache AS ubuntu20-all COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2 +RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make ######################################################## FROM ossrs/srs:ubuntu16-cross-arm AS ubuntu16-cross-armv7 COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=arm-linux-gnueabihf- && make -j2 +RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=arm-linux-gnueabihf- && make FROM ossrs/srs:ubuntu16-cross-aarch64 AS ubuntu16-cross-aarch64 COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=aarch64-linux-gnu- && make -j2 +RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=aarch64-linux-gnu- && make ######################################################## FROM ossrs/srs:ubuntu20-cross-arm AS ubuntu20-cross-armv7 COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=arm-linux-gnueabihf- && make -j2 +RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=arm-linux-gnueabihf- && make FROM ossrs/srs:ubuntu20-cross-aarch64 AS ubuntu20-cross-aarch64 COPY . /srs -RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=aarch64-linux-gnu- && make -j2 +RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=aarch64-linux-gnu- && make diff --git a/trunk/Dockerfile.cov b/trunk/Dockerfile.cov index c26a946db..ca1dd4f8f 100644 --- a/trunk/Dockerfile.cov +++ b/trunk/Dockerfile.cov @@ -8,5 +8,5 @@ COPY . /srs WORKDIR /srs/trunk # Note that we must enable the gcc7 or link failed. -RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on --gcov=on --sanitizer=off --jobs=2 -RUN scl enable devtoolset-7 -- make -j2 utest +RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on --gcov=on --sanitizer=off +RUN scl enable devtoolset-7 -- make utest diff --git a/trunk/Dockerfile.pkg b/trunk/Dockerfile.pkg index 1fb3d600a..b05263189 100644 --- a/trunk/Dockerfile.pkg +++ b/trunk/Dockerfile.pkg @@ -10,5 +10,5 @@ RUN yum install -y zip # Build and install SRS. ADD srs-server-${version}.tar.gz /srs WORKDIR /srs/srs-server-${version}/trunk -RUN ./scripts/package.sh --x86-x64 --jobs=2 --tag=${version} +RUN ./scripts/package.sh --x86-x64 --tag=${version} diff --git a/trunk/Dockerfile.test b/trunk/Dockerfile.test index 1cecb3dbb..b4e37dabd 100644 --- a/trunk/Dockerfile.test +++ b/trunk/Dockerfile.test @@ -6,8 +6,8 @@ COPY . /srs WORKDIR /srs/trunk # Note that we must enable the gcc7 or link failed. -RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on --sanitizer=off --jobs=2 -RUN scl enable devtoolset-7 -- make -j2 utest +RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on +RUN scl enable devtoolset-7 -- make utest # Build benchmark tool. RUN cd 3rdparty/srs-bench && make diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index d6996d193..86023513b 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -326,6 +326,7 @@ if [[ -d /usr/local/srs-cache/srs/trunk/objs && $(pwd) != "/usr/local/srs-cache/ echo "Build from cache, source=$SOURCE_DIR, target=$TARGET_DIR" && rm -rf $TARGET_DIR && mkdir -p ${SRS_OBJS} && cp -R $SOURCE_DIR $TARGET_DIR && du -sh /usr/local/srs-cache/srs/trunk/objs/Platform-* && + du -sh /usr/local/srs-cache/srs/trunk/objs/Platform-*/* && du -sh objs/Platform-* && ls -lh objs fi diff --git a/trunk/src/app/srs_app_gb28181.cpp b/trunk/src/app/srs_app_gb28181.cpp index 8b46d0c81..042cc71b0 100644 --- a/trunk/src/app/srs_app_gb28181.cpp +++ b/trunk/src/app/srs_app_gb28181.cpp @@ -2333,7 +2333,7 @@ srs_error_t SrsRecoverablePsContext::decode_rtp(SrsBuffer* stream, int reserved, SrsRtpPacket rtp; int pos = stream->pos(); if ((err = rtp.decode(stream)) != srs_success) { - return enter_recover_mode(stream, handler, pos, err = srs_error_new(ERROR_GB_PS_HEADER, "decode rtp")); + return enter_recover_mode(stream, handler, pos, srs_error_wrap(err, "decode rtp")); } SrsRtpRawPayload* rtp_raw = dynamic_cast(rtp.payload());