From a4781dc4bcdf6e76076af80d0b21cb09865b3d44 Mon Sep 17 00:00:00 2001 From: metagn Date: Sun, 20 Aug 2023 07:30:36 +0300 Subject: [PATCH] use old typeinfo generation for hot code reloading (#22518) * use old typeinfo generation for hot code reloading * at least test hello world compilation on orc --- compiler/ccgtypes.nim | 2 +- testament/categories.nim | 7 +++++-- tests/dll/nimhcr_basic.nim | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index eb5e906e42..b7363f67fe 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -1772,7 +1772,7 @@ proc genTypeInfoV2(m: BModule; t: PType; info: TLineInfo): Rope = return prefixTI.rope & result & ")".rope m.g.typeInfoMarkerV2[sig] = (str: result, owner: owner) - if m.compileToCpp: + if m.compileToCpp or m.hcrOn: genTypeInfoV2OldImpl(m, t, origType, result, info) else: genTypeInfoV2Impl(m, t, origType, result, info) diff --git a/testament/categories.nim b/testament/categories.nim index c449cf3e04..843bef3f9a 100644 --- a/testament/categories.nim +++ b/testament/categories.nim @@ -81,10 +81,13 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string, isOrc = testSpec r, makeTest("tests/dll/nimhcr_unit.nim", options & " --threads:off" & rpath, cat) testSpec r, makeTest("tests/dll/visibility.nim", options & " --threads:off" & rpath, cat) - if "boehm" notin options and not isOrc: + if "boehm" notin options: # hcr tests - testSpec r, makeTest("tests/dll/nimhcr_basic.nim", options & " --threads:off --forceBuild --hotCodeReloading:on " & rpath, cat) + var basicHcrTest = makeTest("tests/dll/nimhcr_basic.nim", options & " --threads:off --forceBuild --hotCodeReloading:on " & rpath, cat) + # test segfaults for now but compiles: + if isOrc: basicHcrTest.spec.action = actionCompile + testSpec r, basicHcrTest # force build required - see the comments in the .nim file for more details var hcri = makeTest("tests/dll/nimhcr_integration.nim", diff --git a/tests/dll/nimhcr_basic.nim b/tests/dll/nimhcr_basic.nim index 340c3fc4e9..2e1f39ae06 100644 --- a/tests/dll/nimhcr_basic.nim +++ b/tests/dll/nimhcr_basic.nim @@ -3,5 +3,6 @@ discard """ Hello world ''' """ +# for now orc only tests successful compilation echo "Hello world"