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

chore: remove warnings #3106

Merged
merged 1 commit into from
Oct 10, 2024
Merged

chore: remove warnings #3106

merged 1 commit into from
Oct 10, 2024

Conversation

richard-ramos
Copy link
Member

While attempting to compile libwaku from within status-desktop, even tho I'm using the same nim version, it failed to compile with some warnings like:

/home/richard/status/status-desktop/vendor/status-go/third_party/nwaku/waku/waku_archive_legacy/archive.nim(227, 23) Error: getMessagesV2 is deprecated [Deprecated]
stack trace: (most recent call last)
/home/richard/status/status-desktop/vendor/status-go/third_party/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(421, 18)
/home/richard/status/status-desktop/vendor/status-go/third_party/nwaku/waku.nimble(169, 3) libwakuDynamicTask
/home/richard/status/status-desktop/vendor/status-go/third_party/nwaku/waku.nimble(69, 5) buildLibrary
/home/richard/status/status-desktop/vendor/status-go/third_party/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(265, 7) exec
/home/richard/status/status-desktop/vendor/status-go/third_party/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(265, 7) Error: unhandled exception: FAILED: nim c --out:build/libwaku.so --threads:on --app:lib --opt:size --noMain --mm:refc --header --undef:metrics -d:chronicles_line_numbers -d:chronicles_runtime_filtering=on -d:chronicles_sinks="textlines,json" -d:chronicles_default_output_device=Dynamic -d:chronicles_disabled_topics="eth,dnsdisc.client"  --verbosity:0 --hints:off -d:chronicles_log_level=TRACE -d:git_version="v0.33.0-26-gab7618" -d:release --passL:libnegentropy.a --passL:-lcrypto --passL:-lssl --passL:-lstdc++ --passL:librln_v0.5.1.a --passL:-lm library/libwaku.nim [OSError]

for both using deprecated functions, as well as unused imports.

Another error I saw was:

 Error: conversion to enum with holes is unsafe` is triggered

I could not figure out the reason why in status-desktop this happens, so I decided to fix the code instead which was faster:

  • Removes deprecation and unused import warnings for libwaku. The other targets remain unmodified
  • Removes unused imports.
  • Adds .base. pragma to SubscriptionObserver.onSubscribe
  • Uses casting for uint to enums conversions.. This casting should be safe as we are already limiting the values we accept on the case that precedes the cast
  • Update nim-chronicles version so we have access to RfcUtcTime compile option

Copy link

github-actions bot commented Oct 10, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3106

Built from b198012

- Removes deprecation and unused import warnings for libwaku
- Removes unused imports
- Adds .base. pragma to `SubscriptionObserver.onSubscribe`
- Uses casting for uint to enums conversions
@richard-ramos richard-ramos force-pushed the chore/remove-unused-imports branch from 9f868b7 to 4eee1e4 Compare October 10, 2024 01:53
Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Thanks for it! 💯

@richard-ramos richard-ramos merged commit c861fa9 into master Oct 10, 2024
10 of 11 checks passed
@richard-ramos richard-ramos deleted the chore/remove-unused-imports branch October 10, 2024 12:40
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.

3 participants