Skip to content

Commit

Permalink
Change the default value of PDO_DEBUG_BUILD to 1.
Browse files Browse the repository at this point in the history
This increases consistency with the SGX_MODE,
which is set to SIM by default.

Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
  • Loading branch information
bvavala authored and cmickeyb committed May 29, 2024
1 parent b6fd980 commit 37ab11b
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
if: "!contains(github.event.commits[0].message, '[debug]')"
env:
PDO_INTERPRETER: ${{ matrix.interpreter }}
PDO_DEBUG_BUILD: 1
PDO_LOG_LEVEL: warning
run: |
# The creation of a dummy branch is necessary for the CI tests
Expand All @@ -38,7 +37,6 @@ jobs:
if: "contains(github.event.commits[0].message, '[debug]')"
env:
PDO_INTERPRETER: ${{ matrix.interpreter }}
PDO_DEBUG_BUILD: 1
PDO_LOG_LEVEL: debug
run: |
# The creation of a dummy branch is necessary for the CI tests
Expand Down
2 changes: 1 addition & 1 deletion build/cmake/ProjectVariables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ADD_COMPILE_OPTIONS(-m64 -fvisibility=hidden -fpie -fPIC -fstack-protector)
ADD_COMPILE_OPTIONS($<$<COMPILE_LANGUAGE:CXX>:-std=c++11>)

OPTION(PDO_DEBUG_BUILD "Build with debugging turned on" 0)
OPTION(PDO_DEBUG_BUILD "Build with debugging turned on" 1)

IF (DEFINED ENV{PDO_DEBUG_BUILD})
SET(PDO_DEBUG_BUILD $ENV{PDO_DEBUG_BUILD})
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PDO_SOURCE_ROOT ?= $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../

# PDO_DEBUG_BUILD
# The flag that determines the build type (debug or not).
PDO_DEBUG_BUILD ?= ${PDO_DEBUG_BUILD:-0}
PDO_DEBUG_BUILD ?= 1

# PDO_REPO --
# The URL or path to the git repository, the default uses the current repository
Expand Down
2 changes: 1 addition & 1 deletion docker/pdo_ccf.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ARG REBUILD=0
ARG SGX_MODE=SIM
ENV SGX_MODE=$SGX_MODE

ARG PDO_DEBUG_BUILD=0
ARG PDO_DEBUG_BUILD=1
ENV PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD}

# XFER_DIR is the directory where the networkcert.pem file is
Expand Down
2 changes: 1 addition & 1 deletion docker/pdo_client.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ USER $UNAME
# -----------------------------------------------------------------
ARG REBUILD=0

ARG PDO_DEBUG_BUILD=0
ARG PDO_DEBUG_BUILD=1
ENV PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD}

ARG PDO_LEDGER_TYPE=ccf
Expand Down
2 changes: 1 addition & 1 deletion docker/pdo_services.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ARG REBUILD=0
ARG SGX_MODE=SIM
ENV SGX_MODE $SGX_MODE

ARG PDO_DEBUG_BUILD=0
ARG PDO_DEBUG_BUILD=1
ENV PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD}

ARG PDO_LEDGER_TYPE=ccf
Expand Down
4 changes: 2 additions & 2 deletions docker/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ services:
environment:
- PDO_VERSION=${PDO_VERSION}
- PDO_LOG_LEVEL=${PDO_LOG_LEVEL:-info}
- PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD:-0}
- PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD:-1}
entrypoint: /project/pdo/tools/run_services_tests.sh

client_container:
environment:
- PDO_VERSION=${PDO_VERSION}
- PDO_LOG_LEVEL=${PDO_LOG_LEVEL:-info}
- PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD:-0}
- PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD:-1}
entrypoint: /project/pdo/tools/run_client_tests.sh
2 changes: 1 addition & 1 deletion docker/tools/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export SGX_MODE=${SGX_MODE:-SIM}
export PDO_LEDGER_TYPE=${PDO_LEDGER_TYPE:-ccf}
export PDO_INTERPRETER=${PDO_INTERPRETER:-wawaka}
export WASM_MEM_CONFIG=${WASM_MEM_CONFIG:-MEDIUM}
export PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD:-0}
export PDO_DEBUG_BUILD=${PDO_DEBUG_BUILD:-1}

# these variables are internal to the layout of the container and immutable
export PDO_SOURCE_ROOT=/project/pdo/src
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ will be exported. Defaults to HOSTNAME.

<!-- -------------------------------------------------- -->
### `PDO_DEBUG_BUILD`
(default: 0)
(default: 1)

`PDO_DEBUG_BUILD` builds PDO modules for debugging. This includes
compile flags, logging statements in the enclave, etc. Since
Expand Down
2 changes: 1 addition & 1 deletion eservice/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
## -----------------------------------------------------------------
## set up the contract enclave
## -----------------------------------------------------------------
debug_flag_env = os.environ.get('PDO_DEBUG_BUILD', '0')
debug_flag_env = os.environ.get('PDO_DEBUG_BUILD', '1')
if debug_flag_env not in ['0', '1'] :
print(f'error: PDO_DEBUG_BUILD must be 0 or 1, current value is {debug_flag_env}')
sys.exit(2)
Expand Down
2 changes: 1 addition & 1 deletion pservice/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
## -----------------------------------------------------------------
## set up the PService enclave
## -----------------------------------------------------------------
debug_flag_env = os.environ.get('PDO_DEBUG_BUILD', '0')
debug_flag_env = os.environ.get('PDO_DEBUG_BUILD', '1')
if debug_flag_env not in ['0', '1'] :
print(f'error: PDO_DEBUG_BUILD must be 0 or 1, current value is {debug_flag_env}')
sys.exit(2)
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# note that setuptools does not make it easy to pass custom command
# line parameters so we have to use environment variables
# -----------------------------------------------------------------
debug_flag = int(os.environ.get('PDO_DEBUG_BUILD', 0))
debug_flag = int(os.environ.get('PDO_DEBUG_BUILD', 1))
if debug_flag :
print("Build debug")

Expand Down

0 comments on commit 37ab11b

Please sign in to comment.