From 161d13ad3ade0cb004ccb1ae35acf79167d18003 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 14 Sep 2020 21:27:22 +0200 Subject: [PATCH 01/13] Qt4 compatibility of one test. --- testdata/ruby/qtbinding.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/testdata/ruby/qtbinding.rb b/testdata/ruby/qtbinding.rb index f8b7471d4..54b596542 100644 --- a/testdata/ruby/qtbinding.rb +++ b/testdata/ruby/qtbinding.rb @@ -679,9 +679,16 @@ class QtBinding_TestClass < TestBase w = RBA::QObject::new - on = nil - w.objectNameChanged do |name| - on = name + if w.respond_to?(:objectNameChanged) # Qt5 + + on = nil + w.objectNameChanged do |name| + on = name + end + + w.objectName = "uvw" + assert_equal(on, "uvw") + end od = false @@ -689,12 +696,7 @@ class QtBinding_TestClass < TestBase od = true end - w.objectName = "uvw" - - assert_equal(on, "uvw") - w._destroy - assert_equal(od, true) end From db2157bb942ea024f310652b97f71a7768ffa873 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 16 Sep 2020 01:25:54 +0200 Subject: [PATCH 02/13] Fixed builds without ruby/python --- src/lym/unit_tests/unit_tests.pro | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lym/unit_tests/unit_tests.pro b/src/lym/unit_tests/unit_tests.pro index 8aec7683c..f6947c4d2 100644 --- a/src/lym/unit_tests/unit_tests.pro +++ b/src/lym/unit_tests/unit_tests.pro @@ -12,5 +12,17 @@ SOURCES = \ INCLUDEPATH += $$RBA_INC $$PYA_INC $$LYM_INC $$TL_INC $$GSI_INC DEPENDPATH += $$RBA_INC $$PYA_INC $$LYM_INC $$TL_INC $$GSI_INC -LIBS += -L$$DESTDIR_UT -lklayout_rba -lklayout_pya -lklayout_lym -lklayout_tl -lklayout_gsi +LIBS += -L$$DESTDIR_UT -lklayout_lym -lklayout_tl -lklayout_gsi + +equals(HAVE_RUBY, "1") { + LIBS += -lklayout_rba +} else { + LIBS += -lklayout_rbastub +} + +equals(HAVE_PYTHON, "1") { + LIBS += -lklayout_pya +} else { + LIBS += -lklayout_pyastub +} From ccfec5fe88d9ab44825c8ff69a50f0deb1c029d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6fferlein?= Date: Sat, 19 Sep 2020 21:00:31 +0200 Subject: [PATCH 03/13] An issue with MSVC2017 builds fixed On MSVC2017 builds, a crash is observed in the RBA basic tests. There is no obvious reason, but empirically, the instantation of a std::vector caused this problem. Compiler bug or strange interaction with Ruby's GC? --- src/rba/rba/rba.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/rba/rba/rba.cc b/src/rba/rba/rba.cc index d7e9a1091..c0b5d9966 100644 --- a/src/rba/rba/rba.cc +++ b/src/rba/rba/rba.cc @@ -1001,16 +1001,29 @@ method_adaptor (int mid, int argc, VALUE *argv, VALUE self, bool ctor) static ID id_to_enum = rb_intern ("to_enum"); - VALUE method_sym = ID2SYM (rb_intern (meth->primary_name ().c_str ())); + VALUE method_sym = ID2SYM (rb_intern2 (meth->primary_name ().c_str (), (long) meth->primary_name ().size ())); if (argc == 0) { ret = rba_funcall2_checked (self, id_to_enum, 1, &method_sym); } else { +#if 0 + // this solution does not work on MSVC2017 for unknown reasons and + // makes the application segfault even without being called std::vector new_args; new_args.reserve (size_t (argc + 1)); new_args.push_back (method_sym); new_args.insert (new_args.end (), argv, argv + argc); ret = rba_funcall2_checked (self, id_to_enum, argc + 1, new_args.begin ().operator-> ()); +#else + VALUE new_args[16]; + tl_assert (argc + 1 <= sizeof(new_args) / sizeof(new_args[0])); + VALUE *a = &new_args[0]; + *a++ = method_sym; + for (int i = 0; i < argc; ++i) { + *a++ = argv[i]; + } + ret = rba_funcall2_checked (self, id_to_enum, argc + 1, &new_args[0]); +#endif } } else { From 0166d48eec159d82dd73cfd21cfa79a2c9249228 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 19 Sep 2020 21:19:27 +0200 Subject: [PATCH 04/13] ruby 1.x compatibility. --- src/rba/rba/rba.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rba/rba/rba.cc b/src/rba/rba/rba.cc index 6de8b89fd..b3e45d57a 100644 --- a/src/rba/rba/rba.cc +++ b/src/rba/rba/rba.cc @@ -1010,7 +1010,7 @@ method_adaptor (int mid, int argc, VALUE *argv, VALUE self, bool ctor) static ID id_to_enum = rb_intern ("to_enum"); - VALUE method_sym = ID2SYM (rb_intern2 (meth->primary_name ().c_str (), (long) meth->primary_name ().size ())); + VALUE method_sym = ID2SYM (rb_intern (meth->primary_name ().c_str ())); if (argc == 0) { ret = rba_funcall2_checked (self, id_to_enum, 1, &method_sym); From 151fd81bd3172cf4e5be7e144eec633944a8e13c Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 20 Sep 2020 01:07:39 +0200 Subject: [PATCH 05/13] Should fix unit test fails on Windows (backslash vs. slash for file name separators) --- src/lym/unit_tests/lymBasicTests.cc | 8 +++++++- src/tl/unit_tests/tlIncludeTests.cc | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/lym/unit_tests/lymBasicTests.cc b/src/lym/unit_tests/lymBasicTests.cc index 10a6a7362..d0b2eaf14 100644 --- a/src/lym/unit_tests/lymBasicTests.cc +++ b/src/lym/unit_tests/lymBasicTests.cc @@ -28,6 +28,7 @@ #include "gsiInterpreter.h" #include "rba.h" #include "pya.h" +#include "tlFileUtils.h" class TestCollectorConsole : public gsi::Console @@ -52,6 +53,11 @@ private: std::string m_text; }; +static std::string np (const std::string &s) +{ + return tl::replaced (s, "\\", "/"); +} + #if defined(HAVE_RUBY) TEST(1_BasicRuby) @@ -120,7 +126,7 @@ TEST(3_RubyInclude) throw; } - EXPECT_EQ (console.text (), "An error in " + tl::testsrc () + "/testdata/lym/b_inc.rb:3\n"); + EXPECT_EQ (np (console.text ()), np ("An error in " + tl::testsrc () + "/testdata/lym/b_inc.rb:3\n")); } TEST(11_DRCBasic) diff --git a/src/tl/unit_tests/tlIncludeTests.cc b/src/tl/unit_tests/tlIncludeTests.cc index bbb56dc66..924a4510c 100644 --- a/src/tl/unit_tests/tlIncludeTests.cc +++ b/src/tl/unit_tests/tlIncludeTests.cc @@ -26,6 +26,11 @@ #include "tlStream.h" #include "tlInclude.h" +static std::string np (const std::string &s) +{ + return tl::replaced (s, "\\", "/"); +} + TEST(1_simple) { std::string fn = tl::testsrc () + "/testdata/tl/x.txt"; @@ -48,12 +53,12 @@ TEST(2_single_include) tl::IncludeExpander ie = tl::IncludeExpander::expand (fn, tl::InputStream (fn).read_all (), et); EXPECT_EQ (et, "A line\nincluded.1\nAnother line\n"); - EXPECT_EQ (ie.to_string (), "@1*" + tl::testsrc () + "/testdata/tl/x_inc1.txt*0;2*" + tl::testsrc () + "/testdata/tl/inc1.txt*-1;3*" + tl::testsrc () + "/testdata/tl/x_inc1.txt*0;"); + EXPECT_EQ (np (ie.to_string ()), np ("@1*" + tl::testsrc () + "/testdata/tl/x_inc1.txt*0;2*" + tl::testsrc () + "/testdata/tl/inc1.txt*-1;3*" + tl::testsrc () + "/testdata/tl/x_inc1.txt*0;")); EXPECT_EQ (tl::IncludeExpander::from_string (ie.to_string ()).to_string (), ie.to_string ()); EXPECT_EQ (ie.translate_to_original (1).first, fn); EXPECT_EQ (ie.translate_to_original (1).second, 1); - EXPECT_EQ (ie.translate_to_original (2).first, tl::testsrc () + "/testdata/tl/inc1.txt"); + EXPECT_EQ (np (ie.translate_to_original (2).first), np (tl::testsrc () + "/testdata/tl/inc1.txt")); EXPECT_EQ (ie.translate_to_original (2).second, 1); EXPECT_EQ (ie.translate_to_original (3).first, fn); EXPECT_EQ (ie.translate_to_original (3).second, 3); @@ -71,11 +76,11 @@ TEST(3_multi_include) EXPECT_EQ (ie.translate_to_original (1).first, fn); EXPECT_EQ (ie.translate_to_original (1).second, 1); - EXPECT_EQ (ie.translate_to_original (2).first, tl::testsrc () + "/testdata/tl/inc3.txt"); + EXPECT_EQ (np (ie.translate_to_original (2).first), np (tl::testsrc () + "/testdata/tl/inc3.txt")); EXPECT_EQ (ie.translate_to_original (2).second, 1); - EXPECT_EQ (ie.translate_to_original (3).first, tl::testsrc () + "/testdata/tl/inc2.txt"); + EXPECT_EQ (np (ie.translate_to_original (3).first), np (tl::testsrc () + "/testdata/tl/inc2.txt")); EXPECT_EQ (ie.translate_to_original (3).second, 1); - EXPECT_EQ (ie.translate_to_original (5).first, tl::testsrc () + "/testdata/tl/inc3.txt"); + EXPECT_EQ (np (ie.translate_to_original (5).first), np (tl::testsrc () + "/testdata/tl/inc3.txt")); EXPECT_EQ (ie.translate_to_original (5).second, 3); EXPECT_EQ (ie.translate_to_original (6).first, fn); EXPECT_EQ (ie.translate_to_original (6).second, 3); @@ -93,11 +98,11 @@ TEST(4_multi_include_interpolate) EXPECT_EQ (ie.translate_to_original (1).first, fn); EXPECT_EQ (ie.translate_to_original (1).second, 1); - EXPECT_EQ (ie.translate_to_original (2).first, tl::testsrc () + "/testdata/tl/inc3.txt"); + EXPECT_EQ (np (ie.translate_to_original (2).first), np (tl::testsrc () + "/testdata/tl/inc3.txt")); EXPECT_EQ (ie.translate_to_original (2).second, 1); - EXPECT_EQ (ie.translate_to_original (3).first, tl::testsrc () + "/testdata/tl/inc2.txt"); + EXPECT_EQ (np (ie.translate_to_original (3).first), np (tl::testsrc () + "/testdata/tl/inc2.txt")); EXPECT_EQ (ie.translate_to_original (3).second, 1); - EXPECT_EQ (ie.translate_to_original (5).first, tl::testsrc () + "/testdata/tl/inc3.txt"); + EXPECT_EQ (np (ie.translate_to_original (5).first), np (tl::testsrc () + "/testdata/tl/inc3.txt")); EXPECT_EQ (ie.translate_to_original (5).second, 3); EXPECT_EQ (ie.translate_to_original (6).first, fn); EXPECT_EQ (ie.translate_to_original (6).second, 3); From 2f0fa28e5836f2ff2d2e92bf8b9ca083ec5ce7f2 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Sat, 10 Oct 2020 07:09:34 +0900 Subject: [PATCH 06/13] * Updated the build system for Mac (#645) * Catalina env. uses Python 3.8 in MacPorts, Homebrew, and Anaconda3. --- macbuild/ReadMe.md | 46 ++-- macbuild/Resources/script-bundle-A.zip | Bin 4361604 -> 4361659 bytes macbuild/Resources/script-bundle-B.zip | Bin 4371595 -> 4371668 bytes macbuild/Resources/script-bundle-P.zip | Bin 4396762 -> 4396838 bytes macbuild/build4mac.py | 152 ++++++++------ macbuild/build4mac_env.py | 38 ++-- macbuild/build4mac_util.py | 146 +++++++++---- macbuild/macQAT.py | 278 +++++++++++++++++++++++++ macbuild/makeDMG4mac.py | 14 +- 9 files changed, 521 insertions(+), 153 deletions(-) create mode 100755 macbuild/macQAT.py diff --git a/macbuild/ReadMe.md b/macbuild/ReadMe.md index 4f87e9616..09344755b 100644 --- a/macbuild/ReadMe.md +++ b/macbuild/ReadMe.md @@ -1,4 +1,4 @@ -Relevant KLayout version: 0.26.5 +Relevant KLayout version: 0.26.7 # 1. Introduction This directory **`macbuild`** contains different files required for building KLayout (http://www.klayout.de/) version 0.26.1 or later for different 64-bit Mac OSXs including: @@ -72,16 +72,16 @@ $ [python] ./build4mac.py : MP26: use Ruby 2.6 from MacPorts | : HB27: use Ruby 2.7 from Homebrew | : Ana3: use Ruby 2.5 from Anaconda3 | - [-p|--python ] : case-insensitive type=['nil', 'Sys', 'MP37', 'HB37', 'Ana3'] | sys + [-p|--python ] : case-insensitive type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3'] | sys : nil: don't bind Python | : Sys: use OS-bundled Python 2.7 [ElCapitan -- Catalina] | - : MP37: use Python 3.7 from MacPorts | - : HB37: use Python 3.7 from Homebrew | - : Ana3: use Python 3.7 from Anaconda3 | + : MP38: use Python 3.8 from MacPorts | + : HB38: use Python 3.8 from Homebrew | + : Ana3: use Python 3.8 from Anaconda3 | [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled [-m|--make