Skip to content

Commit 0a9a3a9

Browse files
committed
Fix the build breaks the release pipeline and some C++ warnings (#372)
* fix the break in release pipeline * code cleanup and the warnings fixing. * Update ci.yml for Azure Pipelines * Update ci.yml for Azure Pipelines * fix linux build * one more fixing * again? * fixing for macOS
1 parent 2521dab commit 0a9a3a9

28 files changed

Lines changed: 123 additions & 267 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ out/
3838
.scb/
3939
onnxruntime_extensions/_version.py
4040
onnxruntime-*-*-*/
41-
temp_*.onnx
41+
temp_*onnx*
4242
# Java specific ignores
4343
*/.gradle
4444
java/hs_*.log

.pipelines/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,3 +478,19 @@ jobs:
478478
echo "Exception propogation was not enabled correctly."
479479
exit 1
480480
fi
481+
482+
483+
##############################
484+
# Linux for selected_ops build
485+
##############################
486+
- job: Linux_SelectedOpsBuild
487+
pool:
488+
vmImage: 'ubuntu-latest'
489+
490+
steps:
491+
# compiled as only one operator selected.
492+
- bash: |
493+
set -e -x -u
494+
echo 'set (OCOS_ENABLE_BERT_TOKENIZER ON CACHE BOOL "" FORCE)' > cmake/_selectedoplist.cmake
495+
./build.sh -DOCOS_ENABLE_CPP_EXCEPTIONS=OFF -DOCOS_ENABLE_SELECTED_OPLIST=ON
496+
displayName: Build ort-extensions with only one operator was selected

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ endif()
208208

209209
if(NOT OCOS_ENABLE_CPP_EXCEPTIONS)
210210
add_compile_definitions(OCOS_NO_EXCEPTIONS ORT_NO_EXCEPTIONS)
211+
if (NOT _ONNXRUNTIME_EMBEDDED)
212+
add_compile_definitions(_HAS_EXCEPTIONS=0)
213+
endif()
211214
endif()
212215

213216
include(FetchContent)
@@ -254,7 +257,7 @@ if(OCOS_ENABLE_RE2_REGEX)
254257
endif()
255258

256259
# ### scan all source files
257-
set(TARGET_SRC_NOEXCEPTION)
260+
file(GLOB TARGET_SRC_NOEXCEPTION "base/*.h" "base/*.cc")
258261
file(GLOB TARGET_SRC "operators/*.cc" "operators/*.h" "includes/*.h*")
259262

260263
if(OCOS_ENABLE_TF_STRING)
@@ -402,11 +405,13 @@ standardize_output_folder(ocos_operators)
402405
target_include_directories(noexcep_operators PUBLIC
403406
${ONNXRUNTIME_INCLUDE_DIR}
404407
${PROJECT_SOURCE_DIR}/includes
408+
${PROJECT_SOURCE_DIR}/base
405409
${PROJECT_SOURCE_DIR}/operators)
406410

407411
target_include_directories(ocos_operators PUBLIC
408412
${ONNXRUNTIME_INCLUDE_DIR}
409413
${PROJECT_SOURCE_DIR}/includes
414+
${PROJECT_SOURCE_DIR}/base
410415
${PROJECT_SOURCE_DIR}/operators
411416
${PROJECT_SOURCE_DIR}/operators/tokenizer)
412417

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
3+
#include "string_tensor.h"
34
#include "string_utils.h"
45
#include "ustring.h"
5-
#include "string_tensor.h"
66

77
void GetTensorMutableDataString(const OrtApi& api, OrtW::CustomOpApi& ort, OrtKernelContext* context,
88
const OrtValue* value, std::vector<std::string>& output) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#pragma once
55

6-
#include <string>
76
#include "ocos.h"
7+
#include <string>
88

99

1010
// Retrieves a vector of strings if the input type is std::string.

0 commit comments

Comments
 (0)