From f7c4aa0348cc2867ecef4e96e4d68d0df15668b1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 2 Oct 2018 17:36:30 -0700 Subject: [PATCH 01/13] (Partial) attempt to fix the plugin detection issue on MacOS --- macbuild/build4mac.py | 22 +++++++++++++++++++++- src/db/db/dbInit.cc | 2 ++ src/lay/lay/layInit.cc | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index 69bb4784a..cce1ac842 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -581,6 +581,10 @@ def DeployBinariesForBundle(): # | +-- '*.dylib' # +-- MacOS/+ # | +-- 'klayout' + # | +-- 'db_plugins'/+ + # | +-- '*.dylib' + # | +-- 'lay_plugins'/+ + # | +-- '*.dylib' # +-- Buddy/+ # +-- 'strm2cif' # +-- 'strm2dxf' @@ -631,7 +635,7 @@ def DeployBinariesForBundle(): # : #------------------------------------------------------------------------------- os.chdir( targetDirF ) - dynamicLinkLibs = glob.glob( AbsMacBinDir + "/*.dylib" ) + dynamicLinkLibs = glob.glob( os.path.join( AbsMacBinDir, "*.dylib" ) ) depDicOrdinary = {} # inter-library dependency dictionary for item in dynamicLinkLibs: if os.path.isfile(item) and not os.path.islink(item): @@ -691,6 +695,22 @@ def DeployBinariesForBundle(): shutil.copy2( sourceDir1 + "/klayout", targetDirM ) shutil.copy2( sourceDir2 + "/klayout.icns", targetDirR ) + # copy the contents of the plugin directories to a place next to the application + # binary + for piDir in [ "db_plugins", "lay_plugins" ]: + os.makedirs( os.path.join( targetDirM, piDir ), exist_ok = True ) + dynamicLinkLibs = glob.glob( os.path.join( sourceDir3, piDir, "*.dylib" ) ) + for item in dynamicLinkLibs: + if os.path.isfile(item) and not os.path.islink(item): + #------------------------------------------------------------------- + # (A) Copy an ordinary *.dylib file here by changing the name + # to style (3) and set its mode to 0755 (sanity check). + #------------------------------------------------------------------- + fullName = os.path.basename(item).split('.') + # e.g. [ 'libklayout_lay', '0', '25', '0', 'dylib' ] + nameStyle3 = os.path.join( targetDirM, piDir, fullName[0] + "." + fullName[1] + ".dylib" ) + shutil.copy2( item, nameStyle3 ) + os.chmod( nameStyle3, 0o0755 ) os.chmod( targetDir0 + "/PkgInfo", 0o0644 ) os.chmod( targetDir0 + "/Info.plist", 0o0644 ) diff --git a/src/db/db/dbInit.cc b/src/db/db/dbInit.cc index 273f9913c..935363a52 100644 --- a/src/db/db/dbInit.cc +++ b/src/db/db/dbInit.cc @@ -129,6 +129,8 @@ void init (const std::vector &_paths) #if defined(_WIN32) pattern.set_case_sensitive (false); pattern = std::string ("*.dll"); +#elif defined(__APPLE__) + pattern = std::string ("*.dylib"); #else pattern = std::string ("*.so"); #endif diff --git a/src/lay/lay/layInit.cc b/src/lay/lay/layInit.cc index b6c8facf4..4262cb1f3 100644 --- a/src/lay/lay/layInit.cc +++ b/src/lay/lay/layInit.cc @@ -130,6 +130,8 @@ void init (const std::vector &_paths) #if defined(_WIN32) pattern.set_case_sensitive (false); pattern = std::string ("*.dll"); +#elif defined(__APPLE__) + pattern = std::string ("*.dylib"); #else pattern = std::string ("*.so"); #endif From d8b1808234c05447d401acad444169bee714dc22 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 2 Oct 2018 18:57:04 -0700 Subject: [PATCH 02/13] Enhanced the build script to properly set the library IDs This fix assigns proper library IDs and load paths for the dependent libraries even if they are distributed among several directories. This is in particular important for the stream and tool plugins which exist in a folder next to the application but have to refer to libraries from the Frameworks folder. The fix consists of extending the library analysis within build4mac.py and supplying an additional directory listing the target directories. --- macbuild/build4mac.py | 66 ++++++++++++++++++++++++++------------ macbuild/build4mac_util.py | 30 ++++++++++------- 2 files changed, 64 insertions(+), 32 deletions(-) diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index cce1ac842..c4b94c367 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -637,6 +637,7 @@ def DeployBinariesForBundle(): os.chdir( targetDirF ) dynamicLinkLibs = glob.glob( os.path.join( AbsMacBinDir, "*.dylib" ) ) depDicOrdinary = {} # inter-library dependency dictionary + pathDic = {} # paths to insert for each library for item in dynamicLinkLibs: if os.path.isfile(item) and not os.path.islink(item): #------------------------------------------------------------------- @@ -650,13 +651,54 @@ def DeployBinariesForBundle(): os.chmod( nameStyle3, 0o0755 ) #------------------------------------------------------------------- # (B) Then get inter-library dependencies + # Note that will pull all dependencies and sort them out later + # dropping those which don't have a path entry #------------------------------------------------------------------- - otoolCm = "otool -L %s | grep libklayout" % nameStyle3 + otoolCm = "otool -L %s | grep dylib" % nameStyle3 otoolOut = os.popen( otoolCm ).read() dependDic = DecomposeLibraryDependency(otoolOut) depDicOrdinary.update(dependDic) + #------------------------------------------------------------------- + # (C) This library goes into Frameworks, hence record it's path there + #------------------------------------------------------------------- + pathDic[nameStyle3] = "@executable_path/../Frameworks/" + nameStyle3 + + os.chdir(ProjectDir) + #------------------------------------------------------------------- + # copy the contents of the plugin directories to a place next to the application + # binary + #------------------------------------------------------------------- + for piDir in [ "db_plugins", "lay_plugins" ]: + os.makedirs( os.path.join( targetDirM, piDir ), exist_ok = True ) + dynamicLinkLibs = glob.glob( os.path.join( MacBinDir, piDir, "*.dylib" ) ) + for item in dynamicLinkLibs: + if os.path.isfile(item) and not os.path.islink(item): + #------------------------------------------------------------------- + # (A) Copy an ordinary *.dylib file here by changing the name + # to style (3) and set its mode to 0755 (sanity check). + #------------------------------------------------------------------- + fullName = os.path.basename(item).split('.') + # e.g. [ 'libklayout_lay', '0', '25', '0', 'dylib' ] + nameStyle3 = fullName[0] + "." + fullName[1] + ".dylib" + destPath = os.path.join( targetDirM, piDir, nameStyle3 ) + shutil.copy2( item, destPath ) + os.chmod( destPath, 0o0755 ) + #------------------------------------------------------------------- + # (B) Then get inter-library dependencies + # Note that will pull all dependencies and sort them out later + # dropping those which don't have a path entry + #------------------------------------------------------------------- + otoolCm = "otool -L %s | grep 'dylib'" % destPath + otoolOut = os.popen( otoolCm ).read() + dependDic = DecomposeLibraryDependency(otoolOut) + depDicOrdinary.update(dependDic) + #------------------------------------------------------------------- + # (C) This library goes into the plugin dir + #------------------------------------------------------------------- + pathDic[nameStyle3] = "@executable_path/" + piDir + "/" + nameStyle3 + ''' - PrintLibraryDependencyDictionary( depDicOrdinary, "Style (3)" ) + PrintLibraryDependencyDictionary( depDicOrdinary, pathDic, "Style (3)" ) exit() ''' @@ -666,7 +708,8 @@ def DeployBinariesForBundle(): # and make the library aware of the locations of libraries # on which it depends; that is, inter-library dependency #------------------------------------------------------------- - ret = SetChangeIdentificationNameOfDyLib( depDicOrdinary ) + os.chdir( targetDirF ) + ret = SetChangeIdentificationNameOfDyLib( depDicOrdinary, pathDic ) if not ret == 0: msg = "!!! Failed to set and change to new identification names !!!" print(msg) @@ -695,23 +738,6 @@ def DeployBinariesForBundle(): shutil.copy2( sourceDir1 + "/klayout", targetDirM ) shutil.copy2( sourceDir2 + "/klayout.icns", targetDirR ) - # copy the contents of the plugin directories to a place next to the application - # binary - for piDir in [ "db_plugins", "lay_plugins" ]: - os.makedirs( os.path.join( targetDirM, piDir ), exist_ok = True ) - dynamicLinkLibs = glob.glob( os.path.join( sourceDir3, piDir, "*.dylib" ) ) - for item in dynamicLinkLibs: - if os.path.isfile(item) and not os.path.islink(item): - #------------------------------------------------------------------- - # (A) Copy an ordinary *.dylib file here by changing the name - # to style (3) and set its mode to 0755 (sanity check). - #------------------------------------------------------------------- - fullName = os.path.basename(item).split('.') - # e.g. [ 'libklayout_lay', '0', '25', '0', 'dylib' ] - nameStyle3 = os.path.join( targetDirM, piDir, fullName[0] + "." + fullName[1] + ".dylib" ) - shutil.copy2( item, nameStyle3 ) - os.chmod( nameStyle3, 0o0755 ) - os.chmod( targetDir0 + "/PkgInfo", 0o0644 ) os.chmod( targetDir0 + "/Info.plist", 0o0644 ) os.chmod( targetDirM + "/klayout", 0o0755 ) diff --git a/macbuild/build4mac_util.py b/macbuild/build4mac_util.py index 17aa26a2c..aefaed85d 100755 --- a/macbuild/build4mac_util.py +++ b/macbuild/build4mac_util.py @@ -59,15 +59,18 @@ def DecomposeLibraryDependency( depstr ): # @param[in] depdic dictionary # @param[in] namedic dictionary name #------------------------------------------------------------------------------ -def PrintLibraryDependencyDictionary( depdic, namedic ): +def PrintLibraryDependencyDictionary( depdic, pathdic, namedic ): keys = depdic.keys() print("") print("##### Contents of <%s> #####:" % namedic ) for key in keys: supporters = depdic[key] - print( " %s:" % key ) + keyName = os.path.basename(key) + print( " %s: (%s)" % (key, pathdic[keyName]) ) for item in supporters: - print( " %s" % item ) + itemName = os.path.basename(item) + if itemName != keyName and (itemName in pathdic): + print( " %s (%s)" % (item, pathdic[itemName]) ) #------------------------------------------------------------------------------ ## To set and change identification name of KLayout's dylib @@ -76,7 +79,7 @@ def PrintLibraryDependencyDictionary( depdic, namedic ): # # @return 0 on success; non-zero on failure #------------------------------------------------------------------------------ -def SetChangeIdentificationNameOfDyLib( libdic ): +def SetChangeIdentificationNameOfDyLib( libdic, pathDic ): cmdNameId = XcodeToolChain['nameID'] cmdNameChg = XcodeToolChain['nameCH'] dependentLibs = libdic.keys() @@ -86,7 +89,8 @@ def SetChangeIdentificationNameOfDyLib( libdic ): # [1] Set the identification name of each dependent library #----------------------------------------------------------- nameOld = "%s" % lib - nameNew = "@executable_path/../Frameworks/%s" % lib + libName = os.path.basename(lib) + nameNew = pathDic[libName] command = "%s %s %s" % ( cmdNameId, nameNew, nameOld ) if subprocess.call( command, shell=True ) != 0: msg = "!!! Failed to set the new identification name to <%s> !!!" @@ -98,13 +102,15 @@ def SetChangeIdentificationNameOfDyLib( libdic ): #------------------------------------------------------------------------- supporters = libdic[lib] for sup in supporters: - nameOld = "%s" % sup - nameNew = "@executable_path/../Frameworks/%s" % sup - command = "%s %s %s %s" % ( cmdNameChg, nameOld, nameNew, lib ) - if subprocess.call( command, shell=True ) != 0: - msg = "!!! Failed to make the library aware of the new identification name <%s> of supporter <%s> !!!" - print( msg % (nameNew, sup), file=sys.stderr ) - return 1 + supName = os.path.basename(sup) + if libName != supName and (supName in pathDic): + nameOld = "%s" % sup + nameNew = pathDic[supName] + command = "%s %s %s %s" % ( cmdNameChg, nameOld, nameNew, lib ) + if subprocess.call( command, shell=True ) != 0: + msg = "!!! Failed to make the library aware of the new identification name <%s> of supporter <%s> !!!" + print( msg % (nameNew, sup), file=sys.stderr ) + return 1 # for-lib return 0 From 4ffcaba5d1c8615dae872f794cfbfcd8c9f5e9eb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 4 Oct 2018 14:10:22 -0700 Subject: [PATCH 03/13] Important bug fix for MacOS Unlike Linux, RTTI does not work in MacOS/clang when the classes originate from different compile units. I think that Linux's C++ runtime not only checks for identical vtable, but alternatively for same name. On MacOS, dynamic_cast will fail instead. This fix solves this issue by placing the important steam format option specializations into a single specific shared object (the DB plugin). --- src/plugins/streamers/cif/db_plugin/dbCIFFormat.h | 5 +++-- src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h | 5 +++-- src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h | 5 +++-- src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h b/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h index 00164ba83..9cf8a225f 100644 --- a/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h +++ b/src/plugins/streamers/cif/db_plugin/dbCIFFormat.h @@ -25,6 +25,7 @@ #include "dbSaveLayoutOptions.h" #include "dbLoadLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class CIFReaderOptions +class DB_PLUGIN_PUBLIC CIFReaderOptions : public FormatSpecificReaderOptions { public: @@ -118,7 +119,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class CIFWriterOptions +class DB_PLUGIN_PUBLIC CIFWriterOptions : public FormatSpecificWriterOptions { public: diff --git a/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h b/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h index 3939795e4..35a6173d0 100644 --- a/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h +++ b/src/plugins/streamers/dxf/db_plugin/dbDXFFormat.h @@ -25,6 +25,7 @@ #include "dbLoadLayoutOptions.h" #include "dbSaveLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class DXFReaderOptions +class DB_PLUGIN_PUBLIC DXFReaderOptions : public FormatSpecificReaderOptions { public: @@ -192,7 +193,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class DXFWriterOptions +class DB_PLUGIN_PUBLIC DXFWriterOptions : public FormatSpecificWriterOptions { public: diff --git a/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h b/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h index 9d16b0856..9daf7056c 100644 --- a/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h +++ b/src/plugins/streamers/gds2/db_plugin/dbGDS2Format.h @@ -25,6 +25,7 @@ #include "dbSaveLayoutOptions.h" #include "dbLoadLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class GDS2ReaderOptions +class DB_PLUGIN_PUBLIC GDS2ReaderOptions : public FormatSpecificReaderOptions { public: @@ -97,7 +98,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class GDS2WriterOptions +class DB_PLUGIN_PUBLIC GDS2WriterOptions : public FormatSpecificWriterOptions { public: diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h b/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h index 4dfa13376..be9235159 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h +++ b/src/plugins/streamers/oasis/db_plugin/dbOASISFormat.h @@ -25,6 +25,7 @@ #include "dbSaveLayoutOptions.h" #include "dbLoadLayoutOptions.h" +#include "dbPluginCommon.h" namespace db { @@ -34,7 +35,7 @@ namespace db * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class OASISReaderOptions +class DB_PLUGIN_PUBLIC OASISReaderOptions : public FormatSpecificReaderOptions { public: @@ -92,7 +93,7 @@ public: * NOTE: this structure is non-public linkage by intention. This way it's instantiated * in all compile units and the shared object does not need to be linked. */ -class OASISWriterOptions +class DB_PLUGIN_PUBLIC OASISWriterOptions : public FormatSpecificWriterOptions { public: From 96be601da96a72b2d9f406b15b7082b125846818 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Wed, 3 Oct 2018 17:35:35 -0400 Subject: [PATCH 04/13] improving build process. tentative fix to python3 osx10.11 --- .travis.yml | 4 ++-- Makefile | 6 ++++++ macbuild/build4mac.py | 6 +++--- travis-build.sh | 14 +++++++++----- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 42f0d13f6..58c0ad03e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,11 +58,11 @@ matrix: os: osx osx_image: xcode8 # macOS 10.11 env: - - MATRIX_EVAL="shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - MATRIX_EVAL="rvm list; rvm use ruby-2.3.0; brew install python3; brew unlink python && brew link --overwrite python;" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - PYTHON_BUILD=true - - BREW_BUNDLE=true + - BREW_BUNDLE=false - name: "klayout python3.6 package" os: linux diff --git a/Makefile b/Makefile index 1654c3d96..ca70b1697 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,12 @@ GITCOMMIT := $(shell git rev-parse --short HEAD) KLAYOUT_VERSION := $(shell source version.sh && echo $$KLAYOUT_VERSION) +ifndef PYTHON_VERSION + PYTHON_VERSION := B37 +endif +ifndef MACOS_VERSION + MACOS_VERSION := HighSierra +endif .ONESHELL: diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index c4b94c367..ecb45e658 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -661,7 +661,7 @@ def DeployBinariesForBundle(): #------------------------------------------------------------------- # (C) This library goes into Frameworks, hence record it's path there #------------------------------------------------------------------- - pathDic[nameStyle3] = "@executable_path/../Frameworks/" + nameStyle3 + pathDic[nameStyle3] = "@executable_path/../Frameworks/" + nameStyle3 os.chdir(ProjectDir) #------------------------------------------------------------------- @@ -695,8 +695,8 @@ def DeployBinariesForBundle(): #------------------------------------------------------------------- # (C) This library goes into the plugin dir #------------------------------------------------------------------- - pathDic[nameStyle3] = "@executable_path/" + piDir + "/" + nameStyle3 - + pathDic[nameStyle3] = "@executable_path/" + piDir + "/" + nameStyle3 + ''' PrintLibraryDependencyDictionary( depDicOrdinary, pathDic, "Style (3)" ) exit() diff --git a/travis-build.sh b/travis-build.sh index d3ad7b9a3..b988d0745 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -6,12 +6,16 @@ export PING_SLEEP=30s bash -c "while true; do echo -n '.'; sleep $PING_SLEEP; done" & PING_LOOP_PID=$! -make build >> build.txt 2>&1 -make deploy >> build.txt 2>&1 -make test >> build.txt 2>&1 || true -make dropbox-deploy +touch build.txt -tail -500 build.txt +echo "build" +make build >> build.txt 2>&1 || tail -500 build.txt +echo "deploy" +make deploy >> build.txt 2>&1 || tail -500 build.txt +echo "test" +make test >> build.txt 2>&1 || tail -500 build.txt +echo "dropbox-deploy" +make dropbox-deploy echo "build finished" From b995c67a2653079d70a3780c839a646d02609497 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Thu, 4 Oct 2018 08:55:09 -0400 Subject: [PATCH 05/13] os.makedirs has no exist_ok in python2 --- macbuild/build4mac.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index ecb45e658..6f41c7ef9 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -669,7 +669,7 @@ def DeployBinariesForBundle(): # binary #------------------------------------------------------------------- for piDir in [ "db_plugins", "lay_plugins" ]: - os.makedirs( os.path.join( targetDirM, piDir ), exist_ok = True ) + os.makedirs( os.path.join( targetDirM, piDir )) dynamicLinkLibs = glob.glob( os.path.join( MacBinDir, piDir, "*.dylib" ) ) for item in dynamicLinkLibs: if os.path.isfile(item) and not os.path.islink(item): From c213aeaab023caabb458ad0431230fbef9e27df7 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Fri, 5 Oct 2018 10:23:24 -0400 Subject: [PATCH 06/13] fixing ut_runner by adding DYLD_LIBRARY_PATH to env varas --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ca70b1697..a8e1d727b 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,7 @@ test: ln -s klayout.app/Contents/MacOS/klayout klayout; \ export TESTTMP=testtmp; \ export TESTSRC=..; \ + export DYLD_LIBRARY_PATH=.:db_plugins/:lay_plugins/; \ ./ut_runner -h || true; \ cd .. From a7a01ac09a88ab1e2ab94c69299a3ea0ca77e2f2 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sat, 6 Oct 2018 21:22:08 -0400 Subject: [PATCH 07/13] changing pymod version to 0.26.0.dev0 (read commit message) I am going to test uploading klayout as module to pypi, but it requires unique naming. Therefore, there can only be one klayout-0.26.0 version. Only stable versions ("releases") should ever be uploaded. bugfix-patched versions should be named 0.26.0.post1 etc. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bf862b4e1..175e152b4 100644 --- a/setup.py +++ b/setup.py @@ -191,7 +191,8 @@ class Config(object): """ Gets the version string """ - return "0.26" + return "0.26.0.dev0" + config = Config() From c36bd53d5bcfea7af1ffc0dd6c8ff8526aefebb8 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 7 Oct 2018 12:51:37 -0400 Subject: [PATCH 08/13] Build fixes. Bumping pymod version to 0.26.0.dev1 Improvements to pypi package. Attempting to build macos10.11 version with py3. --- .travis.yml | 2 +- setup.py | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 58c0ad03e..1d03cf301 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,7 @@ matrix: os: osx osx_image: xcode8 # macOS 10.11 env: - - MATRIX_EVAL="rvm list; rvm use ruby-2.3.0; brew install python3; brew unlink python && brew link --overwrite python;" + - MATRIX_EVAL="rvm list; rvm use ruby-2.3.0; brew install python3; brew unlink python && brew link --overwrite python3;" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - PYTHON_BUILD=true diff --git a/setup.py b/setup.py index 175e152b4..f7b4d2c44 100644 --- a/setup.py +++ b/setup.py @@ -191,7 +191,7 @@ class Config(object): """ Gets the version string """ - return "0.26.0.dev0" + return "0.26.0.dev1" config = Config() @@ -346,11 +346,14 @@ rdb = Extension(config.root + '.rdb', # Core setup function if __name__ == '__main__': - setup(name = config.root, - version = config.version(), - description = 'KLayout standalone Python package', - author = 'Matthias Koefferlein', - author_email = 'matthias@klayout.de', - packages = [config.root], - package_dir = {config.root: 'src/pymod/distutils_src'}, - ext_modules = [_tl, _gsi, _pya, _db, _rdb] + db_plugins + [tl, db, rdb]) + setup(name=config.root, + version=config.version(), + license='GNU GPLv3', + description='KLayout standalone Python package', + long_description='TODO', + author='Matthias Koefferlein', + author_email='matthias@klayout.de', + url='https://github.com/klayoutmatthias/klayout', + packages=[config.root], + package_dir={config.root: 'src/pymod/distutils_src'}, + ext_modules=[_tl, _gsi, _pya, _db, _rdb] + db_plugins + [tl, db, rdb]) From 53504a5d7ebdaaaf4417520e8374515e1d759cb5 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 7 Oct 2018 13:19:12 -0400 Subject: [PATCH 09/13] Fixing brew install bug due to ruby version mismatch. Refer to https://github.com/Homebrew/brew/issues/3299 Bug seen in https://travis-ci.org/lightwave-lab/klayout/jobs/438311059#L187 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1d03cf301..7bb698ed4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,7 @@ matrix: os: osx osx_image: xcode8 # macOS 10.11 env: - - MATRIX_EVAL="rvm list; rvm use ruby-2.3.0; brew install python3; brew unlink python && brew link --overwrite python3;" + - MATRIX_EVAL="rvm list; rvm use ruby-2.3.0; brew update; brew config; brew upgrade python; brew unlink python && brew link --overwrite python;" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - PYTHON_BUILD=true From 5d7bb7d60eef35518cc2a63500d375590c2ce2ef Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 7 Oct 2018 14:10:51 -0400 Subject: [PATCH 10/13] attempting python package for python3.6.5_1 osx10.13 --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7bb698ed4..64fcf72af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,16 @@ matrix: - PIP_UPDATE="1" - PYTHON_BUILD=true - BREW_BUNDLE=true + + - name: "klayout python3.6.5_1 osx10.13" + os: osx + osx_image: xcode9.4 # macOS 10.13 + env: + - MATRIX_EVAL="brew update; brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb; brew switch python 3.6.5_1; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - ARCHFLAGS="-std=c++11" + - PIP_UPDATE="1" + - PYTHON_BUILD=true + - BREW_BUNDLE=false - name: "klayout python3 osx10.12" os: osx From b617bafb8c1b38a594a236db2f31db5693d52b99 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 7 Oct 2018 14:12:20 -0400 Subject: [PATCH 11/13] Fixing brew install bug due to ruby version mismatch. (cont'd) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 64fcf72af..c2eb2bff7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,7 @@ matrix: os: osx osx_image: xcode8 # macOS 10.11 env: - - MATRIX_EVAL="rvm list; rvm use ruby-2.3.0; brew update; brew config; brew upgrade python; brew unlink python && brew link --overwrite python;" + - MATRIX_EVAL="brew update; brew config; brew upgrade python; echo $PATH; ls -la /usr/local/bin; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - PYTHON_BUILD=true From b168a3f52c2d46df5f56b0aeda46bac1780c3af3 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 7 Oct 2018 16:15:13 -0400 Subject: [PATCH 12/13] macos10.11 version with py3. annoying --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c2eb2bff7..bf36da99c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,7 @@ matrix: os: osx osx_image: xcode8 # macOS 10.11 env: - - MATRIX_EVAL="brew update; brew config; brew upgrade python; echo $PATH; ls -la /usr/local/bin; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - MATRIX_EVAL="brew update; brew config; brew upgrade python; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - PYTHON_BUILD=true From 5521c6664a8be0b643c1e22b32048e78c2416744 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sun, 7 Oct 2018 16:45:43 -0400 Subject: [PATCH 13/13] macos10.11 version with py3. annoying2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bf36da99c..691fa5f30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,7 @@ matrix: os: osx osx_image: xcode8 # macOS 10.11 env: - - MATRIX_EVAL="brew update; brew config; brew upgrade python; shopt -s expand_aliases; alias python='python3'; alias pip='pip3';" + - MATRIX_EVAL="brew update; brew config; brew upgrade python;" - ARCHFLAGS="-std=c++11" - PIP_UPDATE="1" - PYTHON_BUILD=true