diff --git a/.github/workflows/publish-objectivec-apidocs.yml b/.github/workflows/publish-objectivec-apidocs.yml index 518ea8e69a..b966793cc0 100644 --- a/.github/workflows/publish-objectivec-apidocs.yml +++ b/.github/workflows/publish-objectivec-apidocs.yml @@ -21,7 +21,7 @@ permissions: jobs: build: name: Generate Objective-C API docs - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v3 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 529fccf040..7e39c7da9d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -552,30 +552,31 @@ if (WIN32) endif() else() + check_cxx_compiler_flag(-Wambiguous-reversed-operator HAS_AMBIGUOUS_REVERSED_OPERATOR) + check_cxx_compiler_flag(-Wbitwise-instead-of-logical HAS_BITWISE_INSTEAD_OF_LOGICAL) + check_cxx_compiler_flag(-Wcast-function-type HAS_CAST_FUNCTION_TYPE) + check_cxx_compiler_flag(-Wcatch-value HAS_CATCH_VALUE) + check_cxx_compiler_flag(-Wclass-memaccess HAS_CLASS_MEMACCESS) + check_cxx_compiler_flag(-Wdeprecated-anon-enum-enum-conversion HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION) + check_cxx_compiler_flag(-Wdeprecated-builtins HAS_DEPRECATED_BUILTINS) + check_cxx_compiler_flag(-Wdeprecated-copy HAS_DEPRECATED_COPY) + check_cxx_compiler_flag(-Wdeprecated-declarations HAS_DEPRECATED_DECLARATIONS) + check_cxx_compiler_flag(-Wenum-constexpr-conversion HAS_ENUM_CONSTEXPR_CONVERSION) + check_cxx_compiler_flag(-Wformat-truncation HAS_FORMAT_TRUNCATION) + check_cxx_compiler_flag(-Wignored-attributes HAS_IGNORED_ATTRIBUTES) + check_cxx_compiler_flag(-Wmaybe-uninitialized HAS_MAYBE_UNINITIALIZED) + check_cxx_compiler_flag(-Wmissing-braces HAS_MISSING_BRACES) + check_cxx_compiler_flag(-Wnonnull-compare HAS_NONNULL_COMPARE) + check_cxx_compiler_flag(-Wparentheses HAS_PARENTHESES) + check_cxx_compiler_flag(-Wshorten-64-to-32 HAS_SHORTEN_64_TO_32) + check_cxx_compiler_flag(-Wstrict-aliasing HAS_STRICT_ALIASING) + check_nvcc_compiler_flag(-Wstrict-aliasing NVCC_HAS_STRICT_ALIASING) + check_cxx_compiler_flag(-Wtautological-pointer-compare HAS_TAUTOLOGICAL_POINTER_COMPARE) + check_cxx_compiler_flag(-Wundefined-var-template HAS_UNDEFINED_VAR_TEMPLATE) check_cxx_compiler_flag(-Wunused-but-set-parameter HAS_UNUSED_BUT_SET_PARAMETER) check_cxx_compiler_flag(-Wunused-but-set-variable HAS_UNUSED_BUT_SET_VARIABLE) check_cxx_compiler_flag(-Wunused-variable HAS_UNUSED_VARIABLE) - check_cxx_compiler_flag(-Wcast-function-type HAS_CAST_FUNCTION_TYPE) - check_cxx_compiler_flag(-Wparentheses HAS_PARENTHESES) check_cxx_compiler_flag(-Wuseless-cast HAS_USELESS_CAST) - check_cxx_compiler_flag(-Wnonnull-compare HAS_NONNULL_COMPARE) - check_cxx_compiler_flag(-Wtautological-pointer-compare HAS_TAUTOLOGICAL_POINTER_COMPARE) - check_cxx_compiler_flag(-Wcatch-value HAS_CATCH_VALUE) - check_cxx_compiler_flag(-Wmissing-braces HAS_MISSING_BRACES) - check_cxx_compiler_flag(-Wignored-attributes HAS_IGNORED_ATTRIBUTES) - check_cxx_compiler_flag(-Wdeprecated-copy HAS_DEPRECATED_COPY) - check_cxx_compiler_flag(-Wdeprecated-declarations HAS_DEPRECATED_DECLARATIONS) - check_cxx_compiler_flag(-Wclass-memaccess HAS_CLASS_MEMACCESS) - check_cxx_compiler_flag(-Wmaybe-uninitialized HAS_MAYBE_UNINITIALIZED) - check_cxx_compiler_flag(-Wstrict-aliasing HAS_STRICT_ALIASING) - check_nvcc_compiler_flag(-Wstrict-aliasing NVCC_HAS_STRICT_ALIASING) - check_cxx_compiler_flag(-Wambiguous-reversed-operator HAS_AMBIGUOUS_REVERSED_OPERATOR) - check_cxx_compiler_flag(-Wdeprecated-anon-enum-enum-conversion HAS_DEPRECATED_ANON_ENUM_ENUM_CONVERSION) - check_cxx_compiler_flag(-Wundefined-var-template HAS_UNDEFINED_VAR_TEMPLATE) - check_cxx_compiler_flag(-Wformat-truncation HAS_FORMAT_TRUNCATION) - check_cxx_compiler_flag(-Wbitwise-instead-of-logical HAS_BITWISE_INSTEAD_OF_LOGICAL) - check_cxx_compiler_flag(-Wenum-constexpr-conversion HAS_ENUM_CONSTEXPR_CONVERSION) - check_cxx_compiler_flag(-Wdeprecated-builtins HAS_DEPRECATED_BUILTINS) check_function_exists(reallocarray HAS_REALLOCARRAY) if (HAS_TAUTOLOGICAL_POINTER_COMPARE) diff --git a/cmake/external/onnx_minimal.cmake b/cmake/external/onnx_minimal.cmake index cf9429c185..65ff3fb148 100644 --- a/cmake/external/onnx_minimal.cmake +++ b/cmake/external/onnx_minimal.cmake @@ -27,18 +27,6 @@ target_compile_definitions(onnx_proto PUBLIC $ super::D::E + // does not include leaf object (typically a struct type). + +- size_t i = 0; ++ // fix unused but set variable warning ++ //size_t i = 0; + std::stringstream stream; + + auto s = src->components.begin(); +@@ -417,7 +418,7 @@ class RustGenerator : public BaseGenerator { + if (*s != *d) { break; } + ++s; + ++d; +- ++i; ++ //++i; + } + + for (; s != src->components.end(); ++s) { stream << "super::"; } diff --git a/cmake/patches/flatbuffers/flatbuffers_cmake.patch b/cmake/patches/flatbuffers/flatbuffers_cmake.patch deleted file mode 100644 index 764c5240d4..0000000000 --- a/cmake/patches/flatbuffers/flatbuffers_cmake.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3987eac..5e5462f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -223,7 +223,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) - "${CMAKE_CXX_FLAGS} -std=c++0x") - endif(CYGWIN) - set(CMAKE_CXX_FLAGS -- "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow") -+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow -Wno-error=stringop-overflow") - set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast") - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.4) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) diff --git a/cmake/patches/onnx/onnx.patch b/cmake/patches/onnx/onnx.patch index d261a178c6..53d5484288 100644 --- a/cmake/patches/onnx/onnx.patch +++ b/cmake/patches/onnx/onnx.patch @@ -35,16 +35,23 @@ diff --git a/onnx/onnx_pb.h b/onnx/onnx_pb.h index 0aab3e26..0f859267 100644 --- a/onnx/onnx_pb.h +++ b/onnx/onnx_pb.h -@@ -47,10 +47,21 @@ +@@ -47,10 +47,28 @@ #define ONNX_API ONNX_IMPORT #endif -+// onnx/onnx-operators-ml.pb.h:1178:25: required from here -+// protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: error: unused parameter ‘prototype’ [-Werror=unused-parameter] +#if defined(__GNUC__) +#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wunused-parameter" ++ ++// In file included from onnx/onnx-ml.pb.h:30: ++// In file included from google/protobuf/extension_set.h:53: ++// google/protobuf/parse_context.h:328:47: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32] ++#if defined(__has_warning) ++#if __has_warning("-Wshorten-64-to-32") ++#pragma GCC diagnostic ignored "-Wshorten-64-to-32" +#endif ++#endif // defined(__has_warning) ++ ++#endif // defined(__GNUC__) + #ifdef ONNX_ML #include "onnx/onnx-ml.pb.h" diff --git a/onnxruntime/contrib_ops/cpu/transformers/beam_search_scorer.cc b/onnxruntime/contrib_ops/cpu/transformers/beam_search_scorer.cc index 402de05ebb..b24ced45b2 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/beam_search_scorer.cc +++ b/onnxruntime/contrib_ops/cpu/transformers/beam_search_scorer.cc @@ -4,6 +4,7 @@ #include #include #include "core/common/common.h" +#include "core/common/narrow.h" #include "core/common/safeint.h" #include "core/common/span_utils.h" #include "core/framework/allocator.h" @@ -208,7 +209,7 @@ void BeamSearchScorer::Finalize(ISequences& sequences, for (size_t beam_index = 0; beam_index < num_beams_; beam_index++) { size_t batch_beam_index = batch_index * num_beams_ + beam_index; float final_score = final_beam_scores[batch_beam_index]; - auto final_tokens = sequences.GetSequence(batch_beam_index); + auto final_tokens = sequences.GetSequence(narrow(batch_beam_index)); beam_hyp.Add(final_tokens, final_score); } } @@ -241,8 +242,8 @@ void BeamSearchScorer::Finalize(ISequences& sequences, } beam_hyp.Output( - num_return_sequences, - max_length_, + narrow(num_return_sequences), + narrow(max_length_), batch_output, batch_sequence_score); } diff --git a/onnxruntime/core/platform/posix/stacktrace.cc b/onnxruntime/core/platform/posix/stacktrace.cc index 76864b2697..8af418a88c 100644 --- a/onnxruntime/core/platform/posix/stacktrace.cc +++ b/onnxruntime/core/platform/posix/stacktrace.cc @@ -19,7 +19,7 @@ std::vector GetStackTrace() { void* array[kCallstackLimit]; char** strings = nullptr; - size_t size = backtrace(array, kCallstackLimit); + int size = backtrace(array, kCallstackLimit); stack.reserve(size); strings = backtrace_symbols(array, size); @@ -34,8 +34,8 @@ std::vector GetStackTrace() { // >addr2line -f -C -e /home/me/src/github/onnxruntime/build/Linux/Debug/onnxruntime_test_all +0x3f46cc // hide GetStackTrace so the output starts with the 'real' location - constexpr size_t start_frame = 1; - for (size_t i = start_frame; i < size; i++) { + constexpr int start_frame = 1; + for (int i = start_frame; i < size; i++) { stack.push_back(strings[i]); } diff --git a/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc b/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc index fe03f3360b..8590339257 100644 --- a/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc +++ b/onnxruntime/core/providers/coreml/builders/impl/activation_op_builder.cc @@ -75,7 +75,7 @@ Status AddPReluWeight(ModelBuilder& model_builder, const Node& node, auto& weight_values = *prelu.mutable_alpha()->mutable_floatvalue(); weight_values.Clear(); - weight_values.Resize(num_channels, value); + weight_values.Resize(narrow(num_channels), value); } return Status::OK(); } diff --git a/onnxruntime/core/providers/cpu/nn/dropout_op.h b/onnxruntime/core/providers/cpu/nn/dropout_op.h index 8d2f588054..7add3e7fa2 100644 --- a/onnxruntime/core/providers/cpu/nn/dropout_op.h +++ b/onnxruntime/core/providers/cpu/nn/dropout_op.h @@ -84,7 +84,7 @@ Status Dropout::Compute(OpKernelContext* context) const { // generate mask { RandomGenerator& generator = generator_ != nullptr ? *generator_.get() : RandomGenerator::Default(); - std::default_random_engine rng(generator.NextSeed()); + std::default_random_engine rng(gsl::narrow_cast(generator.NextSeed())); std::uniform_real_distribution dist{0.0f, 1.0f}; mask_arr = Eigen::ArrayX::NullaryExpr( mask_arr.size(), diff --git a/onnxruntime/core/providers/cpu/nn/string_normalizer.cc b/onnxruntime/core/providers/cpu/nn/string_normalizer.cc index dd2e6727a7..330b92d4a8 100644 --- a/onnxruntime/core/providers/cpu/nn/string_normalizer.cc +++ b/onnxruntime/core/providers/cpu/nn/string_normalizer.cc @@ -4,6 +4,7 @@ #include "string_normalizer.h" #include "core/common/common.h" #include "core/framework/tensor.h" +#include "onnxruntime_config.h" #ifdef _MSC_VER #include @@ -13,12 +14,22 @@ #else #include #include + #endif // _MSC_VER #include #include #include +#if defined(__GNUC__) +// Allow deprecated-declarations warning - std::wstring_convert is deprecated. +// TODO find a suitable replacement +// Note: GNU libiconv (e.g., on Apple platforms) is not suitable due to its LGPL license. +#if defined(HAS_DEPRECATED_DECLARATIONS) +#pragma GCC diagnostic warning "-Wdeprecated-declarations" +#endif // defined(HAS_DEPRECATED_DECLARATIONS) +#endif // defined(__GNUC__) + namespace onnxruntime { ONNX_CPU_OPERATOR_KERNEL( @@ -76,7 +87,7 @@ using Utf8Converter = std::wstring_convert>; const std::string default_locale("en-US"); -#else // MS_VER +#else // _MSC_VER class Locale { public: @@ -111,10 +122,12 @@ class Locale { }; #if defined(__APPLE__) || defined(__ANDROID__) + using Utf8Converter = std::wstring_convert>; + #else -// All others (Linux) +// All others (not Windows, Apple, or Android) class Utf8Converter { public: Utf8Converter(const std::string&, const std::wstring&) {} @@ -186,11 +199,11 @@ class Utf8Converter { } }; -#endif // __APPLE__ +#endif const std::string default_locale("en_US.UTF-8"); // All non-MS -#endif // MS_VER +#endif // _MSC_VER template Status CopyCaseAction(ForwardIter first, ForwardIter end, OpKernelContext* ctx, diff --git a/onnxruntime/core/providers/cpu/object_detection/non_max_suppression.cc b/onnxruntime/core/providers/cpu/object_detection/non_max_suppression.cc index a509032722..4a176b0726 100644 --- a/onnxruntime/core/providers/cpu/object_detection/non_max_suppression.cc +++ b/onnxruntime/core/providers/cpu/object_detection/non_max_suppression.cc @@ -12,9 +12,13 @@ limitations under the License. /* Modifications Copyright (c) Microsoft. */ #include "non_max_suppression.h" -#include "non_max_suppression_helper.h" + #include #include + +#include "core/common/narrow.h" +#include "non_max_suppression_helper.h" + // TODO:fix the warnings #ifdef _MSC_VER #pragma warning(disable : 4244) @@ -89,7 +93,7 @@ Status NonMaxSuppressionBase::PrepareCompute(OpKernelContext* ctx, PrepareContex pc.num_batches_ = boxes_dims[0]; pc.num_classes_ = scores_dims[1]; - pc.num_boxes_ = boxes_dims[1]; + pc.num_boxes_ = narrow(boxes_dims[1]); return Status::OK(); } diff --git a/onnxruntime/core/session/custom_ops.cc b/onnxruntime/core/session/custom_ops.cc index 390d9b35f2..1df91d528a 100644 --- a/onnxruntime/core/session/custom_ops.cc +++ b/onnxruntime/core/session/custom_ops.cc @@ -7,6 +7,7 @@ #include +#include "core/common/gsl.h" #include "core/framework/data_types.h" #include "core/framework/error_code_helper.h" #include "core/framework/onnxruntime_typeinfo.h" @@ -60,7 +61,7 @@ ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetOutputCount, _In_ const OrtKernelC ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetInput, _In_ const OrtKernelContext* context, _In_ size_t index, _Out_ const OrtValue** out) { API_IMPL_BEGIN - *out = reinterpret_cast(reinterpret_cast(context)->GetInputMLValue(index)); + *out = reinterpret_cast(reinterpret_cast(context)->GetInputMLValue(gsl::narrow_cast(index))); return nullptr; API_IMPL_END }; @@ -68,7 +69,7 @@ ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetInput, _In_ const OrtKernelContext ORT_API_STATUS_IMPL(OrtApis::KernelContext_GetOutput, _Inout_ OrtKernelContext* context, _In_ size_t index, _In_ const int64_t* dim_values, size_t dim_count, _Out_ OrtValue** out) { API_IMPL_BEGIN onnxruntime::TensorShape shape(dim_values, dim_count); - *out = reinterpret_cast(reinterpret_cast(context)->OutputMLValue(index, shape)); + *out = reinterpret_cast(reinterpret_cast(context)->OutputMLValue(gsl::narrow_cast(index), shape)); return nullptr; API_IMPL_END }; @@ -306,7 +307,7 @@ ORT_API_STATUS_IMPL(OrtApis::KernelInfoGetConstantInput_tensor, _In_ const OrtKe _Out_ int* is_constant, _Outptr_ const OrtValue** out) { API_IMPL_BEGIN const auto* op_info = reinterpret_cast(info); - *is_constant = static_cast(op_info->TryGetConstantInput(index, out)); + *is_constant = static_cast(op_info->TryGetConstantInput(gsl::narrow_cast(index), out)); return nullptr; API_IMPL_END }; @@ -433,7 +434,7 @@ KernelCreateInfo CreateKernelCreateInfo(const std::string& domain, const OrtCust // to work with newer versions (> 12) of the ORT binary. if (op->version > 12) { for (size_t i = 0; i < input_count; i++) { - def_builder.InputMemoryType(op->GetInputMemoryType(op, i), i); + def_builder.InputMemoryType(op->GetInputMemoryType(op, i), gsl::narrow_cast(i)); } } @@ -505,7 +506,7 @@ ONNX_NAMESPACE::OpSchema CreateSchema(const std::string& domain, const OrtCustom undefined++; } std::string input_name = "Input" + std::to_string(i); - schema.Input(i, input_name, "", input_name, option, is_homogeneous, min_arity); + schema.Input(gsl::narrow_cast(i), input_name, "", input_name, option, is_homogeneous, min_arity); // support all types as input here in schema, and handle the type inference in TypeShapeInference func schema.TypeConstraint(input_name, DataTypeImpl::ToString(DataTypeImpl::AllTensorTypes()), "all types"); } @@ -543,7 +544,7 @@ ONNX_NAMESPACE::OpSchema CreateSchema(const std::string& domain, const OrtCustom } } std::string output_name = "Output" + std::to_string(i); - schema.Output(i, output_name, "", output_name, option, is_homogeneous, min_arity); + schema.Output(gsl::narrow_cast(i), output_name, "", output_name, option, is_homogeneous, min_arity); // support all types as input here in schema, and handle the type inference in TypeShapeInference func schema.TypeConstraint(output_name, DataTypeImpl::ToString(DataTypeImpl::AllTensorTypes()), "all types"); } diff --git a/onnxruntime/test/contrib_ops/packed_attention_op_test.cc b/onnxruntime/test/contrib_ops/packed_attention_op_test.cc index 98792e9d20..dd9224df8f 100644 --- a/onnxruntime/test/contrib_ops/packed_attention_op_test.cc +++ b/onnxruntime/test/contrib_ops/packed_attention_op_test.cc @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#include "core/common/narrow.h" #include "core/platform/env_var_utils.h" #include "gtest/gtest.h" #include "test/common/tensor_op_test_utils.h" @@ -392,29 +393,29 @@ static void RunModelWithRandomInput( constexpr int hidden_size = 768; constexpr int num_heads = 12; - int token_count = 0; + int64_t token_count = 0; std::vector cum_seq_len(batch_size + 1); cum_seq_len[0] = 0; - int original_offset = 0; - int token_offset_idx = 0; + int64_t original_offset = 0; + int64_t token_offset_idx = 0; std::vector token_offset(batch_size * sequence_length); - for (int b = 0; b < batch_size; b++) { - int actual_seq_len = (sequence_length / (b + 1)); + for (int64_t b = 0; b < batch_size; b++) { + int64_t actual_seq_len = (sequence_length / (b + 1)); token_count += actual_seq_len; - cum_seq_len[b + 1] = token_count; + cum_seq_len[b + 1] = narrow(token_count); original_offset = b * sequence_length; - for (int s = 0; s < actual_seq_len; s++) { - token_offset[token_offset_idx++] = original_offset++; + for (int64_t s = 0; s < actual_seq_len; s++) { + token_offset[token_offset_idx++] = narrow(original_offset++); } } - for (int b = 0; b < batch_size; b++) { - int actual_seq_len = (sequence_length / (b + 1)); + for (int64_t b = 0; b < batch_size; b++) { + int64_t actual_seq_len = (sequence_length / (b + 1)); original_offset = b * sequence_length + actual_seq_len; - for (int s = actual_seq_len; s < sequence_length; s++) { - token_offset[token_offset_idx++] = original_offset++; + for (int64_t s = actual_seq_len; s < sequence_length; s++) { + token_offset[token_offset_idx++] = narrow(original_offset++); } } diff --git a/onnxruntime/test/optimizer/graph_transform_test_builder.cc b/onnxruntime/test/optimizer/graph_transform_test_builder.cc index 32edbaf507..c98dc78998 100644 --- a/onnxruntime/test/optimizer/graph_transform_test_builder.cc +++ b/onnxruntime/test/optimizer/graph_transform_test_builder.cc @@ -21,7 +21,7 @@ void TransformerTester(const std::function& buil const std::function& check_transformed_graph, TransformerLevel baseline_level, TransformerLevel target_level, - const std::vector& opset_versions, + const std::vector& opset_versions, double per_sample_tolerance, double relative_per_sample_tolerance, std::unique_ptr transformer, @@ -127,13 +127,13 @@ Status TestGraphTransformer(const std::function& const logging::Logger& logger, std::unique_ptr transformer, TransformerLevel level, unsigned steps, const std::function& pre_graph_checker, const std::function& post_graph_checker) { - const std::vector opset_versions{opset_version}; + const std::vector opset_versions{opset_version}; return TestGraphTransformer(build_test_case, opset_versions, logger, std::move(transformer), level, steps, pre_graph_checker, post_graph_checker); } Status TestGraphTransformer(const std::function& build_test_case, - const std::vector& opset_versions, + const std::vector& opset_versions, const logging::Logger& logger, std::unique_ptr transformer, TransformerLevel level, unsigned steps, const std::function& pre_graph_checker, const std::function& post_graph_checker) { diff --git a/onnxruntime/test/optimizer/graph_transform_test_builder.h b/onnxruntime/test/optimizer/graph_transform_test_builder.h index dcec5ad282..2d0d5d8623 100644 --- a/onnxruntime/test/optimizer/graph_transform_test_builder.h +++ b/onnxruntime/test/optimizer/graph_transform_test_builder.h @@ -417,7 +417,7 @@ void TransformerTester(const std::function& buil const std::function& check_transformed_graph, TransformerLevel baseline_level, TransformerLevel target_level, - const std::vector& opset_versions, + const std::vector& opset_versions, double per_sample_tolerance = 0.0, double relative_per_sample_tolerance = 0.0, std::unique_ptr transformer = nullptr, // must be null in this case. @@ -454,7 +454,7 @@ Status TestGraphTransformer(const std::function& * @param post_graph_checker The graph checker function after applying the transformer */ Status TestGraphTransformer(const std::function& build_test_case, - const std::vector& opset_versions, + const std::vector& opset_versions, const logging::Logger& logger, std::unique_ptr transformer, TransformerLevel level, unsigned steps, const std::function& pre_graph_checker, const std::function& post_graph_checker); diff --git a/onnxruntime/test/optimizer/qdq_transformer_test.cc b/onnxruntime/test/optimizer/qdq_transformer_test.cc index 92762f0212..7f290927c4 100644 --- a/onnxruntime/test/optimizer/qdq_transformer_test.cc +++ b/onnxruntime/test/optimizer/qdq_transformer_test.cc @@ -2170,7 +2170,7 @@ TEST(QDQTransformerTests, Clip) { epsilon); }; - std::vector opsets{12, 18, 19}; + std::vector opsets{12, 18, 19}; for (auto opset : opsets) { test_case(.0235294122248888f, static_cast(-128), 0, opset); // [0, 6] test_case(.02f, static_cast(-128), 0, opset); // [0, 5.1] diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 9802126db6..ec057fa483 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1669,6 +1669,11 @@ def run_android_tests(args, source_dir, build_dir, config, cwd): def run_ios_tests(args, source_dir, config, cwd): + simulator_device_name = subprocess.check_output( + ["bash", os.path.join(source_dir, "tools", "ci_build", "github", "apple", "get_simulator_device_name.sh")], + text=True, + ).strip() + xc_test_schemes = [ "onnxruntime_test_all_xc", ] @@ -1691,7 +1696,7 @@ def run_ios_tests(args, source_dir, config, cwd): "-scheme", xc_test_scheme, "-destination", - "platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)", + f"platform=iOS Simulator,OS=latest,name={simulator_device_name}", ], cwd=cwd, ) diff --git a/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json b/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json index 9a18e3bf9a..fd07074209 100644 --- a/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json +++ b/tools/ci_build/github/apple/default_full_ios_framework_build_settings.json @@ -16,7 +16,7 @@ "--use_coreml", "--skip_tests", "--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF", - "--apple_deploy_target=11.0", + "--apple_deploy_target=12.0", "--use_xnnpack" ] } diff --git a/tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json b/tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json index afcee196ac..2738a7ca7b 100644 --- a/tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json +++ b/tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json @@ -21,6 +21,6 @@ "--use_coreml", "--skip_tests", "--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF", - "--apple_deploy_target=11.0" + "--apple_deploy_target=12.0" ] } diff --git a/tools/ci_build/github/apple/get_simulator_device_name.sh b/tools/ci_build/github/apple/get_simulator_device_name.sh new file mode 100755 index 0000000000..0a0f416c77 --- /dev/null +++ b/tools/ci_build/github/apple/get_simulator_device_name.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +# Get a suitable simulator device type name. +# This picks one with name containing "iPhone" with the largest minRuntimeVersion value. +xcrun simctl list devicetypes "iPhone" --json | \ + jq --raw-output '.devicetypes | max_by(.minRuntimeVersion) | .name' diff --git a/tools/ci_build/github/apple/test_ios_packages.py b/tools/ci_build/github/apple/test_ios_packages.py index 814307ab76..661b65f043 100644 --- a/tools/ci_build/github/apple/test_ios_packages.py +++ b/tools/ci_build/github/apple/test_ios_packages.py @@ -114,6 +114,11 @@ def _test_ios_packages(args): # run the tests if not args.prepare_test_project_only: + simulator_device_name = subprocess.check_output( + ["bash", str(REPO_DIR / "tools" / "ci_build" / "github" / "apple" / "get_simulator_device_name.sh")], + text=True, + ).strip() + subprocess.run( [ "xcrun", @@ -124,7 +129,7 @@ def _test_ios_packages(args): "-scheme", "ios_package_test", "-destination", - "platform=iOS Simulator,OS=latest,name=iPhone SE (2nd generation)", + f"platform=iOS Simulator,OS=latest,name={simulator_device_name}", ], shell=False, check=True, diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index ed2ee19133..e0821d3734 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -192,6 +192,8 @@ stages: jobs: - job: Test_CPU_EP pool: + # We need macOS-12 to run the Android emulator for now. + # https://github.com/actions/runner-images/issues/7671 vmImage: 'macOS-12' workspace: clean: all @@ -261,6 +263,8 @@ stages: - job: Test_NNAPI_EP pool: + # We need macOS-12 to run the Android emulator for now. + # https://github.com/actions/runner-images/issues/7671 vmImage: 'macOS-12' timeoutInMinutes: 90 workspace: @@ -354,6 +358,8 @@ stages: jobs: - job: NNAPI_EP_MASTER pool: + # We need macOS-12 to run the Android emulator for now. + # https://github.com/actions/runner-images/issues/7671 vmImage: 'macOS-12' timeoutInMinutes: 180 workspace: diff --git a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml index a359bbd834..4477809a8f 100644 --- a/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-coreml-ci-pipeline.yml @@ -3,7 +3,7 @@ jobs: workspace: clean: all pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' variables: MACOSX_DEPLOYMENT_TARGET: '10.14' TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] @@ -13,6 +13,8 @@ jobs: - script: brew install coreutils ninja displayName: Install coreutils and ninja + - template: templates/use-xcode-version.yml + - template: templates/mac-build-step-with-cache.yml parameters: WithCache: true @@ -21,6 +23,7 @@ jobs: CacheDir: $(CCACHE_DIR) BuildStep: - script: | + set -e python3 tools/ci_build/build.py \ --build_dir build \ --skip_submodule_sync \ diff --git a/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml index 7aaa713d8e..f228dab1eb 100644 --- a/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-ios-ci-pipeline.yml @@ -3,7 +3,6 @@ jobs: pool: vmImage: 'macOS-12' variables: - MACOSX_DEPLOYMENT_TARGET: '10.14' PROTO_CACHE_DIR: $(Pipeline.Workspace)/proto_ccache ORT_CACHE_DIR: $(Pipeline.Workspace)/ort_ccache TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] @@ -24,6 +23,14 @@ jobs: env: CCACHE_DIR: $(PROTO_CACHE_DIR) + - template: templates/use-xcode-version.yml + # TODO figure out XNNPACK EP test failures + # Failing tests: + # -[XnnpackEP TestConvTranspose_qdq] + # -[XnnpackEP TestQDQConvS8S8_per_channel] + parameters: + xcodeVersion: "13.1" + - template: templates/mac-build-step-with-cache.yml parameters: WithCache: true @@ -33,7 +40,6 @@ jobs: ChangeEveryCommit: true BuildStep: - script: | - sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer python3 $(Build.SourcesDirectory)/tools/ci_build/build.py \ --skip_submodule_sync \ --build_dir $(Build.BinariesDirectory)/iOS \ @@ -43,7 +49,7 @@ jobs: --ios \ --ios_sysroot iphonesimulator \ --osx_arch x86_64 \ - --apple_deploy_target 11.0 \ + --apple_deploy_target 12.0 \ --use_xcode \ --config RelWithDebInfo \ --build_apple_framework \ diff --git a/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml index ddb1b06bd0..d750918086 100644 --- a/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml @@ -19,7 +19,10 @@ jobs: displayName: "iOS Packaging" pool: - vmImage: "macOS-12" + vmImage: "macOS-13" + + variables: + xcodeVersion: "14.3" timeoutInMinutes: 300 @@ -44,6 +47,12 @@ jobs: addToPath: true architecture: "x64" + - template: templates/use-xcode-version.yml + parameters: + xcodeVersion: ${{ variables.xcodeVersion }} + + - template: templates/install-appcenter.yml + - script: | pip install -r tools/ci_build/github/apple/ios_packaging.requirements.txt displayName: "Install Python requirements" @@ -115,11 +124,13 @@ jobs: xcWorkspacePath: '$(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/ios_package_test.xcworkspace' sdk: 'iphoneos' scheme: 'ios_package_test' + xcodeVersion: 'specifyPath' + xcodeDeveloperDir: '/Applications/Xcode_${{ variables.xcodeVersion }}.app/Contents/Developer' signingOption: 'manual' signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)' provisioningProfileName: 'iOS Team Provisioning Profile' args: '-derivedDataPath $(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/DerivedData' - workingDirectory: $(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/ + workingDirectory: '$(Build.BinariesDirectory)/app_center_test_mobile/ios_package_test/' displayName: '[Mobile] Build iphone arm64 tests' - script: | diff --git a/tools/ci_build/github/azure-pipelines/mac-objc-static-analysis-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-objc-static-analysis-ci-pipeline.yml index 3fffec6159..e5c0583a3d 100644 --- a/tools/ci_build/github/azure-pipelines/mac-objc-static-analysis-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-objc-static-analysis-ci-pipeline.yml @@ -2,7 +2,7 @@ jobs: - job: ObjCStaticAnalysis pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' timeoutInMinutes: 30 diff --git a/tools/ci_build/github/azure-pipelines/nodejs/templates/test_macos.yml b/tools/ci_build/github/azure-pipelines/nodejs/templates/test_macos.yml index 467b5a59f8..871d7894e5 100644 --- a/tools/ci_build/github/azure-pipelines/nodejs/templates/test_macos.yml +++ b/tools/ci_build/github/azure-pipelines/nodejs/templates/test_macos.yml @@ -11,7 +11,7 @@ stages: clean: all timeoutInMinutes: 120 pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' variables: - name: OnnxRuntimeBuildDirectory diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_macos.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_macos.yml index 2e4dfa2d43..de0520b975 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_macos.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_macos.yml @@ -11,7 +11,7 @@ stages: workspace: clean: all pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' variables: - name: OnnxRuntimeBuildDirectory diff --git a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml index 4ee221fb6f..c684e08ba1 100644 --- a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml @@ -29,7 +29,7 @@ stages: parameters: job_name: Test_MAC_Wheels machine_pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' itemPattern: '*/*mac*x86_64.whl' - template: templates/py-package-smoking-test.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar-test.yml b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar-test.yml index 70385875a7..a3d9902d29 100644 --- a/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar-test.yml +++ b/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar-test.yml @@ -20,6 +20,8 @@ jobs: workspace: clean: all pool: + # We need macOS-12 to run the Android emulator for now. + # https://github.com/actions/runner-images/issues/7671 vmImage: 'macOS-12' variables: - name: runCodesignValidationInjection @@ -46,6 +48,8 @@ jobs: - template: use-android-ndk.yml + - template: install-appcenter.yml + - script: | python3 $(Build.SourcesDirectory)/tools/python/run_android_emulator.py \ --android-sdk-root ${ANDROID_SDK_ROOT} \ diff --git a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml index e81c152ea5..511300cb41 100644 --- a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml @@ -98,7 +98,7 @@ stages: workspace: clean: all pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' timeoutInMinutes: 300 steps: - template: set-version-number-variables-step.yml @@ -788,7 +788,7 @@ stages: - template: ../nuget/templates/test_macos.yml parameters: - AgentPool : macOS-12 + AgentPool : macOS-13 ArtifactSuffix: 'CPU' - template: ../nodejs/templates/test_win.yml @@ -896,7 +896,7 @@ stages: workspace: clean: all pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' variables: - name: runCodesignValidationInjection value: false @@ -911,6 +911,8 @@ stages: artifactName: 'onnxruntime-java' targetPath: '$(Build.BinariesDirectory)/final-jar' + - template: use-xcode-version.yml + - task: CmdLine@2 inputs: script: | @@ -922,7 +924,6 @@ stages: popd wget https://oss.sonatype.org/service/local/repositories/releases/content/org/junit/platform/junit-platform-console-standalone/1.6.2/junit-platform-console-standalone-1.6.2.jar -P ./ wget https://oss.sonatype.org/service/local/repositories/releases/content/com/google/protobuf/protobuf-java/3.21.7/protobuf-java-3.21.7.jar -P ./ - sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer DYLD_LIBRARY_PATH=./test:${DYLD_LIBRARY_PATH} java -jar ./junit-platform-console-standalone-1.6.2.jar -cp .:./test:./protobuf-java-3.21.7.jar:./onnxruntime-$(OnnxRuntimeVersion).jar --scan-class-path --fail-if-no-tests --disable-banner workingDirectory: '$(Build.BinariesDirectory)/final-jar' diff --git a/tools/ci_build/github/azure-pipelines/templates/install-appcenter.yml b/tools/ci_build/github/azure-pipelines/templates/install-appcenter.yml new file mode 100644 index 0000000000..51be73d4c6 --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/templates/install-appcenter.yml @@ -0,0 +1,12 @@ +# Install appcenter CLI + +parameters: +- name: appcenterVersion + type: string + default: "2.13.7" + +steps: +- bash: | + set -e -x + npm install -g appcenter-cli@${{ parameters.appcenterVersion }} + displayName: Install appcenter CLI ${{ parameters.appcenterVersion }} diff --git a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml index 803cf2ef30..790f5afb0d 100644 --- a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packaging-pipeline.yml @@ -51,7 +51,7 @@ stages: - MacOS_C_API_Packaging_CPU_arm64 - MacOS_C_API_Packaging_CPU_universal2 pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' steps: - task: DownloadPipelineArtifact@2 inputs: @@ -83,7 +83,7 @@ stages: - job: MacOS_C_API_Package_Publish_x86_64 dependsOn: MacOS_C_API_Packaging_CPU_x86_64 pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' steps: - task: DownloadPipelineArtifact@2 inputs: @@ -96,4 +96,4 @@ stages: condition: 'succeededOrFailed()' - template: component-governance-component-detection-steps.yml parameters: - condition: 'succeeded' \ No newline at end of file + condition: 'succeeded' diff --git a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml index e4de00f2fc..4cd039b0dc 100644 --- a/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml +++ b/tools/ci_build/github/azure-pipelines/templates/mac-cpu-packing-jobs.yml @@ -37,7 +37,7 @@ jobs: PROTO_CACHE_DIR: $(Pipeline.Workspace)/ccache_proto ORT_CACHE_DIR: $(Pipeline.Workspace)/ccache_ort pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' timeoutInMinutes: 300 steps: - checkout: self @@ -55,6 +55,8 @@ jobs: - template: set-version-number-variables-step.yml + - template: use-xcode-version.yml + - template: mac-build-step-with-cache.yml parameters: WithCache: ${{ parameters.WithCache }} @@ -72,7 +74,6 @@ jobs: export ONNX_ML=1 export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF" python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt' - sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer displayName: 'Install dependencies' env: CCACHE_DIR: $(PROTO_CACHE_DIR) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 9b9f1282f2..6e372e02c5 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -339,7 +339,7 @@ stages: workspace: clean: all pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' variables: MACOSX_DEPLOYMENT_TARGET: '10.15' strategy: @@ -362,6 +362,8 @@ stages: inputs: versionSpec: $(PythonVersion) + - template: use-xcode-version.yml + - script: | set -e -x pushd . @@ -375,7 +377,6 @@ stages: export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF" export _PYTHON_HOST_PLATFORM=macosx-${{variables.MACOSX_DEPLOYMENT_TARGET}}-x86_64 python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt' - sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --config Release --skip_onnx_tests --build_wheel ${{ parameters.build_py_parameters }} displayName: 'Command Line Script' @@ -401,7 +402,7 @@ stages: workspace: clean: all pool: - vmImage: 'macOS-12' + vmImage: 'macOS-13' variables: MACOSX_DEPLOYMENT_TARGET: '11.0' strategy: @@ -432,6 +433,8 @@ stages: system_profiler SPSoftwareDataType SPHardwareDataType displayName: 'Mac machine info' + - template: use-xcode-version.yml + # Don't remove _PYTHON_HOST_PLATFORM, it's used to generate correct package name # Setting _PYTHON_HOST_PLATFORM overwrites the value return by get_platform() # Ref: https://wiki.debian.org/Python/MultiArch @@ -448,7 +451,6 @@ stages: export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF" export _PYTHON_HOST_PLATFORM=macosx-${{variables.MACOSX_DEPLOYMENT_TARGET}}-arm64 python3 -m pip install -r '$(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/requirements.txt' - sudo xcode-select --switch /Applications/Xcode_13.1.app/Contents/Developer python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --config Release --skip_tests --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=arm64 --build_wheel ${{ parameters.build_py_parameters }} displayName: 'Command Line Script' diff --git a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml index 972231ce99..e5e82e3a7d 100644 --- a/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/react-native-ci.yml @@ -50,6 +50,8 @@ stages: jobs: - job: ReactNative_CI pool: + # We need macOS-12 to run the Android emulator for now. + # https://github.com/actions/runner-images/issues/7671 vmImage: 'macOS-12' variables: runCodesignValidationInjection: false @@ -68,14 +70,14 @@ stages: versionSpec: "3.9" addToPath: true rchitecture: "x64" - + - task: JavaToolInstaller@0 displayName: Use jdk 11 inputs: versionSpec: '11' jdkArchitectureOption: 'x64' jdkSourceOption: 'PreInstalled' - + - task: NodeTool@0 inputs: versionSpec: '16.x' @@ -130,7 +132,7 @@ stages: --variant Full \ --build-settings-file $(Build.SourcesDirectory)/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json \ -b="--path_to_protoc_exe" -b "$(Build.BinariesDirectory)/installed/bin/protoc" - + # Mobile build: # python $(Build.SourcesDirectory)/tools/ci_build/github/apple/build_and_assemble_ios_pods.py \ # --build_dir $(Build.BinariesDirectory)/ios_framework_mobile \ @@ -167,7 +169,7 @@ stages: contents: onnxruntime-android-*.aar targetFolder: $(Build.SourcesDirectory)/js/react_native/android/libs displayName: Copy Android package to React Native directory - + - script: | npm ci workingDirectory: '$(Build.SourcesDirectory)/js' @@ -295,13 +297,13 @@ stages: detox build --configuration android.emu.release workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' displayName: Build React Native Detox Android e2e Tests - + - script: | JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/android-test-results.xml \ detox test --record-logs all --configuration android.emu.release workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' displayName: Run React Native Detox Android e2e Tests - + - task: PublishTestResults@2 inputs: testResultsFiles: '$(Build.SourcesDirectory)/js/react_native/e2e/android-test-results.xml' @@ -309,12 +311,12 @@ stages: testRunTitle: 'React Native Detox Android e2e Test Results' condition: succeededOrFailed() displayName: Publish React Native Detox Android e2e Test Results - + - script: | detox build --configuration ios.sim.release workingDirectory: '$(Build.SourcesDirectory)/js/react_native/e2e' displayName: Build React Native Detox iOS e2e Tests - + - script: | JEST_JUNIT_OUTPUT_FILE=$(Build.SourcesDirectory)/js/react_native/e2e/ios-test-results.xml \ detox test --record-logs all --configuration ios.sim.release diff --git a/tools/ci_build/github/azure-pipelines/templates/use-xcode-version.yml b/tools/ci_build/github/azure-pipelines/templates/use-xcode-version.yml new file mode 100644 index 0000000000..7d767b4f4f --- /dev/null +++ b/tools/ci_build/github/azure-pipelines/templates/use-xcode-version.yml @@ -0,0 +1,14 @@ +# Specify use of a specific Xcode version. + +parameters: +- name: xcodeVersion + type: string + default: "14.3" + +steps: +- bash: | + set -e -x + XCODE_DEVELOPER_DIR="/Applications/Xcode_${{ parameters.xcodeVersion }}.app/Contents/Developer" + sudo xcode-select --switch "${XCODE_DEVELOPER_DIR}" + + displayName: Use Xcode ${{ parameters.xcodeVersion }} diff --git a/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json b/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json index 88d10b5f56..d15326de41 100644 --- a/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json +++ b/tools/ci_build/github/js/react_native_e2e_full_ios_framework_build_settings.json @@ -11,6 +11,6 @@ "--build_apple_framework", "--use_coreml", "--skip_tests", - "--apple_deploy_target=11.0" + "--apple_deploy_target=12.0" ] } diff --git a/tools/ci_build/github/js/react_native_e2e_mobile_ios_framework_build_settings.json b/tools/ci_build/github/js/react_native_e2e_mobile_ios_framework_build_settings.json index c2f1519ac0..e733885399 100644 --- a/tools/ci_build/github/js/react_native_e2e_mobile_ios_framework_build_settings.json +++ b/tools/ci_build/github/js/react_native_e2e_mobile_ios_framework_build_settings.json @@ -16,6 +16,6 @@ "--enable_reduced_operator_type_support", "--use_coreml", "--skip_tests", - "--apple_deploy_target=11.0" + "--apple_deploy_target=12.0" ] }