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

Update Mac deps and reduce CI time #1745

Merged
merged 7 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:20.04

MAINTAINER Lynckia
LABEL maintainer="Lynckia"

WORKDIR /opt

Expand Down Expand Up @@ -28,11 +28,11 @@ RUN mkdir /opt/licode/.git
# Clone and install licode
WORKDIR /opt/licode/scripts

RUN ./installErizo.sh -dfeacs && \
RUN ./installErizo.sh -dfEAcs && \
./../nuve/installNuve.sh && \
./installBasicExample.sh

RUN ldconfig /opt/licode/build/libdeps/build/lib
RUN ldconfig /opt/licode/build/libdeps/build/lib

WORKDIR /opt/licode

Expand Down
3 changes: 2 additions & 1 deletion erizo/conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[requires]
boost/1.69.0
boost/1.76.0
log4cxx/0.12.0
IncludePathsGenerator/0.1@lynckia/includes

[generators]
Expand Down
38 changes: 37 additions & 1 deletion erizo/generateProject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ FILENAME=`basename $SCRIPT`
PATHNAME=`dirname $SCRIPT`
BASE_BIN_DIR="build"

usage()
{
cat << EOF
usage: $0 options
Generate Erizo projects. It will generate all builds if no option is passed.
OPTIONS:
-h Show this message
-d Generate debug
-r Generate release
EOF
}


generateVersion() {
echo "generating $1"
Expand All @@ -20,6 +32,30 @@ generateVersion() {
cd $PATHNAME
}

if [ "$#" -eq 0 ]
then
generateVersion debug
generateVersion release
else
while getopts “hdr” OPTION
do
case $OPTION in
h)
usage
exit 1
;;
d)
generateVersion debug
;;
r)
generateVersion release
;;
?)
usage
exit
;;
esac
done
fi

generateVersion release
generateVersion debug
8 changes: 5 additions & 3 deletions erizo/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ set(THIRD_PARTY_LIB "${CMAKE_CURRENT_SOURCE_DIR}/../../build/libdeps/build/lib/"

## Depencencies

include(${CMAKE_CURRENT_SOURCE_DIR}/../conan_paths.cmake)

# Add /usr/local/include
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include_directories("/usr/local/include")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

# BOOST
include(${CMAKE_CURRENT_SOURCE_DIR}/../conan_paths.cmake)
set (BOOST_LIBS thread regex system)
find_package(Boost)
include_directories(${Boost_INCLUDE_DIRS})
Expand Down Expand Up @@ -96,8 +97,9 @@ test_lib(${AVFORMAT})
set (LIBS ${LIBS} ${AVFORMAT})

# LOG4CXX
find_library(LOG log4cxx)
test_lib(${LOG})
set (LOG4CXX_LIBS log4cxx)
find_package(log4cxx)
include_directories(${log4cxx_INCLUDE_DIRS})

# WEBRTC
include("${CMAKE_CURRENT_SOURCE_DIR}/third_party/webrtc.cmake")
Expand Down
8 changes: 4 additions & 4 deletions erizo/src/erizo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ set(ERIZO_VERSION_MAJOR 0)
set(ERIZO_VERSION_MINOR 1)
if(${ERIZO_BUILD_TYPE} STREQUAL "debug")
message("Generating DEBUG project")
set(CMAKE_CXX_FLAGS "-g -Wall -std=c++14 ${ERIZO_CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-g -Wall -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS}")
elseif(${ERIZO_BUILD_TYPE} STREQUAL "sanitizer")
message("Generating SANITIZER project")
set(CMAKE_CXX_FLAGS "-g -Wall -std=c++14 ${ERIZO_CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=address -fno-optimize-sibling-calls")
set(CMAKE_CXX_FLAGS "-g -Wall -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=address -fno-optimize-sibling-calls")
else()
message("Generating RELEASE project")
set(CMAKE_CXX_FLAGS "-g -Wall -O3 -std=c++14 ${ERIZO_CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-g -Wall -O3 -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS}")
endif()


Expand All @@ -23,4 +23,4 @@ file(GLOB_RECURSE ERIZO_SOURCES "${ERIZO_SOURCE_DIR}/*.h" "${ERIZO_SOURCE_DIR}/*
add_library(erizo SHARED ${ERIZO_SOURCES})


target_link_libraries(erizo ${Boost_LIBRARIES} ${SRTP} ${SSL} ${CRYPTO} ${LIBS} ${LOG} webrtc nicer nrappkit)
target_link_libraries(erizo ${Boost_LIBRARIES} ${SRTP} ${SSL} ${CRYPTO} ${LIBS} ${log4cxx_LIBRARIES} webrtc nicer nrappkit)
2 changes: 1 addition & 1 deletion erizo/src/erizo/thread/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <assert.h>

#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <utility>


Expand Down
2 changes: 1 addition & 1 deletion erizo/src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else()
set(SANITIZER_OPTION "")
endif()

set(CMAKE_CXX_FLAGS "-g -Wall -std=c++14 ${ERIZO_CMAKE_CXX_FLAGS} ${SANITIZER_OPTION}")
set(CMAKE_CXX_FLAGS "-g -Wall -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS} ${SANITIZER_OPTION}")

file(GLOB_RECURSE ERIZO_TEST_SDPS ${ERIZO_TEST_SOURCE_DIR}/*.sdp)
file(COPY ${ERIZO_TEST_SDPS} DESTINATION ${ERIZO_TEST_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion erizo/src/third_party/webrtc/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ add_library(webrtc STATIC ${WEBRTC_SOURCES} )

target_include_directories(webrtc PUBLIC ${WEBRTC_SOURCE_DIR})

target_link_libraries(webrtc ${LOG})
target_link_libraries(webrtc ${log4cxx_LIBRARIES})
57 changes: 32 additions & 25 deletions erizoAPI/binding.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
'variables' : {
'no_debug': '0',
'common_sources': [ 'addon.cc', 'PromiseDurationDistribution.cc', 'IOThreadPool.cc', 'AsyncPromiseWorker.cc', 'ThreadPool.cc', 'MediaStream.cc', 'WebRtcConnection.cc', 'OneToManyProcessor.cc', 'ExternalInput.cc', 'ExternalOutput.cc', 'SyntheticInput.cc', 'ConnectionDescription.cc'],
'common_include_dirs' : ["<!(node -e \"require('nan')\")", '$(ERIZO_HOME)/src/erizo', '$(ERIZO_HOME)/../build/libdeps/build/include', '$(ERIZO_HOME)/src/third_party/webrtc/src','$(ERIZO_HOME)/src/erizo/handlers']
},
Expand All @@ -15,38 +16,44 @@
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'YES', # -fno-rtti
'MACOSX_DEPLOYMENT_TARGET' : '10.15', #from MAC OS 10.7
'OTHER_CFLAGS': ['-Werror -Qunused-arguments -g -O3 -stdlib=libc++ -std=c++14 -DBOOST_THREAD_PROVIDES_FUTURE -DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION -DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY @$(ERIZO_HOME)/conanbuildinfo.args',]
'OTHER_CFLAGS': ['-Werror -Qunused-arguments -g -O3 -stdlib=libc++ -std=c++17 -DBOOST_THREAD_PROVIDES_FUTURE -DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION -DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY @$(ERIZO_HOME)/conanbuildinfo.args',]
},
}, { # OS!="mac"
'cflags!' : ['-fno-exceptions'],
'cflags' : ['-D__STDC_CONSTANT_MACROS'],
'cflags_cc' : ['-Werror', '-Wall', '-O3', '-g' , '-std=c++14', '-fexceptions', '-DBOOST_THREAD_PROVIDES_FUTURE', '-DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION', '-DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY', '@$(ERIZO_HOME)/conanbuildinfo.args'],
'cflags_cc' : ['-Werror', '-Wall', '-O3', '-g' , '-std=c++17', '-fexceptions', '-DBOOST_THREAD_PROVIDES_FUTURE', '-DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION', '-DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY', '@$(ERIZO_HOME)/conanbuildinfo.args'],
'cflags_cc!' : ['-fno-exceptions'],
'cflags_cc!' : ['-fno-rtti']
}],
]
},
{
'target_name': 'addonDebug',
'sources': ['<@(common_sources)'],
'include_dirs' : ['<@(common_include_dirs)'],
'libraries': ['-L$(ERIZO_HOME)/build/debug/erizo -lerizo -Wl,-rpath,<(module_root_dir)/../erizo/build/debug/erizo'],
'conditions': [
[ 'OS=="mac"', {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'YES', # -fno-rtti
'MACOSX_DEPLOYMENT_TARGET' : '10.15', #from MAC OS 10.7
'OTHER_CFLAGS': ['-Werror -Qunused-arguments -g -stdlib=libc++ -std=c++14 -DBOOST_THREAD_PROVIDES_FUTURE -DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION -DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY @$(ERIZO_HOME)/conanbuildinfo.args']
},
}, { # OS!="mac"
'cflags!' : ['-fno-exceptions'],
'cflags' : ['-D__STDC_CONSTANT_MACROS'],
'cflags_cc' : ['-Werror', '-Wall', '-g' , '-std=c++14', '-fexceptions', '-DBOOST_THREAD_PROVIDES_FUTURE', '-DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION', '-DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY', '@$(ERIZO_HOME)/conanbuildinfo.args'],
'cflags_cc!' : ['-fno-exceptions'],
'cflags_cc!' : ['-fno-rtti']
}],
]
}
]
],
'conditions': [
['no_debug!=1', {
'targets': [
{
'target_name': 'addonDebug',
'sources': ['<@(common_sources)'],
'include_dirs' : ['<@(common_include_dirs)'],
'libraries': ['-L$(ERIZO_HOME)/build/debug/erizo -lerizo -Wl,-rpath,<(module_root_dir)/../erizo/build/debug/erizo'],
'conditions': [
[ 'OS=="mac"', {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'YES', # -fno-rtti
'MACOSX_DEPLOYMENT_TARGET' : '10.15', #from MAC OS 10.7
'OTHER_CFLAGS': ['-Werror -Qunused-arguments -g -stdlib=libc++ -std=c++17 -DBOOST_THREAD_PROVIDES_FUTURE -DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION -DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY @$(ERIZO_HOME)/conanbuildinfo.args']
},
}, { # OS!="mac"
'cflags!' : ['-fno-exceptions'],
'cflags' : ['-D__STDC_CONSTANT_MACROS'],
'cflags_cc' : ['-Werror', '-Wall', '-g' , '-std=c++14', '-fexceptions', '-DBOOST_THREAD_PROVIDES_FUTURE', '-DBOOST_THREAD_PROVIDES_FUTURE_CONTINUATION', '-DBOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY', '@$(ERIZO_HOME)/conanbuildinfo.args'],
'cflags_cc!' : ['-fno-exceptions'],
'cflags_cc!' : ['-fno-rtti']
}],
]
}
],
}],
],
}
6 changes: 3 additions & 3 deletions erizoAPI/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 20 additions & 2 deletions erizo_controller/common/logger.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

// eslint-disable-next-line import/no-extraneous-dependencies
const log4js = require('log4js');

global.config = global.config || {};

global.config.logger = global.config.logger || {};

const logFile = global.config.logger.configFile || '../log4js_configuration.json';
let logFile = global.config.logger.configFile || '../log4js_configuration.json';


const logJsonReplacer = (key, value) => {
Expand All @@ -22,6 +21,25 @@ const logJsonReplacer = (key, value) => {
return value;
};

if (logFile === true) {
logFile = {
appenders: {
out: {
type: 'stdout',
layout: {
type: 'pattern',
pattern: '%d - %p: %c - %m',
},
},
},
categories: {
default: {
appenders: ['out'],
level: 'OFF',
},
},
};
}
log4js.configure(logFile);

exports.logger = log4js;
Expand Down
2 changes: 1 addition & 1 deletion erizo_controller/erizoAgent/erizoAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const spawn = require('child_process').spawn;
const config = require('./../../licode_config');
const ErizoList = require('./erizoList').ErizoList;
const fs = require('fs');
const RovReplManager = require('./../common/ROV/rovReplManager').RovReplManager;

// Configuration default values
global.config = config || {};
Expand Down Expand Up @@ -101,6 +100,7 @@ Object.keys(opt.options).forEach((prop) => {
// Load submodules with updated config
const logger = require('./../common/logger').logger;
const amqper = require('./../common/amqper');
const RovReplManager = require('./../common/ROV/rovReplManager').RovReplManager;

// Logger
const log = logger.getLogger('ErizoAgent');
Expand Down
1 change: 1 addition & 0 deletions erizo_controller/erizoClient/gulp/erizoTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const erizoTasks = (gulp, plugins, config) => {
gulp.src(`${erizoConfig.debug}/**/*.js`, { base: './' })
.pipe(plugins.sourcemaps.init())
.pipe(plugins.closureCompiler({
warning_level: 'QUIET',
languageIn: 'ECMASCRIPT6',
languageOut: 'ECMASCRIPT5',
jsOutputFile: 'erizo.js',
Expand Down
2 changes: 0 additions & 2 deletions erizo_controller/erizoClient/src/utils/Base64.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global unescape */

const Base64 = (() => {
let base64Str;
let base64Count;
Expand Down
2 changes: 0 additions & 2 deletions erizo_controller/erizoClient/src/utils/ErizoMap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global unescape */

const ErizoMap = () => {
const that = {};
let values = {};
Expand Down
6 changes: 2 additions & 4 deletions erizo_controller/erizoClient/src/utils/Logger.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global console */

/*
* API to write logs based on traditional logging mechanisms: debug, trace, info, warning, error
*/
Expand Down Expand Up @@ -37,8 +35,8 @@ const Logger = (() => {
logPrefix = newLogPrefix;
};

// Generic function to print logs for a given level:
// Logger.[DEBUG, TRACE, INFO, WARNING, ERROR]
// Generic function to print logs for a given level:
// Logger.[DEBUG, TRACE, INFO, WARNING, ERROR]
const log = (level, ...args) => {
let out = logPrefix;
if (level === Logger.DEBUG) {
Expand Down
2 changes: 1 addition & 1 deletion erizo_controller/erizoClient/src/views/Bar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global document, clearTimeout, setTimeout */
/* global document */

import View from './View';
import Speaker from './Speaker';
Expand Down
1 change: 1 addition & 0 deletions erizo_controller/erizoClient/webpack.config.erizo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');

module.exports = {
entry: './src/Erizo.js',
mode: 'production',
output: {
filename: 'erizo.js',
path: path.resolve(__dirname, 'dist'),
Expand Down
1 change: 1 addition & 0 deletions erizo_controller/erizoClient/webpack.config.erizofc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');

module.exports = {
mode: 'production',
entry: './src/ErizoFc.js',
output: {
filename: 'erizofc.js',
Expand Down
2 changes: 1 addition & 1 deletion erizo_controller/erizoJS/erizoJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Object.keys(opt.options).forEach((prop) => {
break;
case 'debug':
// eslint-disable-next-line import/no-unresolved, global-require
global.config.erizo.addon = 'addonDebug';
global.config.erizo.addon = 'addon';
isDebugMode = true;
break;
default:
Expand Down
Loading