ferus-web / ferus

A toy web engine written in Nim
GNU General Public License v3.0
115 stars 4 forks source link

Compile issue #4

Closed capocasa closed 1 year ago

capocasa commented 1 year ago

Wanted to give it a whirl!

nim-taskpools seems to be needed as dependency.

Then got:

src/layout/layout.nim(54, 38) Error: type mismatch: got <HTMLElement, int literal(0)>

Maybe not everything has been committed and pushed? Consider a stableish branch for people who want to try it.

xTrayambak commented 1 year ago

Yep, haha. I should really make a stable branch because main is just full of experimental stuff. My bad, I'll fix this today itself and create a devel branch for my development work

xTrayambak commented 1 year ago

I just looked at the code and that's some legacy code before the ferushtml migration. Just remove the 0 and it will compile, once I come back from school I'll push a fix.

xTrayambak commented 1 year ago

Oh, and yeah. We need both nim-taskpools and weave since for some reason one does threading properly and one does parallelism properly. I really wanna tackle that some day but unfortunately that day is not today. I'm sorry for the problem, by the way.

capocasa commented 1 year ago

Sure that's great- what I meant was that nim-taskpools is missing from the ferus.nimble file.

xTrayambak commented 1 year ago

Oh, woops. That's embarassing.

xTrayambak commented 1 year ago

This is now fixed. Ferus will now compile successfully. Thanks for bringing this to my knowledge!

capocasa commented 1 year ago

Cool!

Now I'm getting, in the main branch:

src/dom/dom.nim(13, 45) Error: undeclared identifier: 'Butterfly'

xTrayambak commented 1 year ago

Ah, I think migration of the butterfly code to ferushtml may be causing this. Sorry! For now, you have to use the experimental branch. This is a really silly issue and hopefully I'll fix it by tomorrow. Thing is that this is my first project that's gained some level of attention and I'm still learning how to properly maintain stuff. Again, I'm sorry.

xTrayambak commented 1 year ago

Are you able to run it in main and experimental branches now? Please let me know.

capocasa commented 1 year ago

Don't sweat it!

Nope, still getting src/dom/dom.nim(13, 45) Error: undeclared identifier: 'Butterfly' in both branches.

I tried adding import butterfly to the top of src/dom/dom.nim and then it works. Not sure what the difference might be between your and my repo.

xTrayambak commented 1 year ago

I had fixed this, then me being me decided to accidentally reset experimental with main and think it was fixed the entire time. Pushing a fix by tomorrow and merging main with experimental!

DiThi commented 1 year ago

That import was still missing in experimental, and there was still missing dependencies (firejail I think). You should empty your nimble cache from time to time to see if you forgot to add something to the nimble file.

xTrayambak commented 1 year ago

Can you please confirm if this still happens? I've cleared my nimble cache and both the branches compile successfully. Butterflies are to be removed from Ferus as ferushtml will use its own, and so will the future feruscss parser (still working on it).

enthus1ast commented 1 year ago

Another compilation issue:

david@dnd:~/projects/forks/ferus$ nimble productionBuild
  Executing task productionBuild in /home/david/projects/forks/ferus/ferus.nimble
Hint: used config file '/home/david/.choosenim/toolchains/nim-1.6.12/config/nim.cfg' [Conf]
Hint: used config file '/home/david/.choosenim/toolchains/nim-1.6.12/config/config.nims' [Conf]
Hint: used config file '/home/david/projects/forks/ferus/nim.cfg' [Conf]
.....................................................................................................................................................................
/home/david/projects/forks/ferus/src/ipc/server.nim(221, 3) Warning: catch a more precise Exception deriving from CatchableError or Defect. [BareExcept]
......
/home/david/projects/forks/ferus/src/dom/dom.nim(12, 14) Error: undeclared identifier: 'Document'
candidates (edit distance, scope distance); see '--spellSuggest': 
 (1, 2): 'document' [module declared in /home/david/projects/forks/ferushtml/src/ferushtml.nim(1, 30)]
stack trace: (most recent call last)
/tmp/nimblecache-2745649079/nimscriptapi_3455990857.nim(187, 16)
/home/david/projects/forks/ferus/ferus.nimble(58, 8) productionBuildTask
/home/david/.choosenim/toolchains/nim-1.6.12/lib/system/nimscript.nim(273, 7) exec
/home/david/.choosenim/toolchains/nim-1.6.12/lib/system/nimscript.nim(273, 7) Error: unhandled exception: FAILED: nim c -o:bin/ferus -d:release src/ferus.nim && nim c -o:bin/libferuscli -d:release src/libferuscli.nim [OSError]
     Error: Exception raised during nimble script execution
xTrayambak commented 1 year ago

Those are due to the new breaking changes in FerusHTML. The main branch should fix this.

Daeraxa commented 1 year ago

Just tried building it myself and got stuck here. Any ideas?

nimble productionBuild                                                                                    3016ms  Wed 21 Jun 2023 01:05:26 BST
  Executing task productionBuild in /home/dae/sourcebuild/ferus/ferus.nimble
Hint: used config file '/home/dae/.choosenim/toolchains/nim-1.6.12/config/nim.cfg' [Conf]
Hint: used config file '/home/dae/.choosenim/toolchains/nim-1.6.12/config/config.nims' [Conf]
Hint: used config file '/home/dae/sourcebuild/ferus/nim.cfg' [Conf]
..................................................................................
/home/dae/sourcebuild/ferus/src/ferus.nim(2, 8) Error: cannot open file: chronicles
stack trace: (most recent call last)
/tmp/nimblecache-1928915418/nimscriptapi_2226930418.nim(187, 16)
/home/dae/sourcebuild/ferus/ferus.nimble(61, 8) productionBuildTask
/home/dae/.choosenim/toolchains/nim-1.6.12/lib/system/nimscript.nim(273, 7) exec
/home/dae/.choosenim/toolchains/nim-1.6.12/lib/system/nimscript.nim(273, 7) Error: unhandled exception: FAILED: nim c -o:bin/ferus -d:release src/ferus.nim && nim c -o:bin/libferuscli -d:release src/libferuscli.nim [OSError]
       Tip: 1 messages have been suppressed, use --verbose to show them.
     Error: Exception raised during nimble script execution
xTrayambak commented 1 year ago

Ah, I just realised. I forgot to update the instructions. I'll update em today. For now, run this:

nimble install
nimble productionBuild