diff --git a/.travis.yml b/.travis.yml index a8a374a71..d6397e35d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,44 +1,71 @@ matrix: include: - # python 3 osx - - os: osx + # python 2 osx + + - name: "klayout python2 osx10.13" + os: osx osx_image: xcode9.4 # macOS 10.13 env: - MATRIX_EVAL="" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - - os: osx + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + - name: "klayout python2 osx10.12" + os: osx osx_image: xcode8.3 # macOS 10.12 env: - MATRIX_EVAL="brew install python2 || brew link --overwrite python@2" # deficient python2 in travis's xcode8.3 (no ssl) - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - - os: osx + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + - name: "klayout python2 osx10.11" + os: osx osx_image: xcode8 # macOS 10.11 env: - MATRIX_EVAL="" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - # python 2 osx - - os: osx + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + # python 3 osx + + - name: "klayout python3 osx10.13" + os: osx osx_image: xcode9.4 # macOS 10.13 env: - - MATRIX_EVAL="brew update; brew bundle; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - - os: osx + - PYTHON_BUILD=true + - BREW_BUNDLE=true + + - name: "klayout python3 osx10.12" + os: osx osx_image: xcode8.3 # macOS 10.12 env: - - MATRIX_EVAL="brew update; brew bundle; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - - os: osx + - PYTHON_BUILD=true + - BREW_BUNDLE=true + + - name: "klayout python3 osx10.11" + os: osx osx_image: xcode8 # macOS 10.11 env: - - MATRIX_EVAL="brew update; brew bundle; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - - os: linux + - PYTHON_BUILD=true + - BREW_BUNDLE=true + + - name: "klayout python3.6 package" + os: linux dist: trusty # Ubuntu 14.04 sudo: false language: python @@ -46,7 +73,11 @@ matrix: env: - MATRIX_EVAL="" - PIP_UPDATE="1" - - os: linux + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + - name: "klayout python2.7 package" + os: linux dist: trusty # Ubuntu 14.04 sudo: false language: python @@ -54,7 +85,11 @@ matrix: env: - MATRIX_EVAL="" - PIP_UPDATE="1" - - os: linux + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + - name: "klayout python2.6 package" + os: linux dist: trusty # Ubuntu 14.04 sudo: false language: python @@ -62,7 +97,11 @@ matrix: env: - MATRIX_EVAL="" - PIP_UPDATE="0" # setuptools installed from last pip has syntax error on py 2.6 - - os: linux + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + - name: "klayout python3.3 package" + os: linux dist: trusty # Ubuntu 14.04 sudo: false language: python @@ -70,7 +109,11 @@ matrix: env: - MATRIX_EVAL="" - PIP_UPDATE="1" - - os: linux + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + - name: "klayout python3.4 package" + os: linux dist: trusty # Ubuntu 14.04 sudo: false language: python @@ -78,7 +121,11 @@ matrix: env: - MATRIX_EVAL="" - PIP_UPDATE="1" - - os: linux + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + - name: "klayout python3.5 package" + os: linux dist: trusty # Ubuntu 14.04 sudo: false language: python @@ -86,12 +133,82 @@ matrix: env: - MATRIX_EVAL="" - PIP_UPDATE="1" + - PYTHON_BUILD=true + - BREW_BUNDLE=false + + # KLayout builds for mac + # Python 3 + - name: "KLayout macOS 10.13 with py3.7" + os: osx + osx_image: xcode9.4 # macOS 10.13 + env: + - MATRIX_EVAL="" + - PYTHON_VERSION=B37 + - MACOS_VERSION=HighSierra + - KLAYOUT_BUILD=true + - BREW_BUNDLE=true + + - name: "KLayout macOS 10.12 with py3.7" + os: osx + osx_image: xcode8.3 # macOS 10.12 + env: + - MATRIX_EVAL="" + - PYTHON_VERSION=B37 + - MACOS_VERSION=Sierra + - KLAYOUT_BUILD=true + - BREW_BUNDLE=true + + - name: "KLayout macOS 10.11 with py3.7" + os: osx + osx_image: xcode8 # macOS 10.11 + env: + - MATRIX_EVAL="" + - PYTHON_VERSION=B37 + - MACOS_VERSION=ElCapitan + - KLAYOUT_BUILD=true + - BREW_BUNDLE=true + + # Python 2 + - name: "KLayout macOS 10.13 with py2.7" + os: osx + osx_image: xcode9.4 # macOS 10.13 + env: + - MATRIX_EVAL="" + - PYTHON_VERSION=Sys + - MACOS_VERSION=HighSierra + - KLAYOUT_BUILD=true + - BREW_BUNDLE=true + + - name: "KLayout macOS 10.12 with py2.7" + os: osx + osx_image: xcode8.3 # macOS 10.12 + env: + - MATRIX_EVAL="" + - PYTHON_VERSION=Sys + - MACOS_VERSION=Sierra + - KLAYOUT_BUILD=true + - BREW_BUNDLE=true + + - name: "KLayout macOS 10.11 with py2.7" + os: osx + osx_image: xcode8 # macOS 10.11 + env: + - MATRIX_EVAL="" + - PYTHON_VERSION=Sys + - MACOS_VERSION=ElCapitan + - KLAYOUT_BUILD=true + - BREW_BUNDLE=true before_install: - env - rvm install ruby --latest - gem install dropbox-deployment - eval "${MATRIX_EVAL}" + - if [ "$BREW_BUNDLE" = true ]; then + find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' | xargs grep 'EOS.undent' --files-with-matches | xargs sed -i '' 's/EOS.undent/EOS/'; + brew update; + brew bundle; + fi - if [ "${PIP_UPDATE}" == "1" ]; then pip --version; pip install --upgrade pip || sudo pip install --upgrade pip; @@ -100,15 +217,20 @@ before_install: fi - python -c "import distutils.sysconfig as sysconfig; print(sysconfig.__file__)" -install: - - python setup.py build - - python setup.py bdist_wheel - - python setup.py install - -script: - - python -c 'import klayout.db as db; print(dir(db))' - - python -c 'import klayout.rdb as rdb; print(dir(rdb))' - - python -c 'import klayout.tl as tl; print(dir(tl))' +script: + - if [ "$PYTHON_BUILD" = true ]; then + python setup.py build; + python setup.py bdist_wheel; + python setup.py install; + cp -a dist deploy/; + python -c 'import klayout.db as db; print(dir(db))'; + python -c 'import klayout.rdb as rdb; print(dir(rdb))'; + python -c 'import klayout.tl as tl; print(dir(tl))'; + fi + - if [ "$KLAYOUT_BUILD" = true ]; then + ./travis-build.sh; + fi after_success: + - mkdir -p deploy - dropbox-deployment diff --git a/Brewfile b/Brewfile index f84c801df..0d5580505 100644 --- a/Brewfile +++ b/Brewfile @@ -1,2 +1,4 @@ tap "homebrew/core" brew "python3" +brew "python@2", link: false +brew "qt" diff --git a/Changelog b/Changelog index cd4730eb6..698178bb2 100644 --- a/Changelog +++ b/Changelog @@ -5,11 +5,18 @@ For details see: https://github.com/klayoutmatthias/klayout/wiki/klayout---Standalone-KLayout-Python-Module -0.25.5 (2018-12-30): +0.25.5 (2018-09-19): * YET TO BE RELEASED * Bugfix: https://github.com/klayoutmatthias/klayout/issues/162 GDS2 LIBNAME was not maintained on "File/Save". +* Bugfix: https://github.com/klayoutmatthias/klayout/issues/166 + Internal error when writing GDS files (breaking of polygons) +* Bugfix: some potential memory corruption issues fixed + During the efforts for making the code base compatible + with MSVC, some potential candidates for memory corruption + have been identified and fixed. + These fixes are included in this release. 0.25.4 (2018-08-25): * Bugfix: https://github.com/klayoutmatthias/klayout/issues/121 diff --git a/Changelog.Debian b/Changelog.Debian index 9a8ba729a..3a3334371 100644 --- a/Changelog.Debian +++ b/Changelog.Debian @@ -6,9 +6,10 @@ klayout (0.26-1) unstable; urgency=low klayout (0.25.5-1) unstable; urgency=low - * YET TO BE RELEASED + * New features and bugfixes + - See changelog - -- Matthias Köfferlein Sat, 30 Dec 2018 23:15:23 +0200 + -- Matthias Köfferlein Wed, 19 Sep 2018 22:04:35 +0200 klayout (0.25.4-1) unstable; urgency=low diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..beb2faf49 --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +.PHONY: help build deploy test dropbox-deploy + +GITCOMMIT := $(shell git rev-parse --short HEAD) +KLAYOUT_VERSION := $(shell source version.sh && echo $$KLAYOUT_VERSION) + +.ONESHELL: + +default: help + +help: + @echo "For Mac OS only" + @echo "make build PYTHON_VERSION=B37" + @echo "make deploy PYTHON_VERSION=B37" + @echo "make test MACOS_VERSION=HighSierra" + @echo "Valid Mac OS Versions: [Yosemite, ElCapitan, Sierra, HighSierra]" + @echo "Valid Python Version: [nil, Sys, B37]" + +build: + @echo "Building for Mac $(GITCOMMIT)" + ./build4mac.py -p $(PYTHON_VERSION) -q Qt5Brew -c; \ + ./build4mac.py -p $(PYTHON_VERSION) -q Qt5Brew + +deploy: + @echo "Deploying 4 Mac $(GITCOMMIT)" + ./build4mac.py -p $(PYTHON_VERSION) -q Qt5Brew -y + +test: + @echo "Testing 4 Mac $(GITCOMMIT)" + qt5.pkg.macos-$(MACOS_VERSION)-release/klayout.app/Contents/MacOS/klayout -b -r test-pylib-script.py; \ + cd qt5.build.macos-$(MACOS_VERSION)-release; \ + ln -s klayout.app/Contents/MacOS/klayout klayout; \ + export TESTTMP=testtmp; \ + export TESTSRC=..; \ + ./ut_runner -h || true; \ + cd .. + +dropbox-deploy: + @echo "Preparing for dropbox deployment $(MACOS_VERSION) $(GITCOMMIT)" + mkdir -p deploy; \ + pwd; \ + ls -lah; \ + touch build.txt; \ + cp build.txt deploy/qt5.pkg.macos-$(MACOS_VERSION)-$(PYTHON_VERSION)-release-$(KLAYOUT_VERSION)-$(GITCOMMIT).log.txt; \ + hdiutil convert macbuild/Resources/klayoutDMGTemplate.dmg -format UDRW -o work-KLayout.dmg; \ + hdiutil resize -size 500m work-KLayout.dmg; \ + hdiutil attach work-KLayout.dmg -readwrite -noverify -quiet -mountpoint tempKLayout -noautoopen; \ + cp -a qt5.pkg.macos-$(MACOS_VERSION)-release/ tempKLayout/; \ + hdiutil detach tempKLayout; \ + hdiutil convert work-KLayout.dmg -format UDZO -imagekey zlib-level=9 -o deploy/qt5.pkg.macos-$(MACOS_VERSION)-$(PYTHON_VERSION)-release-$(KLAYOUT_VERSION)-$(GITCOMMIT).dmg; \ + md5 -q deploy/qt5.pkg.macos-$(MACOS_VERSION)-$(PYTHON_VERSION)-release-$(KLAYOUT_VERSION)-$(GITCOMMIT).dmg > deploy/qt5.pkg.macos-$(MACOS_VERSION)-$(PYTHON_VERSION)-release-$(KLAYOUT_VERSION)-$(GITCOMMIT).dmg.md5; \ + rm work-KLayout.dmg diff --git a/dropbox-deployment.yml b/dropbox-deployment.yml index 945f867d8..f9ee0f21b 100644 --- a/dropbox-deployment.yml +++ b/dropbox-deployment.yml @@ -1,4 +1,4 @@ deploy: - dropbox_path: /Builds/klayout-pymod # The path to the folder on Dropbox where the files will go - artifacts_path: dist # can be a single file, or a path + dropbox_path: /Builds/klayout # The path to the folder on Dropbox where the files will go + artifacts_path: deploy # can be a single file, or a path debug: true # if you want to see more logs diff --git a/macbuild/ReadMe.md b/macbuild/ReadMe.md index f03e3ca97..9ea112376 100644 --- a/macbuild/ReadMe.md +++ b/macbuild/ReadMe.md @@ -31,7 +31,7 @@ Also by default, supported script languages, i.e, Ruby and Python, are those sta You may want to use a non-OS-standard script language such as Python 3.6 from Anaconda2 (https://www.anaconda.com/download/#macos) in combination with KLayout. Since Anaconda2 is a popular Python development environment, this is worth trying. Unfortunately, however, some dynamic linkage problems are observed as of today. -On the other hand, Python 3.6 provided by MacPorts or Homebrew is usable. +On the other hand, Python 3.7 provided by MacPorts or Homebrew is usable. Please try this (refer to 3B below or Section #5) if you feel it's useful. # 3. Use-cases @@ -90,20 +90,20 @@ $ ./makeDMG4mac.py -p qt5.pkg.macos-HighSierra-release -m # 5. Alternative building options -### 5.1 Python 3.6 from Homebrew, Qt 5.10.1 from Homebrew +### 5.1 Python 3.7 from Homebrew, Qt 5.10.1 from Homebrew Homebrew's installation of python3 (`brew install python3`) places a `Python.framework` in `/usr/local/opt/python/Frameworks/Python.framework/`, which you can use to build KLayout from. Qt can also be downloaded from brew with `brew install qt`. ``` # Build step -./build4mac.py -p B36 -q Qt5Brew +./build4mac.py -p B37 -q Qt5Brew # build with log -./build4mac.py -p B36 -q Qt5Brew 2>&1 | tee qt5.build.macos-HighSierra-release-version.log +./build4mac.py -p B37 -q Qt5Brew 2>&1 | tee qt5.build.macos-HighSierra-release-version.log # Deploy step -./build4mac.py -p B36 -q Qt5Brew -y # normal deploy -./build4mac.py -p B36 -q Qt5Brew -y -v 3 2>&1 | tee qt5.pkg.macos-HighSierra-release.log # deploy with debug options +./build4mac.py -p B37 -q Qt5Brew -y # normal deploy +./build4mac.py -p B37 -q Qt5Brew -y -v 3 2>&1 | tee qt5.pkg.macos-HighSierra-release.log # deploy with debug options # Packaging step ./makeDMG4mac.py -p qt5.pkg.macos-HighSierra-release -m -q Qt5101 diff --git a/macbuild/Resources/klayoutDMGTemplate.dmg b/macbuild/Resources/klayoutDMGTemplate.dmg new file mode 100644 index 000000000..8ad28f4ad Binary files /dev/null and b/macbuild/Resources/klayoutDMGTemplate.dmg differ diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index 907226d2e..69bb4784a 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -67,7 +67,7 @@ def SetGlobals(): Usage += " : Refer to 'macbuild/build4mac_env.py' for details | \n" Usage += " [-q|--qt ] : type=['Qt4MacPorts', 'Qt5MacPorts', 'Qt5Brew'] | qt5macports \n" Usage += " [-r|--ruby ] : type=['nil', 'Sys', 'Src24', 'MP24', 'B25'] | sys \n" - Usage += " [-p|--python ] : type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36', 'B36'] | sys \n" + Usage += " [-p|--python ] : type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36', 'B37'] | sys \n" Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n" Usage += " [-m|--make