diff --git a/.ci/lib/config.jenkinsfile b/.ci/lib/config.jenkinsfile index 75e4ff6123..2b900aff15 100644 --- a/.ci/lib/config.jenkinsfile +++ b/.ci/lib/config.jenkinsfile @@ -1,4 +1,3 @@ -env.WERROR = '1' env.MAKEOPTS = '-j8' python_platlib = sh(returnStdout: true, script: 'python3 Scripts/get-python-platlib.py "$PREFIX"') diff --git a/.ci/lib/stage-build-nosgx.jenkinsfile b/.ci/lib/stage-build-nosgx.jenkinsfile index 990f022fbb..a6f99f6855 100644 --- a/.ci/lib/stage-build-nosgx.jenkinsfile +++ b/.ci/lib/stage-build-nosgx.jenkinsfile @@ -13,6 +13,7 @@ stage('build') { try { sh ''' meson setup build/ \ + --werror \ --prefix="$PREFIX" \ --buildtype="$BUILDTYPE" \ -Dskeleton=enabled \ diff --git a/.ci/lib/stage-build-sgx.jenkinsfile b/.ci/lib/stage-build-sgx.jenkinsfile index f0312dd72f..30cb446770 100644 --- a/.ci/lib/stage-build-sgx.jenkinsfile +++ b/.ci/lib/stage-build-sgx.jenkinsfile @@ -32,6 +32,7 @@ stage('build') { try { sh ''' meson setup build-dcap/ \ + --werror \ --prefix="$PREFIX" \ --buildtype="$BUILDTYPE" \ -Ddirect=disabled \ @@ -49,6 +50,7 @@ stage('build') { try { sh ''' meson setup build/ \ + --werror \ --prefix="$PREFIX" \ --buildtype="$BUILDTYPE" \ -Ddirect=disabled \ diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index b099314ae7..fb0f8e9b65 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -182,7 +182,7 @@ also built by Meson, must be installed as well. To do that, configure your build directory with ``-Dtests=enabled`` and install Gramine:: # add -Dsgx=enabled and SGX options if necessary - meson setup build/ -Dtests=enabled -Ddirect=enabled + meson setup build/ --werror -Dtests=enabled -Ddirect=enabled ninja -C build/ sudo ninja -C build/ install diff --git a/Documentation/devel/building.rst b/Documentation/devel/building.rst index ff868aaee6..c188d06c18 100644 --- a/Documentation/devel/building.rst +++ b/Documentation/devel/building.rst @@ -156,6 +156,11 @@ means non-SGX version):: meson setup build/ --buildtype=release -Ddirect=enabled -Dsgx=enabled \ -Dsgx_driver= -Dsgx_driver_include_path= +.. note:: + + If you plan to contribute changes to Gramine, then you should always build it + with ``--werror`` added to the invocation above. + .. note:: If you invoked ``meson setup`` once, the next invocation of this command will diff --git a/Documentation/devel/debugging.rst b/Documentation/devel/debugging.rst index 33de8a09fd..f05f55b8dd 100644 --- a/Documentation/devel/debugging.rst +++ b/Documentation/devel/debugging.rst @@ -14,7 +14,7 @@ debugging process easier. To build Gramine with debug symbols, the source code needs to be compiled with ``--buildtype=debug``:: - meson setup build-debug/ --buildtype=debug -Ddirect=enabled + meson setup build-debug/ --werror --buildtype=debug -Ddirect=enabled ninja -C build-debug/ sudo ninja -C build-debug/ install @@ -37,7 +37,7 @@ execution *outside* the enclave). To build Gramine with debug symbols, the source code needs to be compiled with ``--buildtype=debug``:: - meson setup build-debug/ --buildtype=debug -Dsgx=enabled + meson setup build-debug/ --werror --buildtype=debug -Dsgx=enabled ninja -C build-debug/ sudo ninja -C build-debug/ install diff --git a/meson.build b/meson.build index 7334f2aea1..050a0a9d95 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,6 @@ project( default_options: [ 'c_std=c11', 'cpp_std=c++14', - 'werror=true', ], )