Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: rescue appveyor config from old-master and backup others #1588

Merged
merged 9 commits into from
May 3, 2021
84 changes: 40 additions & 44 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,34 @@
init:
- echo %PYTHON%
# Configuration rescued from 'old-master' branch.
# Only one Visual Studio (latest one), and all possible configurations
image: Visual Studio 2019

configuration:
- Debug
- Release

platform:
- x86
- x64

environment:
PYTHON: "C:/Python37-x64"
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat

PYTHON: "C:\\Python39-x64"

matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_GENERATOR: Ninja
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 16
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: Ninja
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 15
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: Ninja
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 14
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- SHARED: ON
- SHARED: OFF

shallow_clone: true

install:
- set PATH=%PATH%;%PYTHON%/Scripts/
- echo %APPVEYOR_BUILD_FOLDER%
- mkdir C:\projects\deps
- cd C:\projects\deps
- appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip -FileName ninja.zip
- 7z x ninja.zip -oC:\projects\deps\ninja > nul
- set PATH=C:\projects\deps\ninja;%PATH%
- if not exist deps mkdir deps
- cd deps
- if not exist ninja appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -FileName ninja.zip
- if not exist ninja 7z x ninja.zip -o%APPVEYOR_BUILD_FOLDER%\deps\ninja > nul
- set PATH=%APPVEYOR_BUILD_FOLDER%\deps\ninja;%PATH%
- ninja --version
- python -m pip install --upgrade pip
- pip3.exe install conan==1.35.2
Expand All @@ -50,24 +39,31 @@ before_build:
- cmd: conan remote list
- cmd: conan config set storage.path=c:\Users\appveyor\conanCache
- cmd: conan profile new --detect default
- cmd: conan profile update settings.compiler.version=%VS_COMPILER_VERSION% default
- cmd: conan profile update settings.compiler.version=16 default
- cmd: if "%platform%"=="x64" (set ARCHITECTURE=x86_64) else (set ARCHITECTURE=x86)
- cmd: if "%CONFIGURATION%"=="Debug" (set RUNTIME=MDd) else (set RUNTIME=MD)
- cmd: conan profile update settings.arch=%ARCHITECTURE% default
- cmd: conan profile update settings.arch_build=%ARCHITECTURE% default
- cmd: conan profile update settings.build_type=%CONFIGURATION% default
- cmd: conan profile update settings.compiler.runtime=%RUNTIME% default
- cmd: cat c:\Users\appveyor\.conan\conan.conf
- cmd: cat c:\Users\appveyor\.conan\profiles\default

build_script:
- cmd: md build
- cmd: cd build
- cmd: call "%VCVARS%" x86_amd64
- cmd: conan --version
- cmd: conan install .. -o webready=False --build missing
- cmd: echo %CMAKE_GENERATOR%
- cmd: cmake -G "%CMAKE_GENERATOR%" -DEXIV2_TEAM_WARNINGS_AS_ERRORS=%WARNINGS_AS_ERRORS% -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_BMFF=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_BUILD_UNIT_TESTS=%UNIT_TESTS% -DCMAKE_INSTALL_PREFIX=install ..
- cmd: cmake --build . --config Release
- cmd: cmake --build . --config Release --target install
- cmd: if "%platform%"=="x64" (set VC_ARCH=x86_amd64) else (set VC_ARCH=x86)
- cmd: call "%VCVARS%" %VC_ARCH%
- cmd: conan install .. --build missing -o webready=True
- cmd: cmake -GNinja -DBUILD_SHARED_LIBS=%SHARED% -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_BUILD_UNIT_TESTS=ON -DEXIV2_ENABLE_WIN_UNICODE=OFF -DEXIV2_ENABLE_BMFF=ON -DCMAKE_INSTALL_PREFIX=install ..
- cmd: ninja
- cmd: ninja install
- cmd: cd bin
- cmd: if %UNIT_TESTS% == 1 unit_tests.exe
- cmd: unit_tests.exe
- cmd: cd ../../tests/
- cmd: if %INTEGRATION_TESTS% == 1 %PYTHON%/python.exe runner.py -v
- cmd: cd ../build/bin
- cmd: exiv2 --version --verbose
- cmd: set EXIV2_EXT=.exe
- cmd: c:\Python39-x64\python.exe runner.py -v

cache:
- deps # Ninja installation
#- c:\Users\appveyor\conanCache # Conan cache
73 changes: 73 additions & 0 deletions ci/appveyor_all_vs_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
init:
- echo %PYTHON%

environment:
PYTHON: "C:/Python37-x64"

matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_GENERATOR: Ninja
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 16
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: Ninja
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 15
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: Ninja
INTEGRATION_TESTS: 1
VS_COMPILER_VERSION: 14
VCVARS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
ARCHITECTURE: x86_64
UNIT_TESTS: 1
WARNINGS_AS_ERRORS: ON

shallow_clone: true

install:
- set PATH=%PATH%;%PYTHON%/Scripts/
- echo %APPVEYOR_BUILD_FOLDER%
- mkdir C:\projects\deps
- cd C:\projects\deps
- appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip -FileName ninja.zip
- 7z x ninja.zip -oC:\projects\deps\ninja > nul
- set PATH=C:\projects\deps\ninja;%PATH%
- ninja --version
- python -m pip install --upgrade pip
- pip3.exe install conan==1.35.2
- pip3.exe install lxml
- cd %APPVEYOR_BUILD_FOLDER%

before_build:
- cmd: conan remote list
- cmd: conan config set storage.path=c:\Users\appveyor\conanCache
- cmd: conan profile new --detect default
- cmd: conan profile update settings.compiler.version=%VS_COMPILER_VERSION% default
- cmd: conan profile update settings.arch=%ARCHITECTURE% default
- cmd: conan profile update settings.arch_build=%ARCHITECTURE% default
- cmd: cat c:\Users\appveyor\.conan\conan.conf

build_script:
- cmd: md build
- cmd: cd build
- cmd: call "%VCVARS%" x86_amd64
- cmd: conan --version
- cmd: conan install .. -o webready=False --build missing
- cmd: echo %CMAKE_GENERATOR%
- cmd: cmake -G "%CMAKE_GENERATOR%" -DEXIV2_TEAM_WARNINGS_AS_ERRORS=%WARNINGS_AS_ERRORS% -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_BMFF=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_BUILD_UNIT_TESTS=%UNIT_TESTS% -DCMAKE_INSTALL_PREFIX=install ..
- cmd: cmake --build . --config Release
- cmd: cmake --build . --config Release --target install
- cmd: cd bin
- cmd: if %UNIT_TESTS% == 1 unit_tests.exe
- cmd: cd ../../tests/
- cmd: if %INTEGRATION_TESTS% == 1 %PYTHON%/python.exe runner.py -v
- cmd: cd ../build/bin
- cmd: exiv2 --version --verbose
File renamed without changes.
4 changes: 3 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ def requirements(self):

if self.options.unitTests:
self.requires('gtest/1.10.0')
if self.settings.build_type == "Debug":
self.options['gtest'].debug_postfix = ''

if self.options.xmp:
self.requires('XmpSdk/2016.7@piponazo/stable') # from conan-piponazo
else:
self.requires('expat/2.2.7')
self.requires('Expat/2.2.6@pix4d/stable')

def imports(self):
self.copy('*.dll', dst='bin', src='bin')
Expand Down
5 changes: 4 additions & 1 deletion samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ list(APPEND APPLICATIONS remotetest)
foreach(application ${APPLICATIONS})
target_link_libraries(${application} PRIVATE exiv2lib)
if( EXIV2_ENABLE_PNG )
target_link_libraries( ${application} PRIVATE ${ZLIB_LIBRARIES} )
target_link_libraries(${application} PRIVATE ${ZLIB_LIBRARIES} )
if (MSVC)
set_target_properties(${application} PROPERTIES LINK_FLAGS "/ignore:4099") # Ignore missing PDBs
endif()
endif()
endforeach()

Expand Down
7 changes: 5 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ set_target_properties( exiv2lib_int PROPERTIES
COMPILE_DEFINITIONS exiv2lib_EXPORTS
)

# NOTE: Cannot use target_link_libraries on OBJECT libraries with old versions of CMake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which CMake version are we stuck with due to older distributions?
Does it maybe make sense to move to a newer one, and simply have the older distributions download a newer version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Debian:9 the default CMake version is 3.7 and on CentOS:8 it is 3.11.

I am the first one I would like to use the latest CMake version possible, but in practice I think this would make more difficult for distributions to include the latest Exiv2 version (need to create patches, and so on). But being honest, I am just guessing, I do not know how distribution maintainers consume and generate binaries for each of the distribution packages.

Most of the times (like this one) it is only about tiny details, and the quality of the CMake code does not get affected (too much). If we find a good excuse/reason to require a CMake higher version, we can always discuss it in a separate issue/PR 😁

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me! It's always a trade-off :)
As long as it's not impacting our CMake too much I think you are right, no reason to upgrade just yet :)

target_include_directories(exiv2lib_int PRIVATE ${ZLIB_INCLUDE_DIR})
target_include_directories(exiv2lib SYSTEM PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/xmpsdk/include>
${ZLIB_INCLUDE_DIR}
)

if (EXIV2_ENABLE_XMP)
Expand Down Expand Up @@ -188,7 +188,7 @@ else()
endif()

if( EXIV2_ENABLE_PNG )
target_link_libraries( exiv2lib PRIVATE $<BUILD_INTERFACE:${ZLIB_LIBRARIES}>)
target_link_libraries( exiv2lib PRIVATE ZLIB::ZLIB)
endif()

if( EXIV2_ENABLE_NLS )
Expand Down Expand Up @@ -237,6 +237,9 @@ if(EXIV2_BUILD_EXIV2_COMMAND)
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS}
XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES"
)
if (MSVC)
set_target_properties(exiv2 PROPERTIES LINK_FLAGS "/ignore:4099") # Ignore missing PDBs
endif()

target_link_libraries( exiv2 PRIVATE exiv2lib )

Expand Down
4 changes: 2 additions & 2 deletions src/basicio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ namespace Exiv2 {
ret = ::_wstati64(wpath_.c_str(), &st);

if (0 == ret) {
buf.st_size = st.st_size;
buf.st_size = static_cast<long>(st.st_size);
buf.st_mode = st.st_mode;
buf.st_nlink = st.st_nlink;
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ namespace Exiv2 {
if (newIdx < 0)
return 1;

if (static_cast<size_t>(newIdx) > p_->size_) {
if (newIdx > p_->size_) {
p_->eof_ = true;
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/suite.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[General]
timeout: 60.0
timeout: 240.0
memcheck: ${ENV:valgrind}

[ENV]
Expand Down