From 4705447225ec2eb0809f9616da3126530ed502df Mon Sep 17 00:00:00 2001 From: Kornel Date: Sat, 30 Dec 2017 01:17:12 +0000 Subject: [PATCH] Remove Conan Fixes #168 --- README.md | 76 +++++-------- appveyor.yml | 25 +---- build.sh | 60 +--------- c_components/build.py | 16 --- c_components/conanfile.py | 104 ------------------ c_components/test_package/conanfile.py | 32 ------ .../tests/libpng/conanfile.txt.unused | 5 - ci/docker/musl/Dockerfile | 6 +- ci/simulate_travis.sh | 12 +- ci/travis_install.sh | 2 +- ci/travis_run.sh | 4 - ci/travis_run_docker.sh | 6 - ci/wintools/SETUP_PATH.bat | 7 +- ci/wintools/install_conan.bat | 5 - ci/wintools/win_verify_tools.bat | 3 - cov.sh | 18 +-- development.md | 4 - imageflow_core/conanfile.txt | 11 -- imageflow_types/build.rs | 24 ---- win_build_c.bat | 20 ---- win_enter_env.bat | 2 - 21 files changed, 55 insertions(+), 387 deletions(-) delete mode 100644 c_components/build.py delete mode 100644 c_components/conanfile.py delete mode 100644 c_components/test_package/conanfile.py delete mode 100644 c_components/tests/libpng/conanfile.txt.unused delete mode 100644 ci/wintools/install_conan.bat delete mode 100644 imageflow_core/conanfile.txt delete mode 100644 win_build_c.bat diff --git a/README.md b/README.md index 7693bf420..fc145f959 100644 --- a/README.md +++ b/README.md @@ -2,54 +2,54 @@ [![travis-master](https://img.shields.io/travis/imazen/imageflow/master.svg?label=master%3A%20mac64%20ubuntu64%2014.04%2016.04)](https://travis-ci.org/imazen/imageflow/builds) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/0356x95fa312m3wy/branch/master?svg=true&passingText=master%3A%20win32%20win64%20-%20passing&failingText=master%3A%20win32%20win64%20-%20failed)](https://ci.appveyor.com/project/imazen/imageflow/branch/master) [![Coverity Scan Build Status](https://scan.coverity.com/projects/8403/badge.svg)](https://scan.coverity.com/projects/imazen-imageflow) [![state: technical preview](https://img.shields.io/badge/state-technical%E2%80%93preview-yellow.svg)](#flaws) -* **imageflow_server** can run jobs or manipulate images in-flight (e.g.`/bucket/img.jpg?w=200`) for direct use from HTML. Source images can reside in blob storage, on another server, or on the filesystem. -* **libimageflow** is for direct (in-process) use from *your* programming language. It has a simple [C-compatible ABI](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/imageflow/index.html) and [bindings](https://github.com/imazen/imageflow/tree/master/bindings). +* **imageflow_server** can run jobs or manipulate images in-flight (e.g.`/bucket/img.jpg?w=200`) for direct use from HTML. Source images can reside in blob storage, on another server, or on the filesystem. +* **libimageflow** is for direct (in-process) use from *your* programming language. It has a simple [C-compatible ABI](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/imageflow/index.html) and [bindings](https://github.com/imazen/imageflow/tree/master/bindings). * **imageflow_tool** is a command-line tool for experimenting, running batch jobs, or when you want process isolation. Up to 17x faster than ImageMagick. -These all offer the JSON [`/build` API](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/context_json_api.txt) as well as the traditional `width=300&height=200&mode=crop&format=jpg` command string form. Each is available as a self-contained binary for Windows and Mac. We offer Docker images for Linux (where glibc and OpenSSL are required). +These all offer the JSON [`/build` API](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/context_json_api.txt) as well as the traditional `width=300&height=200&mode=crop&format=jpg` command string form. Each is available as a self-contained binary for Windows and Mac. We offer Docker images for Linux (where glibc and OpenSSL are required). -libimageflow offers interactive job manipulation as well [like `/tell_decoder`, `/get_image_info`, and `/execute`](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/job_json_api.txt). Unless you are using memory buffers for I/O, it's better to use `/build`. +libimageflow offers interactive job manipulation as well [like `/tell_decoder`, `/get_image_info`, and `/execute`](https://s3-us-west-1.amazonaws.com/imageflow-nightlies/master/doc/job_json_api.txt). Unless you are using memory buffers for I/O, it's better to use `/build`. [![view releases](https://img.shields.io/badge/-view%20downloads%20and%20releases-green.svg)](https://github.com/imazen/imageflow/releases) or `docker run --rm imazen/imageflow_tool` [We thank our backers on Kickstarter](https://www.kickstarter.com/projects/njones/imageflow-respect-the-pixels-a-secure-alt-to-image/posts/1616122) and [the many supporters of ImageResizer](https://imageresizing.net) for making this project a reality. -Email support@imageflow.io if you need an AGPLv3 exception for commercial use. +Email support@imageflow.io if you need an AGPLv3 exception for commercial use. -Also, please [send us 'challenging' images and tasks](https://github.com/imazen/imageflow/issues/98). We'd also appreciate it if you'd explore the JSON APIs and [review them and other topics where we are requesting feedback](https://github.com/imazen/imageflow/issues?q=is%3Aopen+is%3Aissue+label%3Arequesting-feedback). And – we need help with benchmarking on Windows. +Also, please [send us 'challenging' images and tasks](https://github.com/imazen/imageflow/issues/98). We'd also appreciate it if you'd explore the JSON APIs and [review them and other topics where we are requesting feedback](https://github.com/imazen/imageflow/issues?q=is%3Aopen+is%3Aissue+label%3Arequesting-feedback). And – we need help with benchmarking on Windows. If we enough people beta-test Imageflow and provide feedback, we aim to publish a stable 1.0 release in August 2017 (along with Ruby and Node bindings). **See [flaws and missing features](#flaws) for project status.** -## Using imageflow_tool +## Using imageflow_tool -`imageflow_tool examples --generate` - creates an *examples* directory with JSON jobs and invocation scripts. +`imageflow_tool examples --generate` - creates an *examples* directory with JSON jobs and invocation scripts. You can use command strings that are compatible with [ImageResizer 4 querystrings](https://imageresizing.net/docs/basics): `imageflow_tool v0.1/ir4 --in source.jpg --out thumb.jpg --command "width=50&height=50&mode=crop&format=jpg" ` -Or submit a JSON job file. JSON jobs can have multiple inputs and outputs, and can represent any kind of operation graph. +Or submit a JSON job file. JSON jobs can have multiple inputs and outputs, and can represent any kind of operation graph. -The following generates mutiple sizes of an image from an example job file: +The following generates mutiple sizes of an image from an example job file: ``` -imageflow_tool v0.1/build --json examples/export_4_sizes/export_4_sizes.json +imageflow_tool v0.1/build --json examples/export_4_sizes/export_4_sizes.json --in http://s3-us-west-2.amazonaws.com/imageflow-resources/test_inputs/waterhouse.jpg - --out 1 waterhouse_w1600.jpg - 2 waterhouse_w1200.jpg - 3 waterhouse_w800.jpg - 4 waterhouse_w400.jpg + --out 1 waterhouse_w1600.jpg + 2 waterhouse_w1200.jpg + 3 waterhouse_w800.jpg + 4 waterhouse_w400.jpg --response operation_result.json ``` By default, imageflow_tool prints a JSON response to stdout. You write this to disk with `--response`. -`--debug-package` will create a .zip file to reproduce problematic behavior with both `v0.1/build` and `v0.1/ir4`. Please sumbit bug reports; we try to make it easy. +`--debug-package` will create a .zip file to reproduce problematic behavior with both `v0.1/build` and `v0.1/ir4`. Please sumbit bug reports; we try to make it easy. ## Using imageflow_server for dynamic imaging `imageflow_server start --demo` -Now you can edit images from HTML... and use srcset without headache. +Now you can edit images from HTML... and use srcset without headache. ``` @@ -62,9 +62,9 @@ Now you can edit images from HTML... and use srcset without headache. ![](https://www.imageflow.io/images/imageflow-responsive.svg) ![](https://www.imageflow.io/images/edit-url.gif) -### Beyond the demo +### Beyond the demo -You'll want to mount varous image source locations to prefixes. The `--mount` command parses a colon (`:`) delimited list of arguments. The first is the prefix you'll use in the URL (like `http://localhost:39876/prefix/`. The second is the engine name. Remaining arguments are sent to the engine. +You'll want to mount varous image source locations to prefixes. The `--mount` command parses a colon (`:`) delimited list of arguments. The first is the prefix you'll use in the URL (like `http://localhost:39876/prefix/`. The second is the engine name. Remaining arguments are sent to the engine. #### Examples @@ -85,15 +85,15 @@ You'll want to mount varous image source locations to prefixes. The `--mount` co * Ruby - Basic bindings can be found in [bindings/ruby/](https://github.com/imazen/imageflow/tree/master/bindings/ruby) * Node - Not yet started. Want to help? [generate bindings from the header files](https://github.com/tjfontaine/node-ffi-generate) * C and C++ - use [bindings/headers/imageflow_default.h](https://github.com/imazen/imageflow/blob/master/bindings/headers/imageflow_default.h) or one of the many alternate conventions provided with each release. -* Rust - Imageflow is written in Rust. Use the `imageflow_core` crate, but be warned that this interface will evolve more rapidly than the FFI `imageflow` crate. -* other languages - Use an [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) binding-generation tool for your language, and feed it whichever [header file it likes best](https://github.com/imazen/imageflow/tree/master/bindings/headers). +* Rust - Imageflow is written in Rust. Use the `imageflow_core` crate, but be warned that this interface will evolve more rapidly than the FFI `imageflow` crate. +* other languages - Use an [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) binding-generation tool for your language, and feed it whichever [header file it likes best](https://github.com/imazen/imageflow/tree/master/bindings/headers). -Official Ruby and Node bindings will be released by August 2017. +Official Ruby and Node bindings will be released by August 2017. # How to build Imageflow from source -We're assuming you've cloned already. +We're assuming you've cloned already. ```bash git clone git@github.com:imazen/imageflow.git @@ -113,7 +113,7 @@ This will create caches within `~/.docker_imageflow_caches` specific to the dock We need a few packages in order to build the C dependencies. You probably have most of these already. -* build-essential, nasm, dh-autoreconf, pkg-config +* build-essential, nasm, dh-autoreconf, pkg-config * wget, curl, git * libpng, libssl, ca-certificates * python, pip, and setuptools @@ -128,24 +128,20 @@ sudo apt-get install --no-install-recommends \ python-minimal python-pip python-setuptools ``` -After installing the above, you'll need conan, cmake 3.4.1+, dssim, and Rust Nightly. +After installing the above, you'll need cmake 3.4.1+, dssim, and Rust Nightly. ```bash curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2017-08-01 -sudo pip install conan ./ci/nixtools/install_cmake.sh ./ci/nixtools/install_dssim.sh ./build.sh ``` -The build will fail with `settings.target_cpu`. Edit `$HOME\.conan\settings.yml`. Append the line `target_cpu: [x86, x86-64, nehalem, sandybridge, haswell, native]` - - -We aren't listing dependencies needed for +We aren't listing dependencies needed for * Valgrind (common versions break openssl; you may need to build from source) * Code coverage -* Bindings. +* Bindings. Please consult the [official Dockerfiles](https://github.com/imazen/dockerfiles_imageflow) for these. @@ -154,14 +150,11 @@ Please consult the [official Dockerfiles](https://github.com/imazen/dockerfiles_ You'll need a bit less on OS X, although this may not be comprehensive: ```bash -brew install conan nasm cmake python libpng automake libtool pkg-config wget +brew install nasm cmake python libpng automake libtool pkg-config wget ./ci/nixtools/install_dssim.sh ./build.sh ``` -The build will fail with `settings.target_cpu`. Edit `$HOME\.conan\settings.yml`. Append the line `target_cpu: [x86, x86-64, nehalem, sandybridge, haswell, native]` - - ## Windows Don't use a C++ IDE until you've run `win_build_c.bat`, as CMake needs to generate files. @@ -170,26 +163,17 @@ Don't use a C++ IDE until you've run `win_build_c.bat`, as CMake needs to genera 1. Visual Studio 2015 (for the C++ build tools) 2. Install [Git 64-bit](https://git-scm.com/download/win). -3. Install [NASM 64-bit](http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe) Installer must be `Run as Administrator` - it will not prompt. +3. Install [NASM 64-bit](http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe) Installer must be `Run as Administrator` - it will not prompt. 4. Install [Rust 64-bit](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe). Install toolchain `nightly-2017-06-08` and set it as default. For the moment, 32-bit builds also require [a 32-bit Rust](https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-init.exe). 5. Install [CMake 3.7 64-bit](https://cmake.org/download/) (3.8.0-rc3 makes paths too long) -6. Install [Conan](https://www.conan.io/downloads). -You need all of these to be in %PATH%. Edit `ci/wintools/SETUP_PATH.bat` as appropriate to ensure that cmake, conan, rust/cargo, nasm, git, and Git/mingw64/bin are all available. +You need all of these to be in %PATH%. Edit `ci/wintools/SETUP_PATH.bat` as appropriate to ensure that rust/cargo, nasm, git, and Git/mingw64/bin are all available. 1. Run `win_enter_env.bat` to start a sub-shell with VS tools loaded and a proper PATH. Edit the file per its comments to target a 32-bit build (you may want a separate imageflow folder for each target). -2. Run `win_build_c.bat` from the shell to compile the C components -3. It will fail with `settings.target_cpu`. Edit `$HOME\.conan\settings.yml`. Append the line `target_cpu: [x86, x86-64, nehalem, sandybridge, haswell, native]` 4. `cd ..\..` back to the root and run `win_build_c.bat` again. 5. Run `win_build_rust.bat` to compile the Rust components - `c_components/build/Imageflow.sln` will be created during 'win_build_c.bat', but is only set up for Release mode compilation by default. Switch configuration to Release to get a build. You'll need to run conan install directly if you want to change architecture to `x86`, target_cpu to `haswell`, or build_type to `Debug`, since the solutions need to be regenerated. - - cd build - conan install --generator txt --scope build_tests=True -o shared=True --build missing -s build_type=Release -s arch=x86_64 -s target_cpu=sandybridge -u ../ - conan build ../ - ## How does one learn image processing for the web? First, [read High Performance Images](http://shop.oreilly.com/product/0636920039730.do) for context. diff --git a/appveyor.yml b/appveyor.yml index 3359f3a7e..f05047105 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,6 @@ environment: CARGO_INCREMENTAL: 1 RUST_TOOLCHAIN: nightly-2017-11-24 VSINSTALL: "Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build" - CONAN_VISUAL_VERSIONS: 15 VS150COMNTOOLS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\" TARGET_DIR: "target\\" matrix: @@ -18,27 +17,22 @@ environment: NUGET_RUNTIME: win7-x86 PACKAGE_SUFFIX: win-x86 BITS: 32 - CONAN_ARCH: x86 - platform: x64 RUST_TARGET: x86_64-pc-windows-msvc TARGET_CPU: x86-64 NUGET_RUNTIME: win7-x64 PACKAGE_SUFFIX: win-x86_64 BITS: 64 - CONAN_ARCH: x86_64 - platform: x64 RUST_TARGET: x86_64-pc-windows-msvc TARGET_CPU: haswell NUGET_RUNTIME: win7-x64 PACKAGE_SUFFIX: win-x86_64-haswell BITS: 64 - CONAN_ARCH: x86_64 configuration: Release cache: - '%USERPROFILE%\.cargo' - - '%USERPROFILE%\.conan' - - 'c_components\build' - 'target' matrix: fast_finish: false @@ -81,7 +75,7 @@ install: #- vs_buildtools.exe --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended #- C:\"Program Files (x86)"\"%VSINSTALL%"\vcvarsall.bat %PLATFORM% - SET TARGET_ARG= #--target=%RUST_TARGET% - - echo "RUST_TARGET=%RUST_TARGET%, TARGET=%TARGET%, BITS=%BITS%, CPU_TARGET=%CPU_TARGET% CONAN_ARCH=%CONAN_ARCH% RUSTFLAGS=%RUSTFLAGS%" + - echo "RUST_TARGET=%RUST_TARGET%, TARGET=%TARGET%, BITS=%BITS%, CPU_TARGET=%CPU_TARGET% RUSTFLAGS=%RUSTFLAGS%" - SET RUSTUP_INIT=https://static.rust-lang.org/rustup/dist/%RUST_TARGET%/rustup-init.exe - echo Fetching %RUSTUP_INIT% - curl -L -o rustup-init.exe %RUSTUP_INIT% @@ -91,11 +85,6 @@ install: - echo. && echo. && echo Installing NASM - curl -L -o nasminst.exe http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win64/nasm-2.12.02-installer-x64.exe - start /wait nasminst.exe /S - - echo. && echo. && echo Installing Conan - - pip.exe install conan - - conan user # Creates the conan data directory - - conan remote add imageflow https://api.bintray.com/conan/imazen/imageflow || exit 0 - - copy /Y .\ci\updated_conan_settings.yml C:\Users\appveyor\.conan\settings.yml #Fixes settings.yml #https://cmake.org/files/v3.9/cmake-3.9.1-win64-x64.msi test_script: @@ -104,25 +93,14 @@ test_script: - if NOT "%CI_TAG%"=="" rmdir /s /q c_components/build || exit 0 - if NOT "%CI_TAG%"=="" SET CARGO_INCREMENTAL=0 - echo %PATH% - - conan --version - cmake --version - rustc -V - cargo -V - nasm -v - - conan remove imageflow_c/* -f || exit 0 - cd c_components - mkdir build || exit 0 - - cd build - #- SET PATH=%PATH%;C:\MinGW\bin - - conan install --scope build_tests=True -s compiler="Visual Studio" -o shared=True --build missing -s build_type=Release -s arch=%CONAN_ARCH% -s target_cpu=%TARGET_CPU% -u ../ - - conan build ../ - - cd .. - - conan remove imageflow_c/* -f - - conan export imazen/testing - cd %APPVEYOR_BUILD_FOLDER% - SET RUST_TEST_THREADS=1 - - cd imageflow_core - - conan install --build missing -s build_type=Release -s arch=%CONAN_ARCH% -s target_cpu=%TARGET_CPU% - cd %APPVEYOR_BUILD_FOLDER% - cargo test --all --release %TARGET_ARG% - cargo build --all --release %TARGET_ARG% @@ -160,7 +138,6 @@ test_script: - echo. && echo. && echo Cleaning up - rmdir /q /s .\%TARGET_DIR%doc || exit 0 - rmdir /q /s .\%TARGET_DIR%debug || exit 0 - - conan remove imageflow_c/* -f || exit 0 - if NOT "%CI_TAG%"=="" echo Purging build files following %CI_TAG% - if NOT "%CI_TAG%"=="" rmdir /s /q target || exit 0 - if NOT "%CI_TAG%"=="" rmdir /s /q c_components/build || exit 0 diff --git a/build.sh b/build.sh index 1ef2d1b56..01b602ade 100755 --- a/build.sh +++ b/build.sh @@ -20,7 +20,6 @@ if has_shellcheck; then fi # You're going to need: -# Conan # clang or gcc 4.8, 4.9, or 5.4 # Rust nightly # nasm @@ -33,16 +32,12 @@ fi # Check prerequisites command -v zip >/dev/null 2>&1 || { echo -e "'zip' is required, but missing. Try: apt-get install zip\nAborting." >&2; exit 1; } command -v cargo >/dev/null 2>&1 || { echo -e "'cargo' is required, but missing. Try: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2017-08-01\nAborting." >&2; exit 1; } -command -v conan >/dev/null 2>&1 || { echo -e "'conan' is required, but missing. Try: pip install conan\nAborting." >&2; exit 1; } command -v cmake >/dev/null 2>&1 || { echo -e "'cmake' is required, but missing. Try: ./ci/nixtools/install_cmake.sh\nAborting." >&2; exit 1; } command -v dssim >/dev/null 2>&1 || { echo -e "'dssim' is required, but missing. Try: ./ci/nixtools/install_dssim.sh\nAborting." >&2; exit 1; } command -v nasm >/dev/null 2>&1 || { echo -e "'nasm' is required, but missing. Try: apt-get install nasm\nAborting." >&2; exit 1; } # We didn't automatically check for a c compiler, OpenSSL, valgrind, lcov -# parallelizes all Make-based builds (in Conan, etc.). Hardcoded to 8 cores, since portable detection in bash is icky. -export MAKEFLAGS='-j8' - export IMAGEFLOW_BUILD_OVERRIDE="${IMAGEFLOW_BUILD_OVERRIDE:-$1}" if [[ -n "$IMAGEFLOW_BUILD_OVERRIDE" ]]; then @@ -95,26 +90,21 @@ if [[ "$IMAGEFLOW_BUILD_OVERRIDE" == 'purge' ]]; then rm -rf bin rm ./*.{png,jpg,jpeg,gif,user} rm ./*~ - conan remove imageflow_c/* -f exit 0 -fi +fi if [[ "$IMAGEFLOW_BUILD_OVERRIDE" == 'c' ]]; then echo "Rebuilding c_components" - (cd c_components - conan remove imageflow_c/* -f - conan export imazen/testing - ) - (cd imageflow_core - conan install --build missing -s target_cpu=haswell # Will build imageflow package with your current settings + (cd c_components + cargo build --release ) exit 0 fi if [[ "$IMAGEFLOW_BUILD_OVERRIDE" == 'codestats' ]]; then echo "Check on unsafe code statistics" - ( + ( (cd imageflow_core && cargo count --unsafe-statistics) (cd imageflow_abi && cargo count --unsafe-statistics) (cd imageflow_tool && cargo count --unsafe-statistics) @@ -259,7 +249,6 @@ export CARGO_TARGET="${CARGO_TARGET:-}" # clean release build (not incremental) -# clean conan dependencies # clean target/release # @@ -465,7 +454,6 @@ echo_maybe "build.sh sees these relevant variables: ${BUILD_VARS[*]}" [[ -d build ]] || mkdir build echo_maybe "================================== C/C++ =========================== [build.sh]" - conan remote add imageflow https://api.bintray.com/conan/imazen/imageflow || true if [[ "$TEST_C" == 'True' ]]; then echo_maybe "Testing C/C++ components of Imageflow " @@ -476,9 +464,7 @@ echo_maybe "build.sh sees these relevant variables: ${BUILD_VARS[*]}" ( cd build eval "$COPY_VALGRINDRC" - conan install --scope build_tests=True -s "target_cpu=$TARGET_CPU" --scope "debug_build=${VALGRIND:-False}" --scope "coverage=${COVERAGE:-False}" --scope "skip_test_run=${VALGRIND:-False}" --build missing -u ../ 1>&8 date_stamp - conan build ../ 1>&8 #Sync to build/CTestTestfile.cmake #Also update imageflow_core/build_c.sh @@ -499,46 +485,10 @@ echo_maybe "build.sh sees these relevant variables: ${BUILD_VARS[*]}" echo_maybe "==================================================================== [build.sh]" echo_maybe "Process coverage information with lcov" lcov -q --directory ./build --capture --output-file coverage.info 1>&9 - lcov -q --remove coverage.info 'tests/*' '.conan/*' '/usr/*' --output-file coverage.info 1>&9 + lcov -q --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info 1>&9 fi fi - - echo_maybe "==================================================================== [build.sh]" - echo_maybe "Build C/C++ parts of Imageflow & dependencies as needed" - echo_maybe - if [[ "$REBUILD_C" == 'True' ]]; then - conan remove imageflow_c/* -f - fi - conan export imazen/testing 1>&8 - - ( - cd ../imageflow_core - date_stamp - - # Conan regens every time. Let's avoid triggering rebuilds - mkdir -p ../${TARGET_DIR}debug || true - BACKUP_FILE=../${TARGET_DIR}debug/conan_cargo_build.rs - CHANGING_FILE=./conan_cargo_build.rs - if [[ -f "$CHANGING_FILE" ]]; then - # Prefer in-tree copy - cp -p "$CHANGING_FILE" "$BACKUP_FILE" - fi - - #Conan modifies it - conan install --build missing -s build_type=Release -s "target_cpu=$TARGET_CPU" 1>&8 - - #We restore metadata if identical - if [[ -f "$BACKUP_FILE" ]]; then - if cmp -s "$CHANGING_FILE" "$BACKUP_FILE" ; then - cp -p "$BACKUP_FILE" "$CHANGING_FILE" - fi - else - cp -p "$CHANGING_FILE" "$BACKUP_FILE" - fi - - date_stamp - ) ) echo_maybe diff --git a/c_components/build.py b/c_components/build.py deleted file mode 100644 index 51ed6c713..000000000 --- a/c_components/build.py +++ /dev/null @@ -1,16 +0,0 @@ -# Not used much -# ignore this -from conan.packager import ConanMultiPackager -import platform - -if __name__ == "__main__": - builder = ConanMultiPackager() - builder.add_common_builds(shared_option_name="imageflow_c:shared", pure_c=True) - x64_builds = [] - for build in builder.builds: - if build[0]["arch"] != "x86": - x64_builds.append([build[0], build[1]]) - - builder.builds = x64_builds - builder.run() - diff --git a/c_components/conanfile.py b/c_components/conanfile.py deleted file mode 100644 index 90665ef1c..000000000 --- a/c_components/conanfile.py +++ /dev/null @@ -1,104 +0,0 @@ -from conans import ConanFile, CMake -import os -import shutil - -class ImageFlowConan(ConanFile): - name = "imageflow_c" - version = "0.1.0" - license = "AGPLv3" - settings = "os", "compiler", "build_type", "arch", "target_cpu" - requires = "littlecms/2.7@lasote/stable", "libpng/1.6.21@lasote/stable", "libjpeg-turbo/1.5.1@imazen/testing" #, "giflib/5.1.3@lasote/stable" - options = {"shared": [True, False]} - generators = "cmake" - default_options = "shared=False", "libjpeg-turbo:shared=False", "libpng:shared=False", \ - "zlib:shared=False", "imageflow_c:shared=True" - exports = "lib/*", "tests/*", "CMakeLists.txt", "imageflow.h", "imageflow_advanced.h" - -#"libcurl:with_openssl=False" - def config(self): - if self.settings.os != "Windows": # giflib/littlecms must be shared on windows? - #self.options["giflib"].shared = False - self.options["littlecms"].shared = False - - if self.scope.build_tests: - self.requires("catch/1.3.0@TyRoXx/stable") - if self.settings.os != "Windows": # Not supported in windows - self.requires("theft/0.2.0@lasote/stable") - - def imports(self): - self.copy("*.so", dst="bin", src="bin") # From bin to bin - self.copy("*.dll", dst="bin", src="bin") # From bin to bin - self.copy("*.dylib*", dst="bin", src="lib") # From lib to bin - self.copy("*cacert.pem", dst="bin") # Allows use libcurl with https without problems - except on darwin - self.copy("*cacert.pem", dst=".") # Allows use libcurl with https without problems - self.copy("*.a", dst=".") # Copy all static libs to use in cargo build. - - def clean_cmake_cache(self, build_dir): - def on_build_dir(x): - return os.path.join(build_dir, x) - - try: - shutil.rmtree(on_build_dir("CMakeFiles")) - os.remove(on_build_dir("CMakeCache.txt")) - os.remove(on_build_dir("cmake_install.cmake")) - os.remove(on_build_dir("Makefile")) - except: - pass - - - def build(self): - self.output.warn('build_tests=%s debug_build=%s coverage=%s profiling=%s shared=%s target_cpu=%s' % (self.scope.build_tests, self.scope.debug_build, self.scope.coverage, self.scope.profiling, self.options.shared, self.settings.target_cpu)) - build_dir = os.path.join(self.conanfile_directory, "build") - if not os.path.exists(build_dir): - os.mkdir(build_dir) - else: - self.clean_cmake_cache(build_dir) - os.chdir(build_dir) - cmake = CMake(self) - cmake_settings = "" - - if self.scope.dev and self.scope.coverage: - cmake_settings += " -DCOVERAGE=ON" - if self.scope.dev and self.scope.debug_build: - cmake_settings += " -DDEBUG_BUILD=ON" - if self.scope.dev and self.scope.build_tests: - cmake_settings += " -DENABLE_TEST=ON" - if self.scope.dev and self.scope.profiling: - cmake_settings += " -DSKIP_LIBRARY=ON -DENABLE_TEST=OFF -DENABLE_PROFILING=ON" - - - cmake_settings += " -DBUILD_SHARED_LIBS=ON" if self.options.shared else " -DBUILD_SHARED_LIBS=OFF" - cmake_settings += " -DBUILD_SHARED_LIBS=ON" if self.options.shared else " -DBUILD_SHARED_LIBS=OFF" - cmake_settings += " -DTARGET_CPU=%s" % (self.settings.target_cpu) if self.settings.target_cpu else "" - - cmake_command = 'cmake "%s" %s %s' % (self.conanfile_directory, cmake.command_line, cmake_settings) - cmake_build_command = 'cmake --build . %s' % cmake.build_config - cmake_valgrind = "-D ExperimentalMemCheck" if self.scope.valgrind else "" - - cmake_test_command = 'ctest -V -C Release %s' % cmake_valgrind - self.output.warn(cmake_command) - self.run(cmake_command) - self.output.warn(cmake_build_command) - self.run(cmake_build_command) - - if self.scope.dev and self.scope.build_tests: - if self.scope.skip_test_run: - self.output.warn("Skipping tests; skip_test_run=False (perhaps for later valgrind use?)") - self.output.warn("Would have run %s" % cmake_test_command) - else: - self.output.warn(cmake_test_command) - self.run(cmake_test_command) - else: - self.output.warn("Skipping tests; build_tests=False") - - def package(self): - self.copy("imageflow.h", dst="include", src="", keep_path=False) - self.copy("imageflow_advanced.h", dst="include", src="", keep_path=False) - self.copy("*.h", dst="include", src="lib", keep_path=True) - self.copy("*.so*", dst="lib", src="build/", keep_path=False) - self.copy("*.a", dst="lib", src="build", keep_path=False) - self.copy("*.lib", dst="lib", src="build", keep_path=False) - self.copy("*.dll", dst="bin", src="build", keep_path=False) - - def package_info(self): - self.cpp_info.libs = ['imageflow_c'] diff --git a/c_components/test_package/conanfile.py b/c_components/test_package/conanfile.py deleted file mode 100644 index 25a59c4dd..000000000 --- a/c_components/test_package/conanfile.py +++ /dev/null @@ -1,32 +0,0 @@ -from conans.model.conan_file import ConanFile -from conans import CMake -import os - - - -############### CONFIGURE THESE VALUES ################## -default_user = "lasote" -default_channel = "testing" -######################################################### - -channel = os.getenv("CONAN_CHANNEL", default_channel) -username = os.getenv("CONAN_USERNAME", default_user) - -class DefaultNameConan(ConanFile): - name = "DefaultName" - version = "0.1" - settings = "os", "compiler", "arch", "build_type" - generators = "cmake" - requires = "imageflow_c/0.1.0@%s/%s" % (username, channel) - - def build(self): - cmake = CMake(self.settings) - self.run('cmake %s %s' % (self.conanfile_directory, cmake.command_line)) - self.run("cmake --build . %s" % cmake.build_config) - - def imports(self): - self.copy(pattern="*.dll", dst="bin", src="bin") - self.copy(pattern="*.dylib", dst="bin", src="lib") - - def test(self): - self.run(".%sbin%sexample --help" % (os.sep, os.sep)) diff --git a/c_components/tests/libpng/conanfile.txt.unused b/c_components/tests/libpng/conanfile.txt.unused deleted file mode 100644 index 0078b03da..000000000 --- a/c_components/tests/libpng/conanfile.txt.unused +++ /dev/null @@ -1,5 +0,0 @@ -[requires] -libpng/1.6.23@lasote/stable - -[generators] -gcc diff --git a/ci/docker/musl/Dockerfile b/ci/docker/musl/Dockerfile index 189acaa4d..47fe15411 100644 --- a/ci/docker/musl/Dockerfile +++ b/ci/docker/musl/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:xenial -MAINTAINER Nathanael Jones +MAINTAINER Nathanael Jones RUN apt-get update \ @@ -25,7 +25,6 @@ RUN apt-get update \ luajit \ ruby-dev ruby-bundler rubygems-integration \ python-minimal python-pip python-setuptools \ - && pip install conan \ && apt-get clean -y \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* \ @@ -42,7 +41,6 @@ RUN groupadd 1001 -g 1001 &&\ useradd -ms /bin/bash conan -g 1001 -G 1000 &&\ echo "conan:conan" | chpasswd && adduser conan sudo &&\ echo "conan ALL= NOPASSWD: ALL\n" >> /etc/sudoers &&\ - mkdir -p /home/conan/.conan && sudo chown conan: /home/conan/.conan USER conan @@ -74,7 +72,7 @@ ENV SSL_VER=1.0.2j \ # # RUN sudo pip install conan --upgrade RUN RUSTVER="nightly-2016-11-03" && curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTVER -v \ - && rustup target add x86_64-unknown-linux-musl + && rustup target add x86_64-unknown-linux-musl RUN RUSTVER="nightly-2016-11-03" && rustup default $RUSTVER \ && rustup show \ && rustc -V \ diff --git a/ci/simulate_travis.sh b/ci/simulate_travis.sh index 0d527a87f..d4ed8eb8c 100755 --- a/ci/simulate_travis.sh +++ b/ci/simulate_travis.sh @@ -127,16 +127,14 @@ rsync -q -av --delete "${SCRIPT_DIR}/.." "$WORKING_DIR" --filter=':- .gitignore' # The first two are only needed in test.sh, since we're rsycning away the whole /target folder export SIM_DOCKER_CACHE_VARS=( - -v + -v "${WORKING_DIR}_cache/${TARGET_DIR}debug:/home/conan/imageflow/${TARGET_DIR}debug" - -v + -v "${WORKING_DIR}_cache/${TARGET_DIR}release:/home/conan/imageflow/${TARGET_DIR}release" - -v - "${WORKING_DIR}_cache/conan_data:/home/conan/.conan/data" - -v + -v + "${WORKING_DIR}_cache/conan_data:/home/conan/.conan/data" + -v "${WORKING_DIR}_cache/ccache:/home/conan/.ccache" - -v - "${WORKING_DIR}_cache/c_components/build:/home/conan/imageflow/c_components/build" ) if [[ "$COPY_HOST_CARGO_DIR" == "True" ]]; then SIM_DOCKER_CACHE_VARS+=( diff --git a/ci/travis_install.sh b/ci/travis_install.sh index e2afab99f..382723944 100755 --- a/ci/travis_install.sh +++ b/ci/travis_install.sh @@ -16,7 +16,7 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then set -x brew update || brew update date "$STAMP" - brew install conan nasm + brew install nasm ./ci/nixtools/install_dssim.sh set +x else diff --git a/ci/travis_run.sh b/ci/travis_run.sh index 5fb71076a..4399be5a7 100755 --- a/ci/travis_run.sh +++ b/ci/travis_run.sh @@ -360,10 +360,6 @@ else /bin/bash -c "./ci/travis_run_docker.sh" ) export DOCKER_CACHE_VARS=( - -v - "$HOME/.ccache:/home/conan/.ccache" - -v - "$HOME/.conan/data:/home/conan/.conan/data" ) DOCKER_INVOCATION=(docker run "--rm") diff --git a/ci/travis_run_docker.sh b/ci/travis_run_docker.sh index 2faaaff6f..8a72c2754 100755 --- a/ci/travis_run_docker.sh +++ b/ci/travis_run_docker.sh @@ -7,12 +7,6 @@ printf "travis_run_docker.sh:" sudo chown -R "$(id -u -n)": ~/ sudo chmod -R a+rw . -conan user 1>/dev/null - -#Copy conan settings - always -cp "./ci/updated_conan_settings.yml" "${HOME}/.conan/settings.yml" - - if [[ -d "${HOME}/host_cargo/git" && -d "${HOME}/host_cargo/registry" ]]; then echo "copying ~/host_cargo" cp -Rp "${HOME}/host_cargo/git" "${HOME}/.cargo/git" diff --git a/ci/wintools/SETUP_PATH.bat b/ci/wintools/SETUP_PATH.bat index 3fb39a9e4..fa6abd192 100644 --- a/ci/wintools/SETUP_PATH.bat +++ b/ci/wintools/SETUP_PATH.bat @@ -5,13 +5,11 @@ set PATH=%PATH%;C:\Program Files\Git\bin;C:\Program Files\Git\mingw64\bin set PATH=%PATH%;C:\Program Files (x86)\NASM; set PATH=%PATH%;C:\Program Files (x86)\Rust\bin set PATH=%PATH%;C:\Program Files\CMake\bin -set PATH=%PATH%;C:\Program Files (x86)\Conan\conan echo Updated path to echo %PATH% echo . -set CONAN_ARCH=x86 set RUST_TARGET=i686-pc-windows-msvc set TARGET_CPU=sandybridge set RUST_FLAGS=%RUST_FLAGS -C target-cpu=%TARGET_CPU% @@ -20,13 +18,12 @@ set CARGO_INCREMENTAL=1 set RUST_TEST_THREADS=1 set VS_ARCH=x86 -if [%1] == [x86] goto :x86 -set CONAN_ARCH=x86_64 +if [%1] == [x86] goto :x86 set RUST_TARGET=x86_64-pc-windows-msvc set VS_ARCH=amd64 :x86 -echo VS_ARCH=%VSARCH% CONAN_ARCH=%CONAN_ARCH% RUST_TARGET=%RUST_TARGET% TARGET_CPU=%TARGET_CPU% CARGO_INCREMENTAL=%CARGO_INCREMENTAL% +echo VS_ARCH=%VSARCH% RUST_TARGET=%RUST_TARGET% TARGET_CPU=%TARGET_CPU% CARGO_INCREMENTAL=%CARGO_INCREMENTAL% echo NOW entering VS 14 %comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %VS_ARCH%" diff --git a/ci/wintools/install_conan.bat b/ci/wintools/install_conan.bat deleted file mode 100644 index b116bd780..000000000 --- a/ci/wintools/install_conan.bat +++ /dev/null @@ -1,5 +0,0 @@ -curl -L -o conan-win.exe https://github.com/conan-io/conan/releases/download/0.20.3/conan-win_0_20_3.exe - -start /wait conan-win.exe /S - - diff --git a/ci/wintools/win_verify_tools.bat b/ci/wintools/win_verify_tools.bat index 4dbc10b7a..0368807e1 100644 --- a/ci/wintools/win_verify_tools.bat +++ b/ci/wintools/win_verify_tools.bat @@ -5,8 +5,5 @@ cmake --version echo RUST MUST BE NIGHTLY 2017-06-08 or later rustc -V cargo -V -echo Conan must be 0.21+ -conan --version - echo ============ END VERIFY TOOLS REPORT ============== diff --git a/cov.sh b/cov.sh index c2d24c9cf..40d4749b5 100755 --- a/cov.sh +++ b/cov.sh @@ -5,26 +5,26 @@ rm -rf ./target/{c_cov,rust_cov,rust_coverage,c_coverage} || true for i in ./target/debug/imageflow*-[0-9a-f][0-9a-f]* do - if [[ "$i" == *.* ]]; then + if [[ "$i" == *.* ]]; then echo "Skipping $i" else echo "Covering $i" DIR="./target/rust_coverage/$(basename "$i")" mkdir -p "$DIR" - kcov --exclude-pattern=/.cargo,/.conan,/usr,/tests --include-path=./c_components/lib,./imageflow_core/src,./imageflow_server/src,./imageflow_tool/src,./imageflow_types/src,./imageflow_helpers/src "$DIR" "$i" - fi + kcov --exclude-pattern=/.cargo,/usr,/tests --include-path=./c_components/lib,./imageflow_core/src,./imageflow_server/src,./imageflow_tool/src,./imageflow_types/src,./imageflow_helpers/src "$DIR" "$i" + fi done for i in ./c_components/build/bin/test_* do - if [[ "$i" == *.* ]]; then + if [[ "$i" == *.* ]]; then echo "Skipping $i" else echo "Covering $i" DIR="./target/c_coverage/$(basename "$i")" mkdir -p "$DIR" - kcov --exclude-pattern=/.cargo,/.conan,/usr,/tests "$DIR" "$i" - fi + kcov --exclude-pattern=/.cargo,/usr,/tests "$DIR" "$i" + fi done @@ -34,10 +34,10 @@ kcov --merge ./target/c_cov ./target/coverage/*/ echo "Merging $(ls ./target/rust_coverage)" kcov --merge ./target/rust_cov ./target/coverage/*/ -if [[ "$CODECOV" == "True" ]]; then +if [[ "$CODECOV" == "True" ]]; then echo "Uploading to codecov.io" bash <(curl -s https://codecov.io/bash) -s ./target/c_cov bash <(curl -s https://codecov.io/bash) -s ./target/rust_cov -fi +fi -#kcov --merge ./target/cov /home/n/.docker_imageflow_caches/.docker_build_if_gcc48_x86-64/target/coverage/*/ \ No newline at end of file +#kcov --merge ./target/cov /home/n/.docker_imageflow_caches/.docker_build_if_gcc48_x86-64/target/coverage/*/ diff --git a/development.md b/development.md index ee77c4ab5..c4be07582 100644 --- a/development.md +++ b/development.md @@ -35,10 +35,6 @@ clang-format -i c_components/{lib,tests}/*.{c,h,cpp,hpp} 1. export CC=gcc-4.8 2. export CPP=g++-4.8 -3. Edit `compiler.version` in ~/.conan/conan.conf - -Per https://github.com/conan-io/conan/issues/178 -Destroy the ./build directory before trying again.(`rm -rf build`) ## Generating animated gifs of graph progression. diff --git a/imageflow_core/conanfile.txt b/imageflow_core/conanfile.txt deleted file mode 100644 index fbc2dd564..000000000 --- a/imageflow_core/conanfile.txt +++ /dev/null @@ -1,11 +0,0 @@ -[requires] -ConanCargoWrapper/0.1@lasote/testing -imageflow_c/0.1.0@imazen/testing -littlecms/2.7@lasote/stable -zlib/1.2.8@lasote/stable - - -[generators] -ConanCargoWrapper - - diff --git a/imageflow_types/build.rs b/imageflow_types/build.rs index a1df95446..21c24dab3 100644 --- a/imageflow_types/build.rs +++ b/imageflow_types/build.rs @@ -158,7 +158,6 @@ fn what_to_collect() -> Vec{ } c.push(EnvTidbit::EnvReq("CARGO_MANIFEST_DIR")); c.push(EnvTidbit::Cmd{key: "GIT_STATUS", cmd: "git checkout ../c_components/tests/visuals/weights.txt && git status"}); - c.push(EnvTidbit::Cmd{key: "CONAN_VERSION", cmd: "conan -V"}); c.push(EnvTidbit::Cmd{key: "GLIBC_VERSION", cmd: "ldd --version"}); c.push(EnvTidbit::Cmd{key: "UNAME", cmd: "uname -av"}); c.push(EnvTidbit::Cmd{key: "WIN_SYSTEMINFO", cmd: "systeminfo.exe"}); @@ -167,7 +166,6 @@ fn what_to_collect() -> Vec{ c.push(EnvTidbit::Cmd{key: "DEFAULT_CLANG_VERSION", cmd: "clang --version"}); c.push(EnvTidbit::CmdReq{key: "DEFAULT_RUSTC_VERSION", cmd: "rustc -V"}); c.push(EnvTidbit::CmdReq{key: "DEFAULT_CARGO_VERSION", cmd: "cargo -V"}); - c.push(EnvTidbit::FileContentsReq{key: "conaninfo.txt", relative_to_build_rs: "../imageflow_core/conaninfo.txt"}); c } @@ -182,25 +180,6 @@ fn write_file(name: &str, file_contents: String) -> std::result::Result<(), Erro Ok(()) } -fn parse_conanfile(info: &mut HashMap>) { - let conan_str = info.get("conaninfo.txt").unwrap().to_owned().unwrap(); - let mut in_requirements_section = false; - for line in conan_str.lines() { - let t = line.trim(); - if t.starts_with("[") { - in_requirements_section = false; - } - if t == "[full_requires]" { - in_requirements_section = true; - continue - } - if in_requirements_section { - let k = format!("C_DEPENDENCY_{}",t.split("/").next().unwrap().to_uppercase()); - info.insert(k, Some(t.to_owned())); - } - } -} - fn main() { let todo = what_to_collect(); let utcnow_val =Utc::now(); @@ -208,9 +187,6 @@ fn main() { let mut results = collect_info(todo); results.insert("GENERATED_DATETIME_UTC".to_owned(), Some(utcnow_val.to_rfc3339())); results.insert("GENERATED_DATE_UTC".to_owned(), Some(utcnow_val.format("%Y-%m-%d").to_string())); - parse_conanfile(&mut results); - - let mut contents = String::new(); contents += "use std::collections::HashMap;\n"; diff --git a/win_build_c.bat b/win_build_c.bat deleted file mode 100644 index 94165f562..000000000 --- a/win_build_c.bat +++ /dev/null @@ -1,20 +0,0 @@ -cmd.exe /c "ci\wintools\win_verify_tools.bat" - -REM EXPECTS CONAN_ARCH and TARGET_CPU from ci\wintools\SETUP_PATH.bat - -cd c_components || exit /b -mkdir build -cd build || exit /b - -conan install --generator txt --scope build_tests=True -o shared=True --build missing -s build_type=Release -s arch=%CONAN_ARCH% -s target_cpu=%TARGET_CPU% -u ../ || exit /b - -conan build ../ || exit /b -cd .. || exit /b - -echo Clearing cached C component -conan remove imageflow_c/* -f -conan export imazen/testing || exit /b -cd .. || exit /b -cd imageflow_core || exit /b -conan install --build missing -s build_type=Release -s arch=%CONAN_ARCH% -s target_cpu=%TARGET_CPU% || exit /b -cd .. || exit /b \ No newline at end of file diff --git a/win_enter_env.bat b/win_enter_env.bat index 33036e8f0..071d64386 100644 --- a/win_enter_env.bat +++ b/win_enter_env.bat @@ -1,5 +1,3 @@ -echo "You will need to modify ~/.conan/settings.yml" -echo "add: target_cpu: [x86, x86-64, nehalem, sandybridge, haswell, native]" REM To target 64-bit, use this: REM %COMSPEC% /c ""ci\wintools\SETUP_PATH.bat""