Merge branch 'master' into wip

This commit is contained in:
Matthias Koefferlein 2024-07-22 21:34:12 +02:00
commit 16abeb2bdc
23 changed files with 710 additions and 165 deletions

View File

@ -1,3 +1,6 @@
0.29.4 (2024-07-08):
* Bug: %GITHUB%/issues/1780 Crash on deleting multiple selected shapes or items
0.29.3 (2024-07-06): 0.29.3 (2024-07-06):
* Bug: %GITHUB%/issues/1774 ImportError: cannot import name '__version__' from 'klayout' * Bug: %GITHUB%/issues/1774 ImportError: cannot import name '__version__' from 'klayout'
* Bug: %GITHUB%/issues/1771 Python exception formatting: backtrace missing for Python >=3.11.7 * Bug: %GITHUB%/issues/1771 Python exception formatting: backtrace missing for Python >=3.11.7

View File

@ -1,3 +1,10 @@
klayout (0.29.4-1) unstable; urgency=low
* New features and bugfixes
- See changelog
-- Matthias Köfferlein <matthias@koefferlein.de> Mon, 08 Jul 2024 19:05:32 +0200
klayout (0.29.3-1) unstable; urgency=low klayout (0.29.3-1) unstable; urgency=low
* New features and bugfixes * New features and bugfixes

View File

@ -1,6 +1,6 @@
Relevant KLayout version: 0.29.2<br> Relevant KLayout version: 0.29.4<br>
Author: Kazzz-S<br> Author: Kazzz-S<br>
Last modified: 2024-06-09<br> Last modified: 2024-07-10<br>
# 1. Introduction # 1. Introduction
This directory **`macbuild`** contains various files required for building KLayout (http://www.klayout.de/) version 0.29.0 or later for different 64-bit macOS, including: This directory **`macbuild`** contains various files required for building KLayout (http://www.klayout.de/) version 0.29.0 or later for different 64-bit macOS, including:
@ -61,7 +61,7 @@ You need to have the followings:
# 5. Command-line options of **`build4mac.py`** # 5. Command-line options of **`build4mac.py`**
**`build4mac.py`** is the top level Python script for for building KLayout for a macOS. **`build4mac.py`** is the top level Python script for building KLayout for a macOS.
The operating system type is detected automatically. The operating system type is detected automatically.
``` ```
@ -102,7 +102,7 @@ $ [python] ./build4mac.py
[-u|--noqtuitools] : don't include uitools in Qt binding | disabled [-u|--noqtuitools] : don't include uitools in Qt binding | disabled
[-g|--nolibgit2] : don't include libgit2 for Git package support | disabled [-g|--nolibgit2] : don't include libgit2 for Git package support | disabled
[-m|--make <option>] : option passed to 'make' | '--jobs=4' [-m|--make <option>] : option passed to 'make' | '--jobs=4'
[-d|--debug] : enable debug mode build | disabled [-d|--debug] : enable debug mode build; AddressSanitizer (ASAN) is linked | disabled
[-c|--checkcom] : check command-line and exit without building | disabled [-c|--checkcom] : check command-line and exit without building | disabled
[-y|--deploy] : deploy executables and dylibs, including Qt's Frameworks | disabled [-y|--deploy] : deploy executables and dylibs, including Qt's Frameworks | disabled
[-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled [-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled
@ -189,10 +189,8 @@ $ ./build4mac.py -q qt5macports -r mp33 -p mp311 -Y
4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation. 4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation.
### 6C. Fully Homebrew-flavored build with Homebrew Ruby 3.3 and Homebrew Python 3.11 ### 6C. Fully Homebrew-flavored build with Homebrew Ruby 3.3 and Homebrew Python 3.11
> [!CAUTION] > [!IMPORTANT]
> To build KLayout >= 0.29.0, you need "Qt6" to address [the compilation issue](https://github.com/KLayout/klayout/issues/1599).<br> > To build KLayout >= 0.29.0, you need "Qt6" >= 6.7.0 to address [the compilation issue](https://github.com/KLayout/klayout/issues/1599).<br>
> However, the current KLayout is not compliant with the latest Qt6.7.0, so you will get another compilation error.<br>
> Therefore, this section will be disabled for the time being.
0. Install Homebrew, then install Qt6, Ruby 3.3, Python 3.11, and libgit2 by 0. Install Homebrew, then install Qt6, Ruby 3.3, Python 3.11, and libgit2 by
``` ```
@ -225,10 +223,8 @@ $ ./build4mac.py -q qt6brew -r hb33 -p hb311 -Y
4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation. 4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation.
### 6D. Partially Homebrew-flavored build with System Ruby and Homebrew Python 3.11 ### 6D. Partially Homebrew-flavored build with System Ruby and Homebrew Python 3.11
> [!CAUTION] > [!IMPORTANT]
> To build KLayout >= 0.29.0, you need "Qt6" to address [the compilation issue](https://github.com/KLayout/klayout/issues/1599).<br> > To build KLayout >= 0.29.0, you need "Qt6" >= 6.7.0 to address [the compilation issue](https://github.com/KLayout/klayout/issues/1599).<br>
> However, the current KLayout is not compliant with the latest Qt6.7.0, so you will get another compilation error.<br>
> Therefore, this section will be disabled for the time being.
0. Install Homebrew, then install Qt6, Python 3.11, and libgit2 by 0. Install Homebrew, then install Qt6, Python 3.11, and libgit2 by
``` ```
@ -263,7 +259,7 @@ $ ./build4mac.py -q qt6brew -r sys -p hb311 -y
### 6E. Heterogeneous combination of MacPorts Qt5, System Ruby, and Homebrew Python 3.11 ### 6E. Heterogeneous combination of MacPorts Qt5, System Ruby, and Homebrew Python 3.11
> [!IMPORTANT] > [!IMPORTANT]
> This is a practical solution for building an HW*.dmg package. > This is another practical solution for building a popular HW*.dmg package.
0. Install MacPorts, then install Qt5 and libgit2 by 0. Install MacPorts, then install Qt5 and libgit2 by
``` ```
@ -347,7 +343,37 @@ A sample content (`*.app.Bash`) of the script bundle can be found in `Resources/
---- ----
# 7. Making a DMG installer # 7. QA Tests
You can optionally conduct QA tests using the `ut_runner` executable.<br>
[This forum post](https://www.klayout.de/forum/discussion/comment/11012/#Comment_11012) provides information on the unit tests, mainly for Linux.
In the macOS environment, the QA test working directory is `[ST|LW|HB]-build_directory.macQAT`, where you will find `macQAT.py`, a wrapper script for the `ut_runner` executable.<br>
Some required environment variables including `TESTSRC`, `TESTTMP`, and `DYLD_LIBRARY_PATH` are set by `macQAT.py`.<br>
1. Change directory to `[ST|LW|HB]-build_directory.macQAT`
```
cd [ST|LW|HB]-build_directory.macQAT
```
2. To print usage of `ut_runner`, run `macQAT.py` with '-u'
```
./macQAT.py -u
```
3. To start the KLayout main GUI window, run `macQAT.py` with '-k'
```
./macQAT.py -k
```
4. To normally run `ut_runner`, invoke `macQAT.py` with '-r'
```
./macQAT.py -r
```
If required, you can use the `-x <test>` option to skip some erroneous tests.
----
# 8. Making a DMG installer
You can make a DMG installer using another Python script **`makeDMG4mac.py`**.<br> You can make a DMG installer using another Python script **`makeDMG4mac.py`**.<br>
This script requires a directory generated by **`build4mac.py`** with the [-y|-Y] option (refer to 6B through 6E). This script requires a directory generated by **`build4mac.py`** with the [-y|-Y] option (refer to 6B through 6E).

View File

@ -80,7 +80,7 @@ def GenerateUsage(platform):
usage += " [-u|--noqtuitools] : don't include uitools in Qt binding | disabled\n" usage += " [-u|--noqtuitools] : don't include uitools in Qt binding | disabled\n"
usage += " [-g|--nolibgit2] : don't include libgit2 for Git package support | disabled\n" usage += " [-g|--nolibgit2] : don't include libgit2 for Git package support | disabled\n"
usage += " [-m|--make <option>] : option passed to 'make' | '--jobs=4'\n" usage += " [-m|--make <option>] : option passed to 'make' | '--jobs=4'\n"
usage += " [-d|--debug] : enable debug mode build | disabled\n" usage += " [-d|--debug] : enable debug mode build; AddressSanitizer (ASAN) is linked | disabled\n"
usage += " [-c|--checkcom] : check command-line and exit without building | disabled\n" usage += " [-c|--checkcom] : check command-line and exit without building | disabled\n"
usage += " [-y|--deploy] : deploy executables and dylibs, including Qt's Frameworks | disabled\n" usage += " [-y|--deploy] : deploy executables and dylibs, including Qt's Frameworks | disabled\n"
usage += " [-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled\n" usage += " [-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled\n"
@ -1007,6 +1007,7 @@ def Build_pymod_wheel(parameters):
# @return 0 on success; non-zero (1), otherwise # @return 0 on success; non-zero (1), otherwise
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
def Run_Build_Command(config, parameters): def Run_Build_Command(config, parameters):
DebugMode = config['DebugMode']
ModuleQt = config['ModuleQt'] ModuleQt = config['ModuleQt']
NoLibGit2 = config['NoLibGit2'] NoLibGit2 = config['NoLibGit2']
ToolDebug = config['ToolDebug'] ToolDebug = config['ToolDebug']
@ -1015,8 +1016,22 @@ def Run_Build_Command(config, parameters):
else: else:
jump2pymod_wheel = True jump2pymod_wheel = True
#-----------------------------------------------------------------
# [1] Use the AddressSanitizer (ASan) in the debug build.
# This environment variable is tested in ../src/klayout.pri.
#-----------------------------------------------------------------
try:
useAsan = os.environ['MAC_USE_ASAN']
except KeyError:
pass
else:
del os.environ['MAC_USE_ASAN']
if DebugMode:
os.environ['MAC_USE_ASAN'] = "1"
#----------------------------------------------------- #-----------------------------------------------------
# [1] Set two environment variables to use libgit2 # [2] Set two environment variables to use libgit2
#----------------------------------------------------- #-----------------------------------------------------
if not NoLibGit2: if not NoLibGit2:
# Using MacPorts # Using MacPorts
@ -1048,7 +1063,7 @@ def Run_Build_Command(config, parameters):
if not jump2pymod_wheel: if not jump2pymod_wheel:
#----------------------------------------------------- #-----------------------------------------------------
# [2] Set parameters passed to the main Bash script # [3] Set parameters passed to the main Bash script
#----------------------------------------------------- #-----------------------------------------------------
cmd_args = "" cmd_args = ""
@ -1106,7 +1121,7 @@ def Run_Build_Command(config, parameters):
cmd_args += " \\\n -nopython" cmd_args += " \\\n -nopython"
#----------------------------------------------------- #-----------------------------------------------------
# [3] Make the consolidated command line # [4] Make the consolidated command line
#----------------------------------------------------- #-----------------------------------------------------
command = "time" command = "time"
command += " \\\n %s" % parameters['build_cmd'] command += " \\\n %s" % parameters['build_cmd']
@ -1119,7 +1134,7 @@ def Run_Build_Command(config, parameters):
sys.exit(0) sys.exit(0)
#----------------------------------------------------- #-----------------------------------------------------
# [4] Invoke the main Bash script; takes time:-) # [5] Invoke the main Bash script; takes time:-)
#----------------------------------------------------- #-----------------------------------------------------
myscript = os.path.basename(__file__) myscript = os.path.basename(__file__)
ret = subprocess.call( command, shell=True ) ret = subprocess.call( command, shell=True )
@ -1138,7 +1153,7 @@ def Run_Build_Command(config, parameters):
print( "", file=sys.stderr ) print( "", file=sys.stderr )
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# [5] Prepare "*.macQAT/" directory for the QATest. # [6] Prepare "*.macQAT/" directory for the QATest.
# Binaries under "*.macQAT/" such as *.dylib will be touched later. # Binaries under "*.macQAT/" such as *.dylib will be touched later.
#------------------------------------------------------------------------ #------------------------------------------------------------------------
print( "### Preparing <%s>" % MacBuildDirQAT ) print( "### Preparing <%s>" % MacBuildDirQAT )
@ -1177,7 +1192,7 @@ def Run_Build_Command(config, parameters):
print( "", file=sys.stderr ) print( "", file=sys.stderr )
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# [6] Build <pymod> for some predetermined environments on demand # [7] Build <pymod> for some predetermined environments on demand
#------------------------------------------------------------------------ #------------------------------------------------------------------------
BuildPymodWhl = parameters['BuildPymodWhl'] BuildPymodWhl = parameters['BuildPymodWhl']
if BuildPymodWhl: if BuildPymodWhl:

View File

@ -182,7 +182,7 @@ RubySonoma = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/
# install with 'sudo port install ruby33' # install with 'sudo port install ruby33'
# [Key Type Name] = 'MP33' # [Key Type Name] = 'MP33'
Ruby33MacPorts = { 'exe': '/opt/local/bin/ruby3.3', Ruby33MacPorts = { 'exe': '/opt/local/bin/ruby3.3',
'inc': '/opt/local/include/ruby-3.3.3', 'inc': '/opt/local/include/ruby-3.3.4',
'lib': '/opt/local/lib/libruby.3.3.dylib' 'lib': '/opt/local/lib/libruby.3.3.dylib'
} }

View File

@ -216,7 +216,9 @@ def ExportEnvVariables():
MyEnviron[ 'TESTTMP' ] = WorkDir MyEnviron[ 'TESTTMP' ] = WorkDir
if System == "Darwin": if System == "Darwin":
MyEnviron[ 'DYLD_LIBRARY_PATH' ] = "%s:%s/db_plugins:%s/lay_plugins:%s/pymod" % (ProjectDir, ProjectDir, ProjectDir, ProjectDir) MyEnviron[ 'DYLD_LIBRARY_PATH' ] = "%s:%s/db_plugins:%s/lay_plugins:%s/pymod" % (ProjectDir, ProjectDir, ProjectDir, ProjectDir)
for env in [ 'TESTSRC', 'TESTTMP', 'DYLD_LIBRARY_PATH' ]: MyEnviron[ 'MallocNanoZone' ] = "0"
MyEnviron[ 'ASAN_OPTIONS' ] = "ast_unwind_on_malloc=0:verbosity=1:detect_leaks=0:abort_on_error=0:halt_on_error=0:symbolize=1"
for env in [ 'TESTSRC', 'TESTTMP', 'DYLD_LIBRARY_PATH', 'MallocNanoZone', 'ASAN_OPTIONS' ]:
os.environ[env] = MyEnviron[env] os.environ[env] = MyEnviron[env]
else: else:
MyEnviron[ 'LD_LIBRARY_PATH' ] = "%s:%s/db_plugins:%s/lay_plugins:%s/pymod" % (ProjectDir, ProjectDir, ProjectDir, ProjectDir) MyEnviron[ 'LD_LIBRARY_PATH' ] = "%s:%s/db_plugins:%s/lay_plugins:%s/pymod" % (ProjectDir, ProjectDir, ProjectDir, ProjectDir)

View File

@ -49,6 +49,7 @@ def SetGlobals():
global DMGSerialNum # the DMG serial number global DMGSerialNum # the DMG serial number
global PackagePrefix # the package prefix: LW-', 'HW-', or 'EX-' global PackagePrefix # the package prefix: LW-', 'HW-', or 'EX-'
global QtIdentification # Qt identification global QtIdentification # Qt identification
global BuildType # build type ['release', 'debug']
global RubyPythonID # Ruby- and Python-identification global RubyPythonID # Ruby- and Python-identification
global KLVersion # KLayout's version global KLVersion # KLayout's version
global OccupiedDS # approx. occupied disc space global OccupiedDS # approx. occupied disc space
@ -144,6 +145,7 @@ def SetGlobals():
DMGSerialNum = 1 DMGSerialNum = 1
PackagePrefix = "" PackagePrefix = ""
QtIdentification = "" QtIdentification = ""
BuildType = ""
RubyPythonID = "" RubyPythonID = ""
KLVersion = GetKLayoutVersionFrom( "./version.sh" ) KLVersion = GetKLayoutVersionFrom( "./version.sh" )
OccupiedDS = -1 OccupiedDS = -1
@ -236,6 +238,7 @@ def CheckPkgDirectory():
global BundleName global BundleName
global PackagePrefix global PackagePrefix
global QtIdentification global QtIdentification
global BuildType
global RubyPythonID global RubyPythonID
global BackgroundPNG global BackgroundPNG
global LatestOSMacPorts global LatestOSMacPorts
@ -270,7 +273,8 @@ def CheckPkgDirectory():
# * ST-qt6MP.pkg.macos-Monterey-release-RsysPsys # * ST-qt6MP.pkg.macos-Monterey-release-RsysPsys
# * LW-qt6MP.pkg.macos-Monterey-release-Rmp33Pmp311 # * LW-qt6MP.pkg.macos-Monterey-release-Rmp33Pmp311
#----------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------
patQRP = u'(ST|LW|HW|EX)([-])([qt5|qt6][0-9A-Za-z]+)([.]pkg[.])([A-Za-z]+[-][A-Za-z]+[-]release[-])([0-9A-Za-z]+)' # 0 1 2 3 4 5 6 7
patQRP = u'(ST|LW|HW|EX)([-])([qt5|qt6][0-9A-Za-z]+)([.]pkg[.])([A-Za-z]+[-][A-Za-z]+[-])(release|debug)([-])([0-9A-Za-z]+)'
regQRP = re.compile(patQRP) regQRP = re.compile(patQRP)
if not regQRP.match(PkgDir): if not regQRP.match(PkgDir):
print( "! Cannot identify (Qt, Ruby, Python) from the package directory name" ) print( "! Cannot identify (Qt, Ruby, Python) from the package directory name" )
@ -283,7 +287,6 @@ def CheckPkgDirectory():
pkgdirComponents = regQRP.match(PkgDir).groups() pkgdirComponents = regQRP.match(PkgDir).groups()
PackagePrefix = pkgdirComponents[0] PackagePrefix = pkgdirComponents[0]
QtIdentification = pkgdirComponents[2] QtIdentification = pkgdirComponents[2]
RubyPythonID = pkgdirComponents[5]
if QtIdentification.find('qt5') == 0: if QtIdentification.find('qt5') == 0:
BackgroundPNG = "KLayoutDMG-BackQt5.png" BackgroundPNG = "KLayoutDMG-BackQt5.png"
elif QtIdentification.find('qt6') == 0: elif QtIdentification.find('qt6') == 0:
@ -291,6 +294,14 @@ def CheckPkgDirectory():
else: else:
BackgroundPNG = None BackgroundPNG = None
raise Exception( "! neither qt5 nor qt6" ) raise Exception( "! neither qt5 nor qt6" )
if pkgdirComponents[5] == 'release':
BuildType = 'release'
elif pkgdirComponents[5] == 'debug':
BuildType = 'debug'
else:
BuildType = None
raise Exception( "! neither release nor debug" )
RubyPythonID = pkgdirComponents[7]
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# [3] Check if the "LatestOS" with MacPorts / Homebrew / Anaconda3 # [3] Check if the "LatestOS" with MacPorts / Homebrew / Anaconda3
@ -435,6 +446,7 @@ def ParseCommandLineArguments():
global UnsafePkg global UnsafePkg
global PackagePrefix global PackagePrefix
global QtIdentification global QtIdentification
global BuildType
global RubyPythonID global RubyPythonID
global KLVersion global KLVersion
global OccupiedDS global OccupiedDS
@ -532,6 +544,8 @@ def ParseCommandLineArguments():
% (PackagePrefix, KLVersion, GenOSName, Platform, DMGSerialNum, QtIdentification, RubyPythonID) % (PackagePrefix, KLVersion, GenOSName, Platform, DMGSerialNum, QtIdentification, RubyPythonID)
if Machine == "arm64": # with an Apple Silicon Chip if Machine == "arm64": # with an Apple Silicon Chip
TargetDMG = Machine + TargetDMG TargetDMG = Machine + TargetDMG
if BuildType == "debug": # in the case of 'debug' build
TargetDMG = "debug-" + TargetDMG
return return
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -607,7 +621,7 @@ def MakeTargetDMGFile(msg=""):
#---------------------------------------------------- #----------------------------------------------------
if os.path.exists(WorkDMG): if os.path.exists(WorkDMG):
os.remove(WorkDMG) os.remove(WorkDMG)
dmgsize = OccupiedDS + 20 # approx. occupied size plus 20[MB] dmgsize = OccupiedDS + int(0.2*OccupiedDS) # approx. occupied size plus 20[%]
cmdline = 'hdiutil create -srcfolder %s -volname %s -fs HFS+ -fsargs "-c c=64,a=16,e=16" ' cmdline = 'hdiutil create -srcfolder %s -volname %s -fs HFS+ -fsargs "-c c=64,a=16,e=16" '
cmdline += '-format UDRW -size %dm %s' cmdline += '-format UDRW -size %dm %s'
command = cmdline % (PkgDir, VolumeDMG, dmgsize, WorkDMG) command = cmdline % (PkgDir, VolumeDMG, dmgsize, WorkDMG)

View File

@ -78,8 +78,8 @@ def Get_Build_Target_Dict():
# @param[in] platform platform name # @param[in] platform platform name
# #
# @return (dictionary1, dictionary2)-tupple # @return (dictionary1, dictionary2)-tupple
# dictionary1: key=(qtVer, mnemonic), value=build option list # dictionary1: key=(qtVer, mnemonic, bdType), value=build option list
# dictionary2: key=(qtVer, mnemonic), value=log file name # dictionary2: key=(qtVer, mnemonic, bdType), value=log file name
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
def Get_Build_Options( targetDic, platform ): def Get_Build_Options( targetDic, platform ):
buildOp = dict() buildOp = dict()
@ -94,38 +94,61 @@ def Get_Build_Options( targetDic, platform ):
for key in targetDic.keys(): for key in targetDic.keys():
target = targetDic[key] target = targetDic[key]
if target == "std": if target == "std":
buildOp[(qtVer, "std")] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'sys' ] buildOp[(qtVer, "std", "r")] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'sys' ]
logfile[(qtVer, "std")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPsys") logfile[(qtVer, "std", "r")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPsys")
buildOp[(qtVer, "std", "d")] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'sys', '--debug' ]
logfile[(qtVer, "std", "d")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "RsysPsys")
elif target == "ports": elif target == "ports":
buildOp[(qtVer, "ports")] = [ '-q', '%sMacPorts' % qtType, '-r', 'MP33', '-p', 'MP311' ] buildOp[(qtVer, "ports", "r")] = [ '-q', '%sMacPorts' % qtType, '-r', 'MP33', '-p', 'MP311' ]
logfile[(qtVer, "ports")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rmp33Pmp311") logfile[(qtVer, "ports", "r")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rmp33Pmp311")
buildOp[(qtVer, "ports", "d")] = [ '-q', '%sMacPorts' % qtType, '-r', 'MP33', '-p', 'MP311', '--debug' ]
logfile[(qtVer, "ports", "d")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "Rmp33Pmp311")
elif target == "brew": elif target == "brew":
buildOp[(qtVer, "brew")] = [ '-q', '%sBrew' % qtType, '-r', 'HB33', '-p', 'HB311' ] buildOp[(qtVer, "brew", "r")] = [ '-q', '%sBrew' % qtType, '-r', 'HB33', '-p', 'HB311' ]
logfile[(qtVer, "brew")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb33Phb311") logfile[(qtVer, "brew", "r")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb33Phb311")
buildOp[(qtVer, "brew", "d")] = [ '-q', '%sBrew' % qtType, '-r', 'HB33', '-p', 'HB311', '--debug' ]
logfile[(qtVer, "brew", "d")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "Rhb33Phb311")
elif target == "brewHW": elif target == "brewHW":
buildOp[(qtVer, "brewHW")] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HB311' ] buildOp[(qtVer, "brewHW", "r")] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HB311' ]
logfile[(qtVer, "brewHW")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhb311") logfile[(qtVer, "brewHW", "r")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhb311")
buildOp[(qtVer, "brewHW", "d")] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HB311', '--debug' ]
logfile[(qtVer, "brewHW", "d")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "RsysPhb311")
elif target == "ana3": elif target == "ana3":
buildOp[(qtVer, "ana3")] = [ '-q', '%sAna3' % qtType, '-r', 'Ana3', '-p', 'Ana3' ] buildOp[(qtVer, "ana3", "r")] = [ '-q', '%sAna3' % qtType, '-r', 'Ana3', '-p', 'Ana3' ]
logfile[(qtVer, "ana3")] = "%sAna3.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rana3Pana3") logfile[(qtVer, "ana3", "r")] = "%sAna3.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rana3Pana3")
buildOp[(qtVer, "ana3", "d")] = [ '-q', '%sAna3' % qtType, '-r', 'Ana3', '-p', 'Ana3', '--debug' ]
logfile[(qtVer, "ana3", "d")] = "%sAna3.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "Rana3Pana3")
elif target == "brewA": elif target == "brewA":
buildOp[(qtVer, "brewA")] = [ '-q', '%sBrew' % qtType, '-r', 'HB33', '-p', 'HBAuto' ] buildOp[(qtVer, "brewA", "r")] = [ '-q', '%sBrew' % qtType, '-r', 'HB33', '-p', 'HBAuto' ]
logfile[(qtVer, "brewA")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb33Phbauto") logfile[(qtVer, "brewA", "r")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb33Phbauto")
buildOp[(qtVer, "brewA", "d")] = [ '-q', '%sBrew' % qtType, '-r', 'HB33', '-p', 'HBAuto', '--debug' ]
logfile[(qtVer, "brewA", "d")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "Rhb33Phbauto")
elif target == "brewAHW": elif target == "brewAHW":
buildOp[(qtVer, "brewAHW")] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HBAuto' ] buildOp[(qtVer, "brewAHW", "r")] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HBAuto' ]
logfile[(qtVer, "brewAHW")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhbauto") logfile[(qtVer, "brewAHW", "r")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhbauto")
buildOp[(qtVer, "brewAHW", "d")] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HBAuto', '--debug' ]
logfile[(qtVer, "brewAHW", "d")] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "RsysPhbauto")
elif target == "pbrew": elif target == "pbrew":
buildOp[(qtVer, "pbrew")] = [ '-q', '%sMacPorts' % qtType, '-r', 'HB33', '-p', 'HB311' ] buildOp[(qtVer, "pbrew", "r")] = [ '-q', '%sMacPorts' % qtType, '-r', 'HB33', '-p', 'HB311' ]
logfile[(qtVer, "pbrew")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb33Phb311") logfile[(qtVer, "pbrew", "r")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb33Phb311")
buildOp[(qtVer, "pbrew", "d")] = [ '-q', '%sMacPorts' % qtType, '-r', 'HB33', '-p', 'HB311', '--debug' ]
logfile[(qtVer, "pbrew", "d")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "Rhb33Phb311")
elif target == "pbrewHW": elif target == "pbrewHW":
buildOp[(qtVer, "pbrewHW")] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'HB311' ] buildOp[(qtVer, "pbrewHW", "r")] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'HB311' ]
logfile[(qtVer, "pbrewHW")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhb311") logfile[(qtVer, "pbrewHW", "r")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhb311")
buildOp[(qtVer, "pbrewHW", "d")] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'HB311', '--debug' ]
logfile[(qtVer, "pbrewHW", "d")] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "debug", "RsysPhb311")
if WithPymod: if WithPymod:
buildOp[(qtVer,"ports")] = buildOp[(qtVer,"ports")] + ['--buildPymod'] buildOp[(qtVer, "ports", "r")] = buildOp[(qtVer, "ports", "r")] + ['--buildPymod']
buildOp[(qtVer,"brew")] = buildOp[(qtVer,"brew")] + ['--buildPymod'] buildOp[(qtVer, "brew", "r")] = buildOp[(qtVer, "brew", "r")] + ['--buildPymod']
buildOp[(qtVer,"ana3")] = buildOp[(qtVer,"ana3")] + ['--buildPymod'] buildOp[(qtVer, "ana3", "r")] = buildOp[(qtVer, "ana3", "r")] + ['--buildPymod']
buildOp[(qtVer,"pbrew")] = buildOp[(qtVer,"pbrew")] + ['--buildPymod'] buildOp[(qtVer, "pbrew", "r")] = buildOp[(qtVer, "pbrew", "r")] + ['--buildPymod']
buildOp[(qtVer, "ports", "d")] = buildOp[(qtVer, "ports", "d")]
buildOp[(qtVer, "brew", "d")] = buildOp[(qtVer, "brew", "d")]
buildOp[(qtVer, "ana3", "d")] = buildOp[(qtVer, "ana3", "d")]
buildOp[(qtVer, "pbrew", "d")] = buildOp[(qtVer, "pbrew", "d")]
return (buildOp, logfile) return (buildOp, logfile)
@ -135,7 +158,7 @@ def Get_Build_Options( targetDic, platform ):
# @param[in] targetDic build target dictionary # @param[in] targetDic build target dictionary
# @param[in] platform platform name # @param[in] platform platform name
# #
# @return a dictionary; key=(qtVer, mnemonic), value=".macQAT" directory # @return a dictionary; key=(qtVer, mnemonic, bdType), value=".macQAT" directory
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
def Get_QAT_Directory( targetDic, platform ): def Get_QAT_Directory( targetDic, platform ):
dirQAT = dict() dirQAT = dict()
@ -149,23 +172,32 @@ def Get_QAT_Directory( targetDic, platform ):
for key in targetDic.keys(): for key in targetDic.keys():
target = targetDic[key] target = targetDic[key]
if target == "std": if target == "std":
dirQAT[(qtVer, "std")] = '%sMP.build.macos-%s-release-RsysPsys.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "std", "r")] = '%sMP.build.macos-%s-release-RsysPsys.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "std", "d")] = '%sMP.build.macos-%s-debug-RsysPsys.macQAT' % (qtType.lower(), platform)
elif target == "ports": elif target == "ports":
dirQAT[(qtVer, "ports")] = '%sMP.build.macos-%s-release-Rmp33Pmp311.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "ports", "r")] = '%sMP.build.macos-%s-release-Rmp33Pmp311.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "ports", "d")] = '%sMP.build.macos-%s-debug-Rmp33Pmp311.macQAT' % (qtType.lower(), platform)
elif target == "brew": elif target == "brew":
dirQAT[(qtVer, "brew")] = '%sBrew.build.macos-%s-release-Rhb33Phb311.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "brew", "r")] = '%sBrew.build.macos-%s-release-Rhb33Phb311.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "brew", "d")] = '%sBrew.build.macos-%s-debug-Rhb33Phb311.macQAT' % (qtType.lower(), platform)
elif target == "brewHW": elif target == "brewHW":
dirQAT[(qtVer, "brewHW")] = '%sBrew.build.macos-%s-release-RsysPhb311.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "brewHW", "r")] = '%sBrew.build.macos-%s-release-RsysPhb311.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "brewHW", "d")] = '%sBrew.build.macos-%s-debug-RsysPhb311.macQAT' % (qtType.lower(), platform)
elif target == "ana3": elif target == "ana3":
dirQAT[(qtVer, "ana3")] = '%sAna3.build.macos-%s-release-Rana3Pana3.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "ana3", "r")] = '%sAna3.build.macos-%s-release-Rana3Pana3.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "ana3", "d")] = '%sAna3.build.macos-%s-debug-Rana3Pana3.macQAT' % (qtType.lower(), platform)
elif target == "brewA": elif target == "brewA":
dirQAT[(qtVer, "brewA")] = '%sBrew.build.macos-%s-release-Rhb33Phbauto.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "brewA", "r")] = '%sBrew.build.macos-%s-release-Rhb33Phbauto.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "brewA", "d")] = '%sBrew.build.macos-%s-debug-Rhb33Phbauto.macQAT' % (qtType.lower(), platform)
elif target == "brewAHW": elif target == "brewAHW":
dirQAT[(qtVer, "brewAHW")] = '%sBrew.build.macos-%s-release-RsysPhbauto.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "brewAHW", "r")] = '%sBrew.build.macos-%s-release-RsysPhbauto.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "brewAHW", "d")] = '%sBrew.build.macos-%s-debug-RsysPhbauto.macQAT' % (qtType.lower(), platform)
elif target == "pbrew": elif target == "pbrew":
dirQAT[(qtVer, "pbrew")] = '%sMP.build.macos-%s-release-Rhb33Phb311.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "pbrew", "r")] = '%sMP.build.macos-%s-release-Rhb33Phb311.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "pbrew", "d")] = '%sMP.build.macos-%s-debug-Rhb33Phb311.macQAT' % (qtType.lower(), platform)
elif target == "pbrewHW": elif target == "pbrewHW":
dirQAT[(qtVer, "pbrewHW")] = '%sMP.build.macos-%s-release-RsysPhb311.macQAT' % (qtType.lower(), platform) dirQAT[(qtVer, "pbrewHW", "r")] = '%sMP.build.macos-%s-release-RsysPhb311.macQAT' % (qtType.lower(), platform)
dirQAT[(qtVer, "pbrewHW", "d")] = '%sMP.build.macos-%s-debug-RsysPhb311.macQAT' % (qtType.lower(), platform)
return dirQAT return dirQAT
@ -177,7 +209,7 @@ def Get_QAT_Directory( targetDic, platform ):
# @param[in] srlDMG serial number of DMG # @param[in] srlDMG serial number of DMG
# @param[in] makeflag True to make; False to clean # @param[in] makeflag True to make; False to clean
# #
# @return a dictionary; key=(qtVer, mnemonic), value=build option list # @return a dictionary; key=(qtVer, mnemonic, bdType), value=build option list
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
def Get_Package_Options( targetDic, platform, srlDMG, makeflag ): def Get_Package_Options( targetDic, platform, srlDMG, makeflag ):
packOp = dict() packOp = dict()
@ -196,31 +228,49 @@ def Get_Package_Options( targetDic, platform, srlDMG, makeflag ):
for key in targetDic.keys(): for key in targetDic.keys():
target = targetDic[key] target = targetDic[key]
if target == "std": if target == "std":
packOp[(qtVer, "std")] = [ '-p', 'ST-%sMP.pkg.macos-%s-release-RsysPsys' % (qtType.lower(), platform), packOp[(qtVer, "std", "r")] = [ '-p', 'ST-%sMP.pkg.macos-%s-release-RsysPsys' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "std", "d")] = [ '-p', 'ST-%sMP.pkg.macos-%s-debug-RsysPsys' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "ports": elif target == "ports":
packOp[(qtVer, "ports")] = [ '-p', 'LW-%sMP.pkg.macos-%s-release-Rmp33Pmp311' % (qtType.lower(), platform), packOp[(qtVer, "ports", "r")] = [ '-p', 'LW-%sMP.pkg.macos-%s-release-Rmp33Pmp311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "ports", "d")] = [ '-p', 'LW-%sMP.pkg.macos-%s-debug-Rmp33Pmp311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "brew": elif target == "brew":
packOp[(qtVer, "brew")] = [ '-p', 'LW-%sBrew.pkg.macos-%s-release-Rhb33Phb311' % (qtType.lower(), platform), packOp[(qtVer, "brew", "r")] = [ '-p', 'LW-%sBrew.pkg.macos-%s-release-Rhb33Phb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "brew", "d")] = [ '-p', 'LW-%sBrew.pkg.macos-%s-debug-Rhb33Phb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "brewHW": elif target == "brewHW":
packOp[(qtVer, "brewHW")] = [ '-p', 'HW-%sBrew.pkg.macos-%s-release-RsysPhb311' % (qtType.lower(), platform), packOp[(qtVer, "brewHW", "r")] = [ '-p', 'HW-%sBrew.pkg.macos-%s-release-RsysPhb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "brewHW", "d")] = [ '-p', 'HW-%sBrew.pkg.macos-%s-debug-RsysPhb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "ana3": elif target == "ana3":
packOp[(qtVer, "ana3")] = [ '-p', 'LW-%sAna3.pkg.macos-%s-release-Rana3Pana3' % (qtType.lower(), platform), packOp[(qtVer, "ana3", "r")] = [ '-p', 'LW-%sAna3.pkg.macos-%s-release-Rana3Pana3' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "ana3", "d")] = [ '-p', 'LW-%sAna3.pkg.macos-%s-debug-Rana3Pana3' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "brewA": elif target == "brewA":
packOp[(qtVer, "brewA")] = [ '-p', 'LW-%sBrew.pkg.macos-%s-release-Rhb33Phbauto' % (qtType.lower(), platform), packOp[(qtVer, "brewA", "r")] = [ '-p', 'LW-%sBrew.pkg.macos-%s-release-Rhb33Phbauto' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "brewA", "d")] = [ '-p', 'LW-%sBrew.pkg.macos-%s-debug-Rhb33Phbauto' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "brewAHW": elif target == "brewAHW":
packOp[(qtVer, "brewAHW")] = [ '-p', 'HW-%sBrew.pkg.macos-%s-release-RsysPhbauto' % (qtType.lower(), platform), packOp[(qtVer, "brewAHW", "r")] = [ '-p', 'HW-%sBrew.pkg.macos-%s-release-RsysPhbauto' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "brewAHW", "d")] = [ '-p', 'HW-%sBrew.pkg.macos-%s-debug-RsysPhbauto' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "pbrew": elif target == "pbrew":
packOp[(qtVer, "pbrew")] = [ '-p', 'LW-%sMP.pkg.macos-%s-release-Rhb33Phb311' % (qtType.lower(), platform), packOp[(qtVer, "pbrew", "r")] = [ '-p', 'LW-%sMP.pkg.macos-%s-release-Rhb33Phb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "pbrew", "d")] = [ '-p', 'LW-%sMP.pkg.macos-%s-debug-Rhb33Phb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
elif target == "pbrewHW": elif target == "pbrewHW":
packOp[(qtVer, "pbrewHW")] = [ '-p', 'HW-%sMP.pkg.macos-%s-release-RsysPhb311' % (qtType.lower(), platform), packOp[(qtVer, "pbrewHW", "r")] = [ '-p', 'HW-%sMP.pkg.macos-%s-release-RsysPhb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ]
packOp[(qtVer, "pbrewHW", "d")] = [ '-p', 'HW-%sMP.pkg.macos-%s-debug-RsysPhb311' % (qtType.lower(), platform),
'-s', '%d' % srlDMG, '%s' % flag ] '-s', '%d' % srlDMG, '%s' % flag ]
return packOp return packOp
@ -231,7 +281,7 @@ def Parse_CommandLine_Arguments():
global Usage # usage global Usage # usage
global QtType # Qt type global QtType # Qt type
global Target # target list global Target # target list
global QtTarget # list of (Qt, target)-tuple global QtTarget # list of (Qt, target, bdType)-tuple
global Build # operation flag global Build # operation flag
global WithPymod # operation flag global WithPymod # operation flag
global QATest # operation flag global QATest # operation flag
@ -262,13 +312,14 @@ def Parse_CommandLine_Arguments():
Usage += " [--target <list>] : 0='std', 1='ports', 2='brew', 3='brewHW', 4='ana3', | '%s'\n" % targetopt Usage += " [--target <list>] : 0='std', 1='ports', 2='brew', 3='brewHW', 4='ana3', | '%s'\n" % targetopt
Usage += " 5='brewA', 6='brewAHW', 12='pbrew', 13='pbrewHW' |\n" Usage += " 5='brewA', 6='brewAHW', 12='pbrew', 13='pbrewHW' |\n"
Usage += " * with --qt=6, use --target='0,1,2,3' (4 is ignored) |\n" Usage += " * with --qt=6, use --target='0,1,2,3' (4 is ignored) |\n"
Usage += " [--qttarget <tuple list>] : ex. '5,1' for qt=5, target=1 | disabled\n" Usage += " [--qttarget <tuple list>] : ex. '5,1,r'| qt=5, target=1, bdType='r' | disabled\n"
Usage += " '5,4,d', '6,4,r', and '6,4,d' are omitted |\n"
Usage += " + This option supersedes, if used, the --qt and --target combination. |\n" Usage += " + This option supersedes, if used, the --qt and --target combination. |\n"
Usage += " + You can use this option multiple times. |\n" Usage += " + You can use this option multiple times. |\n"
Usage += " + Or you can pass those list by the 'nightlyBuild.csv' file. |\n" Usage += " + Or you can pass those list by the 'nightlyBuild.csv' file. |\n"
Usage += " A sample file 'macbuild/nightlyBuild.sample.csv' is available. |\n" Usage += " A sample file 'macbuild/nightlyBuild.sample.csv' is available. |\n"
Usage += " [--build] : build and deploy | disabled\n" Usage += " [--build] : build and deploy | disabled\n"
Usage += " [--pymod] : build and deploy Pymod, too | disabled\n" Usage += " [--pymod] : build and deploy Pymod, too (release build only) | disabled\n"
Usage += " [--test] : run the QA Test | disabled\n" Usage += " [--test] : run the QA Test | disabled\n"
Usage += " [--check] : check the QA Test results | disabled\n" Usage += " [--check] : check the QA Test results | disabled\n"
Usage += " [--makedmg|--cleandmg <srlno>] : make or clean DMGs | disabled\n" Usage += " [--makedmg|--cleandmg <srlno>] : make or clean DMGs | disabled\n"
@ -302,7 +353,7 @@ def Parse_CommandLine_Arguments():
p.add_option( '--qttarget', p.add_option( '--qttarget',
action='append', action='append',
dest='qt_target', dest='qt_target',
help='(Qt, target)-tuple' ) help='(Qt, target, bdType)-tuple' )
p.add_option( '--build', p.add_option( '--build',
action='store_true', action='store_true',
@ -396,10 +447,10 @@ def Parse_CommandLine_Arguments():
# Populate QtTarget # Populate QtTarget
QtTarget = list() QtTarget = list()
for target in Target: for target in Target:
QtTarget.append( (QtType, target) ) QtTarget.append( (QtType, target, 'r') )
QtType = None QtType = None
Target = None Target = None
print( "# The --qt and --target combination specifies..." ) print( "# The --qt and --target combination specifies for 'r'elease build..." )
print(QtTarget) print(QtTarget)
if len(opt.qt_target) == 1 and opt.qt_target[0] == "nightlyBuild.csv": # reserved file name if len(opt.qt_target) == 1 and opt.qt_target[0] == "nightlyBuild.csv": # reserved file name
@ -413,16 +464,22 @@ def Parse_CommandLine_Arguments():
for i in range(0, len(df)): for i in range(0, len(df)):
qt = df.iloc[i,0] qt = df.iloc[i,0]
idx = df.iloc[i,1] idx = df.iloc[i,1]
if (qt == 5 and idx in [0,1,2,3,4,5,6,12,13]) or (qt == 6 and idx in [0,1,2,3, 5,6,12,13]): bdType = df.iloc[i,2].lower()[0]
QtTarget.append( (qt, targetDic[idx]) ) if (qt == 5 and idx in [0,1,2,3,4,5,6,12,13] and bdType in ['r']) or \
(qt == 5 and idx in [0,1,2,3, 5,6,12,13] and bdType in ['d']) or \
(qt == 6 and idx in [0,1,2,3, 5,6,12,13] and bdType in ['r', 'd']):
QtTarget.append( (qt, targetDic[idx], bdType) )
elif len(opt.qt_target) > 0: elif len(opt.qt_target) > 0:
QtTarget = list() QtTarget = list()
withqttarget = True withqttarget = True
for item in opt.qt_target: for item in opt.qt_target:
qt = int(item.split(",")[0]) qt = int(item.split(",")[0])
idx = int(item.split(",")[1]) idx = int(item.split(",")[1])
if (qt == 5 and idx in [0,1,2,3,4,5,6,12,13]) or (qt == 6 and idx in [0,1,2,3, 5,6,12,13]): bdType = (item.split(",")[2]).lower()[0]
QtTarget.append( (qt, targetDic[idx]) ) if (qt == 5 and idx in [0,1,2,3,4,5,6,12,13] and bdType in ['r']) or \
(qt == 5 and idx in [0,1,2,3, 5,6,12,13] and bdType in ['d']) or \
(qt == 6 and idx in [0,1,2,3, 5,6,12,13] and bdType in ['r', 'd']):
QtTarget.append( (qt, targetDic[idx], bdType) )
else: else:
withqttarget = False withqttarget = False
@ -431,7 +488,7 @@ def Parse_CommandLine_Arguments():
print( "# The --qttarget option superseded the --qt and --target combination" ) print( "# The --qttarget option superseded the --qt and --target combination" )
print(QtTarget) print(QtTarget)
else: else:
print( "! --qttarget is used but there is no valid (Qt, target)-tuple" ) print( "! --qttarget is used but there is no valid (Qt, target, bdTye)-tuple" )
print(Usage) print(Usage)
quit() quit()
@ -474,18 +531,18 @@ def Build_Deploy():
myPlatform = Test_My_Platform() myPlatform = Test_My_Platform()
buildOp, logfile = Get_Build_Options( Get_Build_Target_Dict(), myPlatform ) buildOp, logfile = Get_Build_Options( Get_Build_Target_Dict(), myPlatform )
for qttype, key in QtTarget: for qttype, key, bdType in QtTarget:
if key == "ana3" and qttype == 6: # anaconda3 does not provide Qt6 so far if key == "ana3" and (qttype == 6 or bdType == 'd'): # anaconda3 does not provide Qt6 | debug_lib
continue continue
deplog = logfile[(qttype, key)].replace( ".log", ".dep.log" ) deplog = logfile[(qttype, key, bdType)].replace( ".log", ".dep.log" )
command1 = [ pyBuilder ] + buildOp[(qttype, key)] command1 = [ pyBuilder ] + buildOp[(qttype, key, bdType)]
if key in [ "std", "brewHW", "brewAHW", "pbrewHW" ] : if key in [ "std", "brewHW", "brewAHW", "pbrewHW" ] :
command2 = "time" command2 = "time"
command2 += " \\\n %s" % pyBuilder command2 += " \\\n %s" % pyBuilder
for option in buildOp[(qttype, key)]: for option in buildOp[(qttype, key, bdType)]:
command2 += " \\\n %s" % option command2 += " \\\n %s" % option
command2 += " \\\n %s" % '-y' command2 += " \\\n %s" % '-y'
command2 += " 2>&1 | tee %s; \\\n" % deplog command2 += " 2>&1 | tee %s; \\\n" % deplog
@ -493,7 +550,7 @@ def Build_Deploy():
else: else:
command2 = "time" command2 = "time"
command2 += " \\\n %s" % pyBuilder command2 += " \\\n %s" % pyBuilder
for option in buildOp[(qttype, key)]: for option in buildOp[(qttype, key, bdType)]:
command2 += " \\\n %s" % option command2 += " \\\n %s" % option
command2 += " \\\n %s" % '-Y' command2 += " \\\n %s" % '-Y'
command2 += " 2>&1 | tee %s; \\\n" % deplog command2 += " 2>&1 | tee %s; \\\n" % deplog
@ -544,8 +601,8 @@ def Run_QATest( excludeList ):
myPlatform = Test_My_Platform() myPlatform = Test_My_Platform()
dirQAT = Get_QAT_Directory( Get_Build_Target_Dict(), myPlatform ) dirQAT = Get_QAT_Directory( Get_Build_Target_Dict(), myPlatform )
for qttype, key in QtTarget: for qttype, key, bdType in QtTarget:
if key == "ana3" and qttype == 6: # anaconda3 does not provide Qt6 so far if key == "ana3" and (qttype == 6 or bdType == 'd'): # anaconda3 does not provide Qt6 | debug_lib
continue continue
if key == "ana3": if key == "ana3":
@ -555,9 +612,9 @@ def Run_QATest( excludeList ):
command1 = [ pyRunnerQAT ] + [ '--run' ] command1 = [ pyRunnerQAT ] + [ '--run' ]
if not exclude == "": if not exclude == "":
command1 += [ '--exclude', '%s' % exclude ] command1 += [ '--exclude', '%s' % exclude ]
print( dirQAT[(qttype, key)], command1 ) print( dirQAT[(qttype, key, bdType)], command1 )
#continue #continue
os.chdir( dirQAT[(qttype, key)] ) os.chdir( dirQAT[(qttype, key, bdType)] )
if subprocess.call( command1, shell=False ) != 0: if subprocess.call( command1, shell=False ) != 0:
print( "", file=sys.stderr ) print( "", file=sys.stderr )
@ -585,14 +642,14 @@ def Check_QATest_Results( lines ):
myPlatform = Test_My_Platform() myPlatform = Test_My_Platform()
dirQAT = Get_QAT_Directory( Get_Build_Target_Dict(), myPlatform ) dirQAT = Get_QAT_Directory( Get_Build_Target_Dict(), myPlatform )
for qttype, key in QtTarget: for qttype, key, bdType in QtTarget:
if key == "ana3" and qttype == 6: # anaconda3 does not provide Qt6 so far if key == "ana3" and (qttype == 6 or bdType == 'd'): # anaconda3 does not provide Qt6 | debug_lib
continue continue
os.chdir( dirQAT[(qttype, key)] ) os.chdir( dirQAT[(qttype, key, bdType)] )
logfile = glob.glob( "*.log" ) logfile = glob.glob( "*.log" )
command1 = [ tailCommand ] + [ '-n', '%d' % lines ] + logfile command1 = [ tailCommand ] + [ '-n', '%d' % lines ] + logfile
print( dirQAT[(qttype, key)], command1 ) print( dirQAT[(qttype, key, bdType)], command1 )
#continue #continue
if subprocess.call( command1, shell=False ) != 0: if subprocess.call( command1, shell=False ) != 0:
@ -626,11 +683,11 @@ def DMG_Make( srlDMG ):
shutil.rmtree( stashDMG ) shutil.rmtree( stashDMG )
os.mkdir( stashDMG ) os.mkdir( stashDMG )
for qttype, key in QtTarget: for qttype, key, bdType in QtTarget:
if key == "ana3" and qttype == 6: # anaconda3 does not provide Qt6 so far if key == "ana3" and (qttype == 6 or bdType == 'd'): # anaconda3 does not provide Qt6 | debug_lib
continue continue
command1 = [ pyDMGmaker ] + packOp[(qttype, key)] command1 = [ pyDMGmaker ] + packOp[(qttype, key, bdType)]
print(command1) print(command1)
#continue #continue
@ -666,11 +723,11 @@ def DMG_Clean( srlDMG ):
if os.path.isdir( stashDMG ): if os.path.isdir( stashDMG ):
shutil.rmtree( stashDMG ) shutil.rmtree( stashDMG )
for qttype, key in QtTarget: for qttype, key, bdType in QtTarget:
if key == "ana3" and qttype == 6: # anaconda3 does not provide Qt6 so far if key == "ana3" and (qttype == 6 or bdType == 'd'): # anaconda3 does not provide Qt6 | debug_lib
continue continue
command1 = [ pyDMGmaker ] + packOp[(qttype, key)] command1 = [ pyDMGmaker ] + packOp[(qttype, key, bdType)]
print(command1) print(command1)
#continue #continue

View File

@ -10,19 +10,20 @@
# qtVer = 5 or 6 # qtVer = 5 or 6
# target = [0='std', 1='ports', 2='brew', 3='brewHW', 4='ana3', # target = [0='std', 1='ports', 2='brew', 3='brewHW', 4='ana3',
# 12='pbrew', 13='pbrewHW'] # 12='pbrew', 13='pbrewHW']
# bdType = ['r(elease)', 'd(ebug)']
# note that # note that
# (qtVer,target)=(6,4) will be omitted # (qtVer,target,bdType)=(6,4,r|d) and (5,4,d) will be omitted
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
qtVer,target qtVer,target,bdType
5,0 5,0,r
5,1 5,1,r
6,2 6,2,r
6,13 6,13,r
5,4 5,4,r
#6,0 #6,0,r
#6,1 #6,1,r
#6,2 #6,2,r
#6,3 #6,3,r
#6,4 #6,4,r
#6,12 #6,12,r
#6,13 #6,13,r

Can't render this file because it contains an unexpected character in line 5 and column 30.

View File

@ -361,6 +361,10 @@ module RBA
def param(name, type, description, args = {}) def param(name, type, description, args = {})
if ! args.is_a?(Hash)
raise("Too many positional arguments for 'param' (3 expected) - use named arguments for default value etc.")
end
if name !~ /^[_A-Za-z]\w*$/ if name !~ /^[_A-Za-z]\w*$/
raise "Invalid parameter name #{name} (needs to be a word)" raise "Invalid parameter name #{name} (needs to be a word)"
end end

View File

@ -2526,11 +2526,26 @@ Layout::register_pcell (const std::string &name, pcell_declaration_type *declara
// replace any existing PCell declaration with that name. // replace any existing PCell declaration with that name.
id = pcid->second; id = pcid->second;
if (m_pcells [id]) { if (m_pcells [id]) {
delete m_pcells [id];
std::unique_ptr<pcell_header_type> org_header (m_pcells [id]);
std::vector<pcell_variant_type *> variants;
for (auto v = org_header->begin (); v != org_header->end (); ++v) {
variants.push_back (v->second);
}
for (auto v = variants.begin (); v != variants.end (); ++v) {
(*v)->unregister ();
} }
m_pcells [id] = new pcell_header_type (id, name, declaration); m_pcells [id] = new pcell_header_type (id, name, declaration);
for (auto v = variants.begin (); v != variants.end (); ++v) {
(*v)->reregister ();
}
} else {
m_pcells [id] = new pcell_header_type (id, name, declaration);
}
} else { } else {
id = (unsigned int) m_pcells.size (); id = (unsigned int) m_pcells.size ();

View File

@ -190,7 +190,7 @@ Class<db::DeepShapeStore> decl_dbDeepShapeStore ("db", "DeepShapeStore",
"\n" "\n"
"This attribute has been introduced in version 0.28.4" "This attribute has been introduced in version 0.28.4"
) + ) +
gsi::method ("subcircuit_hierarchy_for_nets=", &db::DeepShapeStore::set_subcircuit_hierarchy_for_nets, gsi::arg ("value"), gsi::method ("subcircuit_hierarchy_for_nets", &db::DeepShapeStore::subcircuit_hierarchy_for_nets,
"@brief Gets a value indicating whether to build a subcircuit hierarchy per net\n" "@brief Gets a value indicating whether to build a subcircuit hierarchy per net\n"
"See \\subcircuit_hierarchy_for_nets= for details.\n" "See \\subcircuit_hierarchy_for_nets= for details.\n"
"\n" "\n"

View File

@ -40,6 +40,7 @@
#include "layLayoutViewBase.h" #include "layLayoutViewBase.h"
#if defined(HAVE_QT) #if defined(HAVE_QT)
# include "layLayoutView.h"
# include "layTipDialog.h" # include "layTipDialog.h"
# include "layDragDropData.h" # include "layDragDropData.h"
#endif #endif
@ -72,6 +73,24 @@ ShapeEditService::configure (const std::string &name, const std::string &value)
} }
} }
void
ShapeEditService::activated ()
{
edt::Service::activated ();
#if defined(HAVE_QT)
if (view () == lay::LayoutView::current ()) {
lay::LayerPropertiesConstIterator cl = view ()->current_layer ();
if (! cl.is_null () && ! cl->visible (true)) {
lay::TipDialog td (QApplication::activeWindow (),
tl::to_string (tr ("You are about to draw on a hidden layer. The result won't be visible.")),
"drawing-on-invisible-layer");
td.exec_dialog ();
}
}
#endif
}
void void
ShapeEditService::get_edit_layer () ShapeEditService::get_edit_layer ()
{ {
@ -89,15 +108,6 @@ ShapeEditService::get_edit_layer ()
throw tl::Exception (tl::to_string (tr ("Please select a cell first"))); throw tl::Exception (tl::to_string (tr ("Please select a cell first")));
} }
#if defined(HAVE_QT)
if (! cl->visible (true)) {
lay::TipDialog td (QApplication::activeWindow (),
tl::to_string (tr ("You are about to draw on a hidden layer. The result won't be visible.")),
"drawing-on-invisible-layer");
td.exec_dialog ();
}
#endif
if (layer < 0 || ! cv->layout ().is_valid_layer ((unsigned int) layer)) { if (layer < 0 || ! cv->layout ().is_valid_layer ((unsigned int) layer)) {
if (cl->has_children ()) { if (cl->has_children ()) {

View File

@ -62,6 +62,7 @@ protected:
virtual void tap (const db::DPoint &initial); virtual void tap (const db::DPoint &initial);
virtual bool configure (const std::string &name, const std::string &value); virtual bool configure (const std::string &name, const std::string &value);
virtual void activated ();
protected: protected:
std::pair <bool, db::DPoint> interpolate (const db::DPoint &m, const db::DPoint &o, const db::DPoint &p) const; std::pair <bool, db::DPoint> interpolate (const db::DPoint &m, const db::DPoint &o, const db::DPoint &p) const;

View File

@ -118,6 +118,15 @@ equals(HAVE_GIT2, "1") {
DEFINES += HAVE_GIT2 DEFINES += HAVE_GIT2
} }
# Use the Address Sanitizer for the debug build on Mac
mac {
USE_ASAN_MAC = $$system(echo $$(MAC_USE_ASAN))
equals(USE_ASAN_MAC, "1") {
QMAKE_CXXFLAGS += -fsanitize=address
QMAKE_LFLAGS += -fsanitize=address
}
}
equals(HAVE_RUBY, "1") { equals(HAVE_RUBY, "1") {
!isEmpty(BITS_PATH) { !isEmpty(BITS_PATH) {
include($$BITS_PATH/ruby/ruby.pri) include($$BITS_PATH/ruby/ruby.pri)

View File

@ -188,6 +188,8 @@ MainWindow::MainWindow (QApplication *app, const char *name, bool undo_enabled)
mp_app (app), mp_app (app),
m_manager (undo_enabled) m_manager (undo_enabled)
{ {
setAnimated (false);
m_dispatcher.set_menu_parent_widget (this); m_dispatcher.set_menu_parent_widget (this);
m_dispatcher.make_menu (); m_dispatcher.make_menu ();

View File

@ -107,8 +107,6 @@ protected:
virtual void do_read (db::Layout &layout); virtual void do_read (db::Layout &layout);
private: private:
friend class OASISReaderLayerMapping;
typedef db::coord_traits<db::Coord>::distance_type distance_type; typedef db::coord_traits<db::Coord>::distance_type distance_type;
enum TableMode enum TableMode

View File

@ -226,9 +226,28 @@ bool skip_newline (const char *&cp)
} }
} }
// -------------------------------------------------------------------------
// Utility: case-insensitive compare of the first characters
static bool local_compare (const char *s1, const char *s2)
{
while (*s1 && *s2) {
uint32_t c1 = utf32_downcase (utf32_from_utf8 (s1));
uint32_t c2 = utf32_downcase (utf32_from_utf8 (s2));
if (c1 != c2) {
return false;
}
}
return true;
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Utility: a strtod version that is independent of the locale // Utility: a strtod version that is independent of the locale
static std::string inf_string = "inf";
static std::string ninf_string = "-inf";
static std::string nan_string = "nan";
static std::string micron_format ("%.5f"); static std::string micron_format ("%.5f");
static std::string dbu_format ("%.2f"); static std::string dbu_format ("%.2f");
@ -244,13 +263,25 @@ void set_db_resolution (unsigned int ndigits)
std::string micron_to_string (double d) std::string micron_to_string (double d)
{ {
if (std::isnan (d)) {
return nan_string;
} else if (std::isinf (d)) {
return d < 0 ? ninf_string : inf_string;
} else {
return tl::sprintf (micron_format.c_str (), d); return tl::sprintf (micron_format.c_str (), d);
} }
}
std::string db_to_string (double d) std::string db_to_string (double d)
{ {
if (std::isnan (d)) {
return nan_string;
} else if (std::isinf (d)) {
return d < 0 ? ninf_string : inf_string;
} else {
return tl::sprintf (dbu_format.c_str (), d); return tl::sprintf (dbu_format.c_str (), d);
} }
}
std::string to_upper_case (const std::string &s) std::string to_upper_case (const std::string &s)
{ {
@ -317,6 +348,18 @@ static double local_strtod (const char *cp, const char *&cp_new)
{ {
const char *cp0 = cp; const char *cp0 = cp;
// special numerical values
if (local_compare (cp, nan_string.c_str ())) {
cp_new = cp + nan_string.size ();
return NAN;
} else if (local_compare (cp, inf_string.c_str ())) {
cp_new = cp + inf_string.size ();
return INFINITY;
} else if (local_compare (cp, ninf_string.c_str ())) {
cp_new = cp + ninf_string.size ();
return -INFINITY;
}
// Extract sign // Extract sign
double s = 1.0; double s = 1.0;
if (*cp == '-') { if (*cp == '-') {
@ -376,6 +419,12 @@ static double local_strtod (const char *cp, const char *&cp_new)
std::string std::string
to_string (double d, int prec) to_string (double d, int prec)
{ {
if (std::isnan (d)) {
return nan_string;
} else if (std::isinf (d)) {
return d < 0 ? ninf_string : inf_string;
}
// For small values less than 1e-(prec) simply return "0" to avoid ugly values like "1.2321716e-14". // For small values less than 1e-(prec) simply return "0" to avoid ugly values like "1.2321716e-14".
if (fabs (d) < pow (10.0, -prec)) { if (fabs (d) < pow (10.0, -prec)) {
return "0"; return "0";
@ -393,6 +442,12 @@ to_string (double d, int prec)
std::string std::string
to_string (float d, int prec) to_string (float d, int prec)
{ {
if (std::isnan (d)) {
return nan_string;
} else if (std::isinf (d)) {
return d < 0 ? ninf_string : inf_string;
}
// For small values less than 1e-(prec) simply return "0" to avoid ugly values like "1.2321716e-14". // For small values less than 1e-(prec) simply return "0" to avoid ugly values like "1.2321716e-14".
if (fabs (d) < pow (10.0, -prec)) { if (fabs (d) < pow (10.0, -prec)) {
return "0"; return "0";
@ -813,6 +868,7 @@ from_string_numeric (const std::string &s, double &v, bool eval)
if (! *cp) { if (! *cp) {
throw tl::Exception (tl::to_string (tr ("Got empty string where a real number was expected"))); throw tl::Exception (tl::to_string (tr ("Got empty string where a real number was expected")));
} }
const char *cp_end = cp; const char *cp_end = cp;
v = local_strtod (cp, cp_end); v = local_strtod (cp, cp_end);
while (safe_isspace (*cp_end)) { while (safe_isspace (*cp_end)) {

View File

@ -1057,15 +1057,38 @@ normalized_type (Variant::type type1, Variant::type type2)
static const double epsilon = 1e-13; static const double epsilon = 1e-13;
// NOTE: in order to be able to use Variant for std::map or std::set
// keys we have to establish a weak order. This means we need to
// consider NAN and INFINITY too.
static int numeric_class (double x)
{
if (std::isnan (x)) {
return 2;
} else {
return std::isinf (x) ? (x < 0 ? -1 : 1) : 0;
}
}
static inline bool fequal (double a, double b) static inline bool fequal (double a, double b)
{ {
if (numeric_class (a) != 0 || numeric_class (b) != 0) {
return numeric_class (a) == numeric_class (b);
} else {
double avg = 0.5 * (fabs (a) + fabs (b)); double avg = 0.5 * (fabs (a) + fabs (b));
return fabs (a - b) <= epsilon * avg; return fabs (a - b) <= epsilon * avg;
} }
}
static inline bool fless (double a, double b) static inline bool fless (double a, double b)
{ {
return fequal (a, b) ? false : a < b; if (fequal (a, b)) {
return false;
} else if (numeric_class (a) != 0 || numeric_class (b) != 0) {
return numeric_class (a) < numeric_class (b);
} else {
return a < b;
}
} }
bool bool

View File

@ -589,3 +589,62 @@ TEST(15)
EXPECT_EQ (tl::to_upper_case ("nOrMaliI(\xc3\xa4\xc3\x84\xc3\xbc\xc3\x9c\xc3\xb6\xc3\x96\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)"), "NORMALII(\xc3\x84\xc3\x84\xc3\x9c\xc3\x9c\xc3\x96\xc3\x96\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)"); EXPECT_EQ (tl::to_upper_case ("nOrMaliI(\xc3\xa4\xc3\x84\xc3\xbc\xc3\x9c\xc3\xb6\xc3\x96\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)"), "NORMALII(\xc3\x84\xc3\x84\xc3\x9c\xc3\x9c\xc3\x96\xc3\x96\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)");
EXPECT_EQ (tl::to_lower_case ("nOrMaliI(\xc3\xa4\xc3\x84\xc3\xbc\xc3\x9c\xc3\xb6\xc3\x96\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)"), "normalii(\xc3\xa4\xc3\xa4\xc3\xbc\xc3\xbc\xc3\xb6\xc3\xb6\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)"); EXPECT_EQ (tl::to_lower_case ("nOrMaliI(\xc3\xa4\xc3\x84\xc3\xbc\xc3\x9c\xc3\xb6\xc3\x96\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)"), "normalii(\xc3\xa4\xc3\xa4\xc3\xbc\xc3\xbc\xc3\xb6\xc3\xb6\xc3\x9f-42\xc2\xb0+6\xe2\x82\xac)");
} }
// Special numerical values
TEST(16)
{
EXPECT_EQ (tl::to_string (NAN), "nan");
EXPECT_EQ (tl::to_string (INFINITY), "inf");
EXPECT_EQ (tl::to_string (-INFINITY), "-inf");
EXPECT_EQ (tl::to_string ((float) NAN), "nan");
EXPECT_EQ (tl::to_string ((float) INFINITY), "inf");
EXPECT_EQ (tl::to_string ((float) -INFINITY), "-inf");
EXPECT_EQ (tl::micron_to_string (NAN), "nan");
EXPECT_EQ (tl::micron_to_string (INFINITY), "inf");
EXPECT_EQ (tl::micron_to_string (-INFINITY), "-inf");
EXPECT_EQ (tl::db_to_string (NAN), "nan");
EXPECT_EQ (tl::db_to_string (INFINITY), "inf");
EXPECT_EQ (tl::db_to_string (-INFINITY), "-inf");
double x = 0.0;
tl::from_string ("nan", x);
EXPECT_EQ (tl::to_string (x), "nan");
x = 0.0;
tl::from_string ("NaN", x);
EXPECT_EQ (tl::to_string (x), "nan");
x = 0.0;
tl::from_string ("inf", x);
EXPECT_EQ (tl::to_string (x), "inf");
x = 0.0;
tl::from_string ("INF", x);
EXPECT_EQ (tl::to_string (x), "inf");
x = 0.0;
tl::from_string ("-inf", x);
EXPECT_EQ (tl::to_string (x), "-inf");
x = 0.0;
tl::from_string ("-INF", x);
EXPECT_EQ (tl::to_string (x), "-inf");
std::string s;
tl::Extractor ex;
x = 0.0;
s = " inf nan\t -inf";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (x), true);
EXPECT_EQ (tl::to_string (x), "inf");
EXPECT_EQ (ex.try_read (x), true);
EXPECT_EQ (tl::to_string (x), "nan");
EXPECT_EQ (ex.try_read (x), true);
EXPECT_EQ (tl::to_string (x), "-inf");
s = " Inf NaN\t -INF";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (x), true);
EXPECT_EQ (tl::to_string (x), "inf");
EXPECT_EQ (ex.try_read (x), true);
EXPECT_EQ (tl::to_string (x), "nan");
EXPECT_EQ (ex.try_read (x), true);
EXPECT_EQ (tl::to_string (x), "-inf");
}

View File

@ -27,6 +27,8 @@
#include "tlObject.h" #include "tlObject.h"
#include "tlTypeTraits.h" #include "tlTypeTraits.h"
#include "tlUnitTest.h" #include "tlUnitTest.h"
#include <cmath>
#include <cstdio> #include <cstdio>
#include <memory> #include <memory>
@ -1090,4 +1092,110 @@ TEST(6)
EXPECT_EQ (tl::Variant (-0.1 * (1.0 + 1.1e-13)) < tl::Variant (0.1), true); EXPECT_EQ (tl::Variant (-0.1 * (1.0 + 1.1e-13)) < tl::Variant (0.1), true);
} }
// special numeric values
TEST(7)
{
std::string s;
tl::Extractor ex;
tl::Variant v;
s = " ##\t 0.5";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (v), true);
EXPECT_EQ (v.to_parsable_string (), "##0.5");
s = "## nan";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (v), true);
EXPECT_EQ (v.to_parsable_string (), "##nan");
s = "## NaN";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (v), true);
EXPECT_EQ (v.to_parsable_string (), "##nan");
s = "## inf";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (v), true);
EXPECT_EQ (v.to_parsable_string (), "##inf");
s = "## Inf";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (v), true);
EXPECT_EQ (v.to_parsable_string (), "##inf");
s = "## -inf";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (v), true);
EXPECT_EQ (v.to_parsable_string (), "##-inf");
s = "## -Inf";
ex = tl::Extractor (s.c_str ());
EXPECT_EQ (ex.try_read (v), true);
EXPECT_EQ (v.to_parsable_string (), "##-inf");
v = tl::Variant ("nan");
v = tl::Variant (v.to_double ());
EXPECT_EQ (v.to_parsable_string (), "##nan");
EXPECT_EQ (v.to_string (), "nan");
v = tl::Variant ("Inf");
v = tl::Variant (v.to_double ());
EXPECT_EQ (v.to_parsable_string (), "##inf");
EXPECT_EQ (v.to_string (), "inf");
v = tl::Variant (INFINITY);
EXPECT_EQ (v.to_parsable_string (), "##inf");
EXPECT_EQ (v.to_string (), "inf");
v = tl::Variant (-INFINITY);
EXPECT_EQ (v.to_parsable_string (), "##-inf");
EXPECT_EQ (v.to_string (), "-inf");
tl::Variant vinf (INFINITY);
tl::Variant vninf (-INFINITY);
tl::Variant vnan (NAN);
tl::Variant vzero (0.0);
EXPECT_EQ (vninf == vninf, true);
EXPECT_EQ (vninf == vzero, false);
EXPECT_EQ (vninf == vinf, false);
EXPECT_EQ (vninf == vnan, false);
EXPECT_EQ (vninf < vninf, false);
EXPECT_EQ (vninf < vzero, true);
EXPECT_EQ (vninf < vinf, true);
EXPECT_EQ (vninf < vnan, true);
EXPECT_EQ (vzero == vninf, false);
EXPECT_EQ (vzero == vzero, true);
EXPECT_EQ (vzero == vinf, false);
EXPECT_EQ (vzero == vnan, false);
EXPECT_EQ (vzero < vninf, false);
EXPECT_EQ (vzero < vzero, false);
EXPECT_EQ (vzero < vinf, true);
EXPECT_EQ (vzero < vnan, true);
EXPECT_EQ (vinf == vninf, false);
EXPECT_EQ (vinf == vzero, false);
EXPECT_EQ (vinf == vinf, true);
EXPECT_EQ (vinf == vnan, false);
EXPECT_EQ (vinf < vninf, false);
EXPECT_EQ (vinf < vzero, false);
EXPECT_EQ (vinf < vinf, false);
EXPECT_EQ (vinf < vnan, true);
EXPECT_EQ (vnan == vninf, false);
EXPECT_EQ (vnan == vzero, false);
EXPECT_EQ (vnan == vinf, false);
EXPECT_EQ (vnan == vnan, true);
EXPECT_EQ (vnan < vninf, false);
EXPECT_EQ (vnan < vzero, false);
EXPECT_EQ (vnan < vinf, false);
EXPECT_EQ (vnan < vnan, false);
}
} }

View File

@ -674,6 +674,141 @@ class DBPCell_TestClass < TestBase
end end
# issue #1782
class Circle1782 < RBA::PCellDeclarationHelper
def initialize
super()
param("l", TypeLayer, "Layer", :default => RBA::LayerInfo::new(1, 0))
param("r", TypeDouble, "Radius", :default => 1.0)
param("n", TypeInt, "Number of points", :default => 16)
end
def display_text_impl
r = self.r
if !r
r = "nil"
else
r = '%.3f' % r
end
"Circle(L=" + self.l.to_s + ",R=" + r + ")"
end
def produce_impl
r = self.r
if self.r.to_s == 'NaN'
r = 2.0
end
da = Math::PI * 2 / self.n
pts = self.n.times.collect do |i|
RBA::DPoint::new(r * Math::cos(i * da), r * Math::sin(i * da))
end
self.cell.shapes(self.l_layer).insert(RBA::DPolygon::new(pts))
end
end
class CircleLib1782 < RBA::Library
def initialize(name)
self.description = "Circle Library"
self.layout.register_pcell("Circle", Circle1782::new)
register(name)
end
def reregister_pcell
self.layout.register_pcell("Circle", Circle1782::new)
end
end
def test_10
lib = CircleLib1782::new("CircleLib")
ly = RBA::Layout::new
top = ly.create_cell("TOP")
names = []
2.times do |pass|
5.times do |i|
5.times do |j|
if (i + j) % 2 == 0
r = Float::NAN
else
r = (i + j) * 0.5
end
n = i * 5 + j
c = ly.create_cell("Circle", "CircleLib", { "l" => RBA::LayerInfo::new(1, 0), "r" => r, "n" => n })
if pass == 0
names << c.name
else
# triggered bug #1782 - basically all variants are supposed to be unique, but
# the NaN spoiled the hash maps
assert_equal(names.shift, c.name)
end
top.insert(RBA::DCellInstArray::new(c, RBA::DTrans::new(i * 10.0, j * 10.0)))
end
end
end
tmp = File::join($ut_testtmp, "tmp.gds")
ly.write(tmp)
# this should not throw an internal error
ly._destroy
# we should be able to read the Layout back
ly = RBA::Layout::new
ly.read(tmp)
assert_equal(ly.top_cell.name, "TOP")
assert_equal(ly.cells, 26)
ly._destroy
lib._destroy
end
def test_11
lib = CircleLib1782::new("CircleLib")
ly = RBA::Layout::new
top = ly.create_cell("TOP")
names = []
c = ly.create_cell("Circle", "CircleLib", { "l" => RBA::LayerInfo::new(1, 0), "r" => 2.0, "n" => 64 })
# triggered another flavor of #1782
lib.reregister_pcell
c = ly.create_cell("Circle", "CircleLib", { "l" => RBA::LayerInfo::new(1, 0), "r" => 2.0, "n" => 64 })
top.insert(RBA::DCellInstArray::new(c, RBA::DTrans::new()))
tmp = File::join($ut_testtmp, "tmp.gds")
ly.write(tmp)
# this should not throw an internal error
ly._destroy
# we should be able to read the Layout back
ly = RBA::Layout::new
ly.read(tmp)
assert_equal(ly.top_cell.name, "TOP")
assert_equal(ly.cells, 2)
ly._destroy
lib._destroy
end
end end
load("test_epilogue.rb") load("test_epilogue.rb")

View File

@ -2,10 +2,10 @@
# This script is sourced to define the main version parameters # This script is sourced to define the main version parameters
# The main version # The main version
KLAYOUT_VERSION="0.29.3" KLAYOUT_VERSION="0.29.4"
# The version used for PyPI (don't use variables here!) # The version used for PyPI (don't use variables here!)
KLAYOUT_PYPI_VERSION="0.29.3" KLAYOUT_PYPI_VERSION="0.29.4"
# The build date # The build date
KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d") KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d")