Skip to content

WIP: First attempt at integrating HCL#87

Draft
Tangdongle wants to merge 1 commit intoinim-repl:masterfrom
TangersTongle:hotcode_reloading
Draft

WIP: First attempt at integrating HCL#87
Tangdongle wants to merge 1 commit intoinim-repl:masterfrom
TangersTongle:hotcode_reloading

Conversation

@Tangdongle
Copy link
Copy Markdown
Collaborator

WIP

@Tangdongle
Copy link
Copy Markdown
Collaborator Author

Tangdongle commented Jun 8, 2020

Had a crack at this, got segfaults on start:

... # This goes on for a while above, essentially points the finger at noiser
register global: /home/ryan/.cache/nim/inim_d/lib@minimpkg@slogic.nim.c.so sessionNoAutoIndent__O0k9bD9cizXOF7Novj1bn1Qg
  register global: /home/ryan/.cache/nim/inim_d/lib@minimpkg@slogic.nim.c.so buffer__pa9cnc9c8OYdSwAdothj57Bw
  register global: /home/ryan/.cache/nim/inim_d/lib@minimpkg@slogic.nim.c.so noiser__DGuy2uWscYvZbDnH37g85w
Traceback (most recent call last)
/home/ryan/.choosenim/toolchains/nim-#devel/lib/nimhcr.nim(528) hcrInit
/home/ryan/.choosenim/toolchains/nim-#devel/lib/nimhcr.nim(509) initModules
/home/ryan/.choosenim/toolchains/nim-#devel/lib/nimhcr.nim(465) initGlobalScope
/home/ryan/dev/INim/src/inimpkg/logic.nim(70) logic
/home/ryan/dev/nim/nim-noise/noise.nim(73) init
/home/ryan/dev/nim/nim-noise/noise/basic.nim(113) isUnsupportedTerm
/home/ryan/.choosenim/toolchains/nim-#devel/lib/pure/includes/osenv.nim(131) getEnv
/home/ryan/.choosenim/toolchains/nim-#devel/lib/pure/includes/osenv.nim(103) findEnvVar
/home/ryan/.choosenim/toolchains/nim-#devel/lib/pure/includes/osenv.nim(97) getEnvVarsC
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Looks like an issue initializing Noise when getting env vars on the terminal. Might not have access or something.
Running on #devel
nim c --app:lib -d:traceHcr ~/.choosenim/toolchains/nim-\#devel/lib/nimhcr.nim
nim c --app:lib ~/.choosenim/toolchains/nim-\#devel/lib/nimrtl.nim
export LD_LIBRARY_PATH=/home/ryan/.choosenim/toolchains/nim-#devel/lib/
to set up the HCL libraries, then running nim develop to execute the task in config.nims (which I've defined in this branch: #87)

@0atman
Copy link
Copy Markdown
Collaborator

0atman commented Jun 8, 2020

I'd love to get @timotheecour's eyes on this. This looks tricky!

@timotheecour
Copy link
Copy Markdown
Contributor

there are some basic HCR bugs (eg nim-lang/Nim#13999 although IIRC that was osx bug only); can you minimize (remove all dependencies) to isolate what the bug is?

@Tangdongle
Copy link
Copy Markdown
Collaborator Author

Ok, stripped it down so that it worked and I could hotcode reload basic stuff. I hit two issues

### Current Config File ###
[History]
persistent=True
[Style]
prompt="nim> "
showTypes=True
ShowColor=True
showColor=True
[Features]
withTools=False

Getting section: Features and key: withTools
Traceback (most recent call last)
/home/ryan/dev/INim/src/inim.nim(119) inim
/home/ryan/dev/INim/src/inim.nim(59) main
/home/ryan/dev/INim/src/inim.nim(12) getOrSetSectionKeyValue
/home/ryan/.choosenim/toolchains/nim-1.2.6/lib/pure/parsecfg.nim(565) getSectionValue
/home/ryan/.choosenim/toolchains/nim-1.2.6/lib/pure/collections/tables.nim(1869) hasKey
/home/ryan/.choosenim/toolchains/nim-1.2.6/lib/pure/collections/tables.nim(1376) hasKey
/home/ryan/.choosenim/toolchains/nim-1.2.6/lib/pure/collections/hashcommon.nim(49) rawGet
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

And with getEnv

Getting editor
Traceback (most recent call last)
/home/ryan/dev/INim/src/inim.nim(119) inim
/home/ryan/dev/INim/src/inim.nim(57) main
/home/ryan/.choosenim/toolchains/nim-1.2.6/lib/pure/includes/osenv.nim(131) getEnv
/home/ryan/.choosenim/toolchains/nim-1.2.6/lib/pure/includes/osenv.nim(103) findEnvVar
/home/ryan/.choosenim/toolchains/nim-1.2.6/lib/pure/includes/osenv.nim(97) getEnvVarsC
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

This was run using devel and also 1.2.6 with the same results. @timotheecour Are you aware of any issues with hcr and these areas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants