Skip to content

Commit

Permalink
Create release v0.6.1-rc.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
abi-git-user committed Oct 28, 2024
1 parent 8ce9ac6 commit ff4070c
Show file tree
Hide file tree
Showing 202 changed files with 480 additions and 347 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/deploy-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ jobs:
CIBW_TEST_SKIP: "*_arm64"
CIBW_BEFORE_ALL_LINUX: yum install -y libxml2-devel || (apk add libxml2-dev && rm /usr/lib/cmake/libxml2/libxml2-config.cmake)
CIBW_BEFORE_ALL_WINDOWS: cd src/bindings/python && cmake -S wheel_dependencies -B build-wheel_dependencies -G Ninja && cd build-wheel_dependencies && ninja
CIBW_ENVIRONMENT: LIBCELLML_VERSION_TAG=${{ steps.setup.outputs.tag }}
CIBW_ENVIRONMENT_MACOS: >
CIBW_ENVIRONMENT: >
LIBCELLML_VERSION_TAG=${{ steps.setup.outputs.tag }}
MACOSX_DEPLOYMENT_TARGET=${{ steps.setup.outputs.macos_deployment_target }}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
CIBW_BEFORE_BUILD_LINUX: pip install renamewheel
Expand All @@ -364,14 +364,14 @@ jobs:

- name: Publish Python wheels
if: needs.setup-jobs.outputs.binaries-destination == 'Publish'
shell: bash
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine
twine upload --skip-existing ./wheelhouse/*.whl
name: pypi
url: https://pypi.org/p/libcellml
permissions:
id-token: write
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./wheelhouse/

emscripten:
needs: setup-jobs
Expand Down Expand Up @@ -446,9 +446,7 @@ jobs:

- name: Publish libcellml.js
if: needs.setup-jobs.outputs.binaries-destination == 'Publish'
shell: bash
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
cd build-libcellml-release/src/bindings/javascript
npm publish --access public
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: build-libcellml-release/src/bindings/javascript
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "Minimum OS X deployment vers

set(PROJECT_NAME libCellML)
set(PROJECT_URL https://libcellml.org)
set(_PROJECT_VERSION 0.6.0)
set(PROJECT_DEVELOPER_VERSION )
set(_PROJECT_VERSION 0.6.1)
set(PROJECT_DEVELOPER_VERSION -rc.1)
project(${PROJECT_NAME} VERSION ${_PROJECT_VERSION} LANGUAGES CXX)

# Set policies that affect the build.
Expand Down
88 changes: 88 additions & 0 deletions cmake/TestLibXml2ConstErrorStructuredErrorCallback.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Function: Test_LibXml2_Const_Error_Structured_Error_Callback
#
# Test if LibXml2 uses const Error * for structured error callback function.
#
# CONST_ERROR_STRUCTURED_ERROR_CALLBACK - true if const Error * is required
# for structuredErrorCallback.
#

function(Test_LibXml2_Const_Error_Structured_Error_Callback)
set(_VAR_NAME "CONST_ERROR_STRUCTURED_ERROR_CALLBACK")
set(_HASH_VAR_NAME "HASH_${_VAR_NAME}")

# Hash the CMAKE_FLAGS passed and check cache to know if we need to rerun.
string(MD5 _CMAKE_FLAGS_HASH "${CMAKE_SHARED_LINKER_FLAGS}")

if(NOT DEFINED "${_HASH_VAR_NAME}")
unset("${_VAR_NAME}" CACHE)
elseif(NOT "${${_HASH_VAR_NAME}}" STREQUAL "${_CMAKE_FLAGS_HASH}")
unset("${_VAR_NAME}" CACHE)
endif()

if(NOT DEFINED "${_VAR_NAME}")
message(STATUS "Performing Test ${_VAR_NAME} - ...")
set(_TEST_PROJECT_DIR "${PROJECT_BINARY_DIR}/CMakeTmp/${_VAR_NAME}")

file(WRITE "${_TEST_PROJECT_DIR}/CMakeLists.txt"
"
cmake_minimum_required(VERSION 3.18.0)
project(undefined CXX)
add_library(foo SHARED \"foo.cpp\")
")
if(HAVE_LIBXML2_CONFIG)
file(APPEND "${_TEST_PROJECT_DIR}/CMakeLists.txt"
"
set(LibXml2_DIR \"${LibXml2_DIR}\")
find_package(LibXml2 CONFIG)
target_link_libraries(foo PUBLIC ${LIBXML2_TARGET_NAME})
")
else()
file(APPEND "${_TEST_PROJECT_DIR}/CMakeLists.txt"
"
find_package(LibXml2)
target_include_directories(foo PUBLIC ${LIBXML2_INCLUDE_DIR})
target_link_libraries(foo PUBLIC ${LIBXML2_LIBRARIES})
target_compile_definitions(foo PUBLIC ${LIBXML2_DEFINITIONS})
")
endif()

file(WRITE "${_TEST_PROJECT_DIR}/foo.cpp"
"
#include <libxml/tree.h>
#include <libxml/xmlerror.h>
void structuredErrorCallback(void *userData, const xmlError *error)
{
}
void function()
{
xmlInitParser();
xmlParserCtxtPtr context = xmlNewParserCtxt();
xmlSetStructuredErrorFunc(context, structuredErrorCallback);
xmlFreeParserCtxt(context);
xmlSetStructuredErrorFunc(nullptr, nullptr);
xmlCleanupParser();
}
")

try_compile(${_VAR_NAME}
"${_TEST_PROJECT_DIR}"
"${_TEST_PROJECT_DIR}"
undefined
CMAKE_FLAGS
"-DCMAKE_SHARED_LINKER_FLAGS='${CMAKE_SHARED_LINKER_FLAGS}'"
OUTPUT_VARIABLE _OUTPUT)

set(${_HASH_VAR_NAME} "${_CMAKE_FLAGS_HASH}" CACHE INTERNAL "Hashed try_compile flags.")

if(${_VAR_NAME})
message(STATUS "Performing Test ${_VAR_NAME} - Success")
else()
message(STATUS "Performing Test ${_VAR_NAME} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Test ${_VAR_NAME} failed with the following output:\n"
"${_OUTPUT}\n")
endif()
endif()
endfunction()
25 changes: 12 additions & 13 deletions cmake/TestUndefinedSymbolsAllowed.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@
# Test if the linker allows undefined symbols for shared libraries.
#
# UNDEFINED_SYMBOLS_ALLOWED - true if the linker will allow
# undefined symbols for shared libraries
# undefined symbols for shared libraries.
#

function(Test_Undefined_Symbols_Allowed)

set(_VAR_NAME "UNDEFINED_SYMBOLS_ALLOWED")
set(_HASH_VAR_NAME "HASH_${_VAR_NAME}")

# hash the CMAKE_FLAGS passed and check cache to know if we need to rerun
string(MD5 cmake_flags_hash "${CMAKE_SHARED_LINKER_FLAGS}")
# Hash the CMAKE_FLAGS passed and check cache to know if we need to rerun.
string(MD5 _CMAKE_FLAGS_HASH "${CMAKE_SHARED_LINKER_FLAGS}")

if(NOT DEFINED "${_HASH_VAR_NAME}")
unset("${_VAR_NAME}" CACHE)
elseif(NOT "${${_HASH_VAR_NAME}}" STREQUAL "${cmake_flags_hash}")
elseif(NOT "${${_HASH_VAR_NAME}}" STREQUAL "${_CMAKE_FLAGS_HASH}")
unset("${_VAR_NAME}" CACHE)
endif()

if(NOT DEFINED "${_VAR_NAME}")
message(STATUS "Performing Test ${_VAR_NAME} - ...")
set(test_project_dir "${PROJECT_BINARY_DIR}/CMakeTmp/${_VAR_NAME}")
set(_TEST_PROJECT_DIR "${PROJECT_BINARY_DIR}/CMakeTmp/${_VAR_NAME}")

file(WRITE "${test_project_dir}/CMakeLists.txt"
file(WRITE "${_TEST_PROJECT_DIR}/CMakeLists.txt"
"
cmake_minimum_required(VERSION 3.18.0)
project(undefined CXX)
add_library(foo SHARED \"foo.cpp\")
")

file(WRITE "${test_project_dir}/foo.cpp"
file(WRITE "${_TEST_PROJECT_DIR}/foo.cpp"
"
extern int bar(void);
int foo(void) {return bar()+1;}
Expand All @@ -44,23 +43,23 @@ int foo(void) {return bar()+1;}
endif()

try_compile(${_VAR_NAME}
"${test_project_dir}"
"${test_project_dir}"
"${_TEST_PROJECT_DIR}"
"${_TEST_PROJECT_DIR}"
undefined
CMAKE_FLAGS
"-DCMAKE_SHARED_LINKER_FLAGS='${CMAKE_SHARED_LINKER_FLAGS}'"
${_rpath_arg}
OUTPUT_ _VAR_NAME output)
OUTPUT_VARIABLE _OUTPUT)

set(${_HASH_VAR_NAME} "${cmake_flags_hash}" CACHE INTERNAL "hashed try_compile flags")
set(${_HASH_VAR_NAME} "${_CMAKE_FLAGS_HASH}" CACHE INTERNAL "hashed try_compile flags")

if(${_VAR_NAME})
message(STATUS "Performing Test ${_VAR_NAME} - Success")
else()
message(STATUS "Performing Test ${_VAR_NAME} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Test ${_VAR_NAME} failed with the following output:\n"
"${OUTPUT}\n")
"${_OUTPUT}\n")
endif()
endif()
endfunction()
25 changes: 25 additions & 0 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

include(CheckCXXCompilerFlag)
include(TestUndefinedSymbolsAllowed)
include(TestLibXml2ConstErrorStructuredErrorCallback)

get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)

Expand Down Expand Up @@ -130,6 +131,7 @@ if(LibXml2_FOUND)
endif()
else()
find_package(ZLIB REQUIRED)
set(_ZLIB_FIND_REPORTED TRUE CACHE INTERNAL "Flag for reporting on what ZLIB was found.")
endif()
endif()
set(HAVE_LIBXML2_CONFIG TRUE)
Expand All @@ -154,18 +156,33 @@ if(LibXml2_FOUND)
endforeach()
else()
find_package(LibXml2 REQUIRED)
set(_LibXml2_FIND_REPORTED TRUE CACHE INTERNAL "Flag for reporting on what LibXml2 was found.")
if(TARGET z)
set(HAVE_ZLIB_TARGET TRUE)
get_target_property(ZLIB_TARGET_TYPE z TYPE)
else()
find_package(ZLIB REQUIRED)
set(_ZLIB_FIND_REPORTED TRUE CACHE INTERNAL "Flag for reporting on what ZLIB was found.")
endif()
if(LibXml2_FOUND)
# Clear out GUI variable created in config search mode.
unset(LibXml2_DIR CACHE)
endif()
endif()

if(NOT DEFINED _LibXml2_FIND_REPORTED)
set(_LibXml2_FIND_REPORTED TRUE CACHE INTERNAL "Flag for reporting on what LibXml2 was found.")
message(STATUS "Found LibXml2: ${LIBXML2_LIBRARIES} (found version \"${LIBXML2_VERSION_STRING}\").")
endif()

if(NOT DEFINED _ZLIB_FIND_REPORTED)
set(_ZLIB_FIND_REPORTED TRUE CACHE INTERNAL "Flag for reporting on what ZLIB was found.")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.26)
set(ZLIB_VERSION_STRING ${ZLIB_VERSION})
endif()
message(STATUS "Found ZLIB: ${ZLIB_LIBRARIES} (found version \"${ZLIB_VERSION_STRING}\").")
endif()

if(BUILDCACHE_EXE OR CLCACHE_EXE OR CCACHE_EXE)
set(COMPILER_CACHE_AVAILABLE TRUE CACHE INTERNAL "Executable required to cache compilations.")
endif()
Expand Down Expand Up @@ -238,3 +255,11 @@ endif()
if(EMSCRIPTEN AND NODE_EXE AND NPM_EXE)
set(JAVASCRIPT_BINDINGS_TESTING_AVAILABLE TRUE CACHE INTERNAL "Executables required to run the javascript bindings tests are available.")
endif()

test_libxml2_const_error_structured_error_callback()

if(CONST_ERROR_STRUCTURED_ERROR_CALLBACK)
set(CONST_ERROR_STRUCTURED_ERROR_CALLBACK_TYPE "const xmlError *")
else()
set(CONST_ERROR_STRUCTURED_ERROR_CALLBACK_TYPE "xmlErrorPtr")
endif()
16 changes: 16 additions & 0 deletions docs/changelogs/changelog_v0.6.1-rc.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
libCellML v0.6.1-rc.1 Changelog
===============================

Infrastructure
--------------

* Add a test to check what type is used in the LibXml2 structuredErrorCallback function by `@hsorby <https://github.com/hsorby>`_ [`#1274 <https://github.com/cellml/libcellml/pull/1274>`_].
* Deploy updates by `@hsorby <https://github.com/hsorby>`_ [`#1273 <https://github.com/cellml/libcellml/pull/1273>`_].

Contributors
------------

.. image:: https://avatars.githubusercontent.com/u/778048?v=4
:target: https://github.com/hsorby
:height: 32
:width: 32
1 change: 1 addition & 0 deletions docs/changelogs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelogs

.. toctree::

changelog_v0.6.1-rc.1
changelog_v0.6.0
changelog_v0.5.0
changelog_v0.4.0
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Changelogs

.. toctree::

changelogs/changelog_v0.6.1-rc.1
changelogs/changelog_v0.6.0
changelogs/changelog_v0.5.0
changelogs/changelog_v0.4.0
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ add_library(cellml
${API_HEADER_FILES}
)

set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/xmldoc.cpp PROPERTIES
COMPILE_DEFINITIONS XML_ERROR_CALLBACK_ARGUMENT_TYPE=${CONST_ERROR_STRUCTURED_ERROR_CALLBACK_TYPE})

generate_export_header(cellml EXPORT_FILE_NAME ${LIBCELLML_EXPORTDEFINITIONS_H} BASE_NAME LIBCELLML)

target_include_directories(cellml
Expand Down
3 changes: 1 addition & 2 deletions src/bindings/javascript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ set(_PACKAGE_JSON "\{
\"version\": \"${PROJECT_VERSION}${PROJECT_DEVELOPER_VERSION}\",
\"repository\": \{
\"type\": \"git\",
\"url\": \"https://github.com/cellml/libcellml.git\"
\"url\": \"git+https://github.com/cellml/libcellml.git\"
},
\"description\": \"libcellml.js javascript web assembly for libCellML.\",
\"main\": \"libcellml.js\",
\"files\": [\"libcellml.common.js\", \"libcellml.common.wasm\", \"libcellml.js\", \"libcellml.wasm\", \"README.md\", \"vue-app-with-libcellml.png\"],
\"author\": \"libCellML Developers <[email protected]>\",
\"repository\": \"https://github.com/cellml/libcellml\",
\"license\": \"Apache-2.0\"
}
")
Expand Down
2 changes: 1 addition & 1 deletion src/xmldoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace libcellml {
*
* @param error The @c xmlErrorPtr to the error raised by libxml.
*/
void structuredErrorCallback(void *userData, xmlErrorPtr error)
void structuredErrorCallback(void *userData, XML_ERROR_CALLBACK_ARGUMENT_TYPE error)
{
static const std::regex newLineRegex("\\n");
// Swap libxml2 carriage return for a period.
Expand Down
2 changes: 1 addition & 1 deletion tests/bindings/javascript/version.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ describe("Version tests", () => {
libcellml = await libCellMLModule();
});
test('Checking version string.', () => {
expect(libcellml.versionString()).toBe('0.6.0');
expect(libcellml.versionString()).toBe('0.6.1');
});
})
2 changes: 1 addition & 1 deletion tests/parser/libxml_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ limitations under the License.

#include <libxml/parser.h>

void structuredErrorCallback(void *userData, xmlErrorPtr error)
void structuredErrorCallback(void *userData, XML_ERROR_CALLBACK_ARGUMENT_TYPE error)
{
if (userData != nullptr && error != nullptr) {
// Suppress any error messages raised from using LibXml2.
Expand Down
3 changes: 3 additions & 0 deletions tests/parser/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ set(${CURRENT_TEST}_SRCS
#set(${CURRENT_TEST}_HDRS
# ${CMAKE_CURRENT_LIST_DIR}/<test_header_files.h>
#)

set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/libxml_user.cpp PROPERTIES
COMPILE_DEFINITIONS XML_ERROR_CALLBACK_ARGUMENT_TYPE=${CONST_ERROR_STRUCTURED_ERROR_CALLBACK_TYPE})
4 changes: 2 additions & 2 deletions tests/resources/coverage/generator/model.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* The content of this file was generated using the C profile of libCellML 0.6.0. */
/* The content of this file was generated using the C profile of libCellML 0.6.1. */

#include "model.h"

#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.5.0";
const char LIBCELLML_VERSION[] = "0.6.0";
const char LIBCELLML_VERSION[] = "0.6.1";

const size_t STATE_COUNT = 1;
const size_t VARIABLE_COUNT = 209;
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/coverage/generator/model.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using the C profile of libCellML 0.6.0. */
/* The content of this file was generated using the C profile of libCellML 0.6.1. */

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using a modified C profile of libCellML 0.6.0. */
/* The content of this file was generated using a modified C profile of libCellML 0.6.1. */

double xor(double x, double y)
{
Expand Down
Loading

0 comments on commit ff4070c

Please sign in to comment.