diff --git a/.github/workflows/nmodl-ci.yml b/.github/workflows/nmodl-ci.yml index 70e3f8cf8..ec71cc692 100644 --- a/.github/workflows/nmodl-ci.yml +++ b/.github/workflows/nmodl-ci.yml @@ -30,6 +30,7 @@ jobs: os: ubuntu-20.04 - config: flag_warnings: ON + glibc_asserts: ON os: ubuntu-22.04 - config: os: macos-12 @@ -113,7 +114,6 @@ jobs: working-directory: ${{runner.workspace}}/nmodl run: | echo "------- Configure -------" - mkdir build && pushd build cmake_args=(-G Ninja -DPYTHON_EXECUTABLE=$(which python3) \ -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR) @@ -134,11 +134,15 @@ jobs: CXX=$(command -v clang++-14) else CXX=${CXX:-g++} + if [[ -n "${{matrix.config.glibc_asserts}}" ]]; then + cmake_args+=(-DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_FLAGS=-D_GLIBCXX_DEBUG) + fi fi cmake_args+=(-DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache) cmake_args+=(-DNMODL_ENABLE_BACKWARD=On) - cmake .. "${cmake_args[@]}" + cmake -B build -S . "${cmake_args[@]}" env: INSTALL_DIR: ${{ runner.workspace }}/install @@ -164,7 +168,7 @@ jobs: - name: Build shell: bash - working-directory: ${{runner.workspace}}/nmodl/build + working-directory: ${{runner.workspace}}/nmodl env: CCACHE_BASEDIR: ${{runner.workspace}}/nmodl CCACHE_DIR: ${{runner.workspace}}/ccache @@ -180,7 +184,7 @@ jobs: ccache -z # Older versions don't support -v (verbose) ccache -vs 2>/dev/null || ccache -s - cmake --build . + cmake --build build ccache -vs 2>/dev/null || ccache -s - name: Test shell: bash @@ -191,9 +195,9 @@ jobs: ctest --output-on-failure -T Test - name: Install shell: bash - working-directory: ${{runner.workspace}}/nmodl/build + working-directory: ${{runner.workspace}}/nmodl run: | - cmake --build . --target install + cmake --install build - name: Update references if: matrix.config.update_references == 'On' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fc32c71da..7b456ef3a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -148,7 +148,7 @@ stages: submodules: True - script: | brew install flex bison cmake python@3 - python3 -m pip install --upgrade pip setuptools + python3 -m pip install --upgrade pip "setuptools<=70.3.0" python3 -m pip install --user -r requirements.txt displayName: 'Install Dependencies' - script: | diff --git a/src/visitors/semantic_analysis_visitor.cpp b/src/visitors/semantic_analysis_visitor.cpp index 6d005e138..a2f852664 100644 --- a/src/visitors/semantic_analysis_visitor.cpp +++ b/src/visitors/semantic_analysis_visitor.cpp @@ -56,14 +56,14 @@ bool SemanticAnalysisVisitor::check_table_vars(const ast::Program& node) { bool SemanticAnalysisVisitor::check_name_conflict(const ast::Program& node) { // check that there are no RANGE variables which have the same name as a FUNCTION or PROCEDURE const auto& range_nodes = collect_nodes(node, {ast::AstNodeType::RANGE_VAR}); - std::unordered_set range_vars{}; + std::set range_vars{}; for (const auto& range_node: range_nodes) { range_vars.insert(range_node->get_node_name()); } const auto& function_nodes = collect_nodes(node, {ast::AstNodeType::FUNCTION_BLOCK, ast::AstNodeType::PROCEDURE_BLOCK}); - std::unordered_set func_vars{}; + std::set func_vars{}; for (const auto& function_node: function_nodes) { func_vars.insert(function_node->get_node_name()); }