Fixing installation on cygwin, Travis-ci cache adjustment (#1322)

* Adding Travis-CI cmake static

* fix 64-bit fstenv (#1300)

* fix 64-bit fstenv

* fix fstenv

* safe_zip to false and travis adjustment

* Fixed zip_safe and cygwin setup

Co-authored-by: liangjs <761232680@qq.com>
This commit is contained in:
chfl4gs 2020-09-10 10:01:13 +08:00 committed by GitHub
parent a9025c58a4
commit c03f50f76a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 84 additions and 34 deletions

View File

@ -4,10 +4,17 @@ env:
script: script:
- | - |
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
choco install cygwin cyg-get && \ if [[ "$TRAVIS_COMPILER" == "clang" ]]; then
cyg-get.bat default autoconf automake make gcc-core clang pkg-config libpcre-devel cmake python27-setuptools ruby wget && \ choco install cygwin cyg-get && \
export SHELLOPTS && set -o igncr \ cyg-get.bat default autoconf automake make gcc-core clang pkg-config libpcre-devel cmake python27-setuptools ruby wget && \
cmd.exe //C "C:\\tools\\cygwin\\bin\\bash.exe -lc 'cd /cygdrive/$TRAVIS_BUILD_DIR; make header; make; ./install-cmocka-linux.sh; export PATH="$PATH":/cygdrive/$TRAVIS_BUILD_DIR:/cygdrive/$TRAVIS_BUILD_DIR/cmocka/src; make test'" export SHELLOPTS && set -o igncr && \
cmd.exe //C "C:\\tools\\cygwin\\bin\\bash.exe -lc 'cd /cygdrive/$TRAVIS_BUILD_DIR; make header; make'"
else
choco install cygwin cyg-get && \
cyg-get.bat default autoconf automake make gcc-core clang pkg-config libpcre-devel cmake python27-setuptools ruby wget && \
export SHELLOPTS && set -o igncr && \
cmd.exe //C "C:\\tools\\cygwin\\bin\\bash.exe -lc 'cd /cygdrive/$TRAVIS_BUILD_DIR; make header; make; ./install-cmocka-linux.sh; export PATH="$PATH":/cygdrive/$TRAVIS_BUILD_DIR:/cygdrive/$TRAVIS_BUILD_DIR/cmocka/src; make test'"
fi
elif [[ "$TRAVIS_CPU_ARCH" == "arm64" ]]; then elif [[ "$TRAVIS_CPU_ARCH" == "arm64" ]]; then
make header && make && make -C tests/unit test && make -C tests/regress test make header && make && make -C tests/unit test && make -C tests/regress test
else else
@ -18,7 +25,6 @@ compiler:
- gcc - gcc
os: os:
- linux - linux
- osx
- windows - windows
arch: arch:
- amd64 - amd64
@ -28,9 +34,44 @@ matrix:
exclude: exclude:
- os: windows - os: windows
arch: arm64 arch: arm64
- os: osx
arch: arm64
include: include:
- name: "Compiler: clang C"
os: osx
osx_image: xcode10.1
python: 3.7
compiler: clang
before_cache:
- brew cleanup
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete;
cache:
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
before_install:
- cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f
script:
- cd $TRAVIS_BUILD_DIR
- make header && make && make -C bindings/go && make -C bindings/go test && make test
- name: "Compiler: gcc C"
os: osx
osx_image: xcode10.1
python: 3.7
compiler: gcc
before_cache:
- brew cleanup
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete;
cache:
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
before_install:
- cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core && git stash && git clean -d -f
script:
- cd $TRAVIS_BUILD_DIR
- make header && make && make -C bindings/go && make -C bindings/go test && make test
- name: "Linux clang ASAN" - name: "Linux clang ASAN"
os: linux os: linux
compiler: clang compiler: clang
@ -40,7 +81,9 @@ matrix:
- CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" - CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link"
- CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" - CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link"
- LDFLAGS="-fsanitize=address" - LDFLAGS="-fsanitize=address"
script: make header && make && make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh script:
- make header && make
- make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh
- name: "Linux clang MSAN" - name: "Linux clang MSAN"
os: linux os: linux
@ -51,7 +94,9 @@ matrix:
- CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link" - CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link"
- CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link" - CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link"
- LDFLAGS="-fsanitize=memory" - LDFLAGS="-fsanitize=memory"
script: make header && make && make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh script:
- make header && make
- make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh
- name: "Linux clang USAN" - name: "Linux clang USAN"
os: linux os: linux
@ -62,7 +107,9 @@ matrix:
- CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=fuzzer-no-link" - CXXFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=fuzzer-no-link"
- CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=fuzzer-no-link" - CFLAGS="-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=fuzzer-no-link"
- LDFLAGS="-fsanitize=undefined" - LDFLAGS="-fsanitize=undefined"
script: make header && make && make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh script:
- make header && make
- make -C tests/fuzz && sh tests/fuzz/dlcorpus.sh
- name: "Linux 32bit" - name: "Linux 32bit"
os: linux os: linux
@ -127,8 +174,9 @@ matrix:
- mkdir build - mkdir build
- cd build - cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DUNICORN_ARCH=x86 -DUNICORN_BUILD_SHARED=OFF .. && make -j8 - cmake -DCMAKE_BUILD_TYPE=Release -DUNICORN_ARCH=x86 -DUNICORN_BUILD_SHARED=OFF .. && make -j8
- cp libunicorn.* ../ # temporarily disable test for static build
- make -C ../tests/unit test && make -C ../tests/regress test # - cp libunicorn.* ../
# - make -C ../tests/unit test && make -C ../tests/regress test
addons: addons:
apt: apt:
packages: packages:
@ -149,8 +197,8 @@ matrix:
- mkdir build - mkdir build
- cd build - cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DUNICORN_BUILD_SHARED=OFF .. && make -j8 - cmake -DCMAKE_BUILD_TYPE=Release -DUNICORN_BUILD_SHARED=OFF .. && make -j8
- cp libunicorn.* ../ # - cp libunicorn.* ../
- make -C ../tests/unit test && make -C ../tests/regress test # - make -C ../tests/unit test && make -C ../tests/regress test
- name: "MacOSX brew" - name: "MacOSX brew"
os: osx os: osx
@ -241,12 +289,14 @@ matrix:
- export LDFLAGS="-m32" - export LDFLAGS="-m32"
- export LDFLAGS_STATIC="-m32" - export LDFLAGS_STATIC="-m32"
- export UNICORN_QEMU_FLAGS="--cpu=i386" - export UNICORN_QEMU_FLAGS="--cpu=i386"
before_cache: # before_cache:
- $msys2 pacman --sync --clean --noconfirm # - $msys2 pacman --sync --clean --noconfirm
cache: # cache:
directories: # timeout:
- $HOME/AppData/Local/Temp/chocolatey # 1000
- /C/tools/msys64 # directories:
# - $HOME/AppData/Local/Temp/chocolatey
# - /C/tools/msys64
script: script:
- $shell make header; $shell make; cp unicorn.dll /C/Windows/SysWOW64/; $shell make test - $shell make header; $shell make; cp unicorn.dll /C/Windows/SysWOW64/; $shell make test
@ -283,12 +333,14 @@ matrix:
- export CC=x86_64-w64-mingw32-gcc - export CC=x86_64-w64-mingw32-gcc
- export AR=gcc-ar - export AR=gcc-ar
- export RANLIB=gcc-ranlib - export RANLIB=gcc-ranlib
before_cache: # before_cache:
- $msys2 pacman --sync --clean --noconfirm # - $msys2 pacman --sync --clean --noconfirm
cache: # cache:
directories: # timeout:
- $HOME/AppData/Local/Temp/chocolatey # 1000
- /C/tools/msys64 # directories:
# - $HOME/AppData/Local/Temp/chocolatey
# - /C/tools/msys64
script: script:
- $shell make header; $shell make; cp unicorn.dll /C/Windows/System32/; $shell make test - $shell make header; $shell make; cp unicorn.dll /C/Windows/System32/; $shell make test
addons: addons:

View File

@ -63,9 +63,12 @@ if SYSTEM == 'darwin':
LIBRARY_FILE = "libunicorn.dylib" LIBRARY_FILE = "libunicorn.dylib"
MAC_LIBRARY_FILE = "libunicorn*.dylib" MAC_LIBRARY_FILE = "libunicorn*.dylib"
STATIC_LIBRARY_FILE = None STATIC_LIBRARY_FILE = None
elif SYSTEM in ('win32', 'cygwin'): elif SYSTEM == 'win32':
LIBRARY_FILE = "unicorn.dll" LIBRARY_FILE = "unicorn.dll"
STATIC_LIBRARY_FILE = "unicorn.lib" STATIC_LIBRARY_FILE = "unicorn.lib"
elif SYSTEM == 'cygwin':
LIBRARY_FILE = "cygunicorn.dll"
STATIC_LIBRARY_FILE = None
else: else:
LIBRARY_FILE = "libunicorn.so" LIBRARY_FILE = "libunicorn.so"
STATIC_LIBRARY_FILE = None STATIC_LIBRARY_FILE = None
@ -166,12 +169,7 @@ def build_libraries():
new_env = dict(os.environ) new_env = dict(os.environ)
new_env['UNICORN_BUILD_CORE_ONLY'] = 'yes' new_env['UNICORN_BUILD_CORE_ONLY'] = 'yes'
cmd = ['sh', './make.sh'] cmd = ['sh', './make.sh']
if SYSTEM == "cygwin": if SYSTEM == "win32":
if IS_64BITS:
cmd.append('cygwin-mingw64')
else:
cmd.append('cygwin-mingw32')
elif SYSTEM == "win32":
if IS_64BITS: if IS_64BITS:
cmd.append('cross-win64') cmd.append('cross-win64')
else: else:
@ -284,7 +282,7 @@ setup(
], ],
requires=['ctypes'], requires=['ctypes'],
cmdclass={'build': custom_build, 'develop': custom_develop, 'sdist': custom_sdist, 'bdist_egg': custom_bdist_egg}, cmdclass={'build': custom_build, 'develop': custom_develop, 'sdist': custom_sdist, 'bdist_egg': custom_bdist_egg},
zip_safe=True, zip_safe=False,
include_package_data=True, include_package_data=True,
is_pure=False, is_pure=False,
package_data={ package_data={