Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler insanity #1648

Open
mjfh opened this issue Jul 18, 2023 · 1 comment
Open

Compiler insanity #1648

mjfh opened this issue Jul 18, 2023 · 1 comment

Comments

@mjfh
Copy link
Contributor

mjfh commented Jul 18, 2023

The following code

import config, core/chain # fails
#import core/chain, config # works

produces something like

[..]

/status/nimbus-eth1/nimbus/confuse.nim(1, 20) Warning: imported and not used: 'chain' [UnusedImport]
/status/nimbus-eth1/vendor/nim-chronos/chronos/apps/http/httptable.nim: In function ‘getInt__OOZvendorZnim45chronosZchronosZappsZhttpZhttpclient_6103’:
/status/nimbus-eth1/vendor/nim-chronos/chronos/apps/http/httptable.nim:82:76: error: incompatible type for argument 1 of ‘value__OOZvendorZnim45chronosZchronosZappsZhttpZhttpclient_6236’
   82 |     res.get()
      |                                                                            ^  
      |                                                                            |
      |                                                                            tyObject_Result__qNfoJ3Kv2ogXLq0YGQ2b5g
/status/nimbus-eth1/vendor/nim-results/results.nim:796:130: note: expected ‘tyObject_Result__36l9bBqN9czMl21017YJSMqg’ but argument is of type ‘tyObject_Result__qNfoJ3Kv2ogXLq0YGQ2b5g’
  796 | func value*[T, E](self: Result[T, E]): T {.inline.} =
      |                                                                                                                                  ^   
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread -I/status/nimbus-eth1/vendor/nim-libbacktrace -I/status/nimbus-eth1/vendor/nim-libbacktrace/install/usr/include -I/status/nimbus-eth1/vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/include -I/status/nimbus-eth1/vendor/nim-nat-traversal/vendor/libnatpmp-upstream -DENABLE_STRNATPMPERR -I/status/nimbus-eth1/vendor/nim-bearssl/bearssl/abi/../csources/src/ -I/status/nimbus-eth1/vendor/nim-bearssl/bearssl/abi/../csources/inc/ -I/status/nimbus-eth1/vendor/nim-bearssl/bearssl/abi/../csources/tools/ -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1  -DBR_amd64=1 -DBR_INT128=1 -I/status/nimbus-eth1/vendor/nim-zlib/zlib/csources -DHAVE_UNISTD_H -I/status/nimbus-eth1/vendor/nim-kzg4844/kzg4844/csources/blst/bindings -DFIELD_ELEMENTS_PER_BLOB=4096 -I/status/nimbus-eth1/vendor/nim-kzg4844/kzg4844/csources/src/ -DMP_32BIT -I/status/nimbus-eth1/vendor/libtommath -march=native -fno-omit-frame-pointer -g3 -Og -O3 -fno-strict-aliasing -fno-ident   -I/status/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib -I/status/nimbus-eth1/nimbus -o nimcache/debug/confuse/@m..@svendor@snim-chronos@schronos@sapps@[email protected] nimcache/debug/confuse/@m..@svendor@snim-chronos@schronos@sapps@[email protected]' failed with exit code: 1

nim-compile exited abnormally with code 1 at Tue Jul 18 12:29:14

whereas the code

#import config, core/chain # fails
import core/chain, config # works

compiles fine.

This goes along with other errors, maybe related to result.tryGet() (I am working n that.) A dirty fix for this particular one would be changing the line nim-chronos/chronos/apps/http/httptable.nim:80

let res = Base10.decode(uint64, ht.getString(key))

to

var res = Base10.decode(uint64, ht.getString(key))
mjfh added a commit that referenced this issue Jul 28, 2023
also:
* Fix compilation annoyance #1648
* Fix unit test on Kiln (changed `merge` logic?)
mjfh added a commit that referenced this issue Jul 31, 2023
* Remove 32bit os support from `custom_network` unit test

also:
* Fix compilation annoyance #1648
* Fix unit test on Kiln (changed `merge` logic?)

* Hide unused sources do not compile

why:
* Get them out of the way before major update
* Import and function prototype mismatch -- maybe some changes got out
  of scope.

* Re-implemented `db_chain` as `core_db`

why:
  Hiding `TrieDatabaseRef` and `HexaryTrie` by default allows to replace
  the current db wrapper by some other one, e.g. Aristo

* Support compiler exception warnings for CoreDbRef base methods.

* Allow `pairs()` iterator on all memory based key-value tables

why:
  Previously only available for capture recorder.

* Backport `chain_db.nim` changes into its re-implementation `core_apps.nim`

* Fix exception annotation
@tersec
Copy link
Contributor

tersec commented May 25, 2024

I can't reproduce this -- what are the specific conditions under which it occurs?

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

No branches or pull requests

3 participants