oskaritimperi / nimpb

Protocol Buffers for Nim
MIT License
38 stars 6 forks source link

Compilation failed with Nim 1.4.2 #18

Closed drygdryg closed 3 years ago

drygdryg commented 3 years ago

Nim compiler version: 1.4.2 Build log:

$ nimble install nimpb
Downloading https://github.com/oswjk/nimpb using git
  Verifying dependencies for nimpb@0.2.0
      Info: Dependency on nimpb_protoc@any version already satisfied
  Verifying dependencies for nimpb_protoc@0.1.0
 Installing nimpb@0.2.0
   Building nimpb/nimpb/compiler/nimpb_build using c backend
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/compiler/nimpb_build.nim(3, 8) Warning: Use the 'parseopt' module instead; parseopt2 is deprecated [Deprecated]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/nimpb.nim(21, 19) Warning: inherit from a more precise exception type like ValueError, IOError or OSError. If these don't suit, inherit from CatchableError or Defect. [InheritFromException]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/nimpb.nim(539, 72) Warning: `typed` will change its meaning in future versions of Nim. `void` or no return type declaration at all has the same meaning as the current meaning of `typed` as return type declaration. [Deprecated]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/wkt/descriptor_pb.nim(3, 8) Warning: imported and not used: 'base64' [UnusedImport]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/wkt/descriptor_pb.nim(4, 8) Warning: imported and not used: 'intsets' [UnusedImport]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/wkt/descriptor_pb.nim(5, 8) Warning: imported and not used: 'json' [UnusedImport]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/wkt/descriptor_pb.nim(6, 8) Warning: imported and not used: 'strutils' [UnusedImport]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/wkt/descriptor_pb.nim(9, 19) Warning: imported and not used: 'json' [UnusedImport]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/compiler/generator.nim(585, 32) Warning: Deprecated since v0.20, use 'toHashSet'; toSet is deprecated [Deprecated]
/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/compiler/generator.nim(630, 12) Error: undeclared identifier: 'isNilOrWhitespace'
       Tip: 6 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: nimpb
        ... Execution failed with exit code 1
        ... Command: /usr/bin/nim c --colors:on --noNimblePath -d:release -d:NimblePkgVersion=0.2.0 --path:/home/victor/.nimble/pkgs/nimpb_protoc-0.1.0 --hints:off -o:/tmp/nimble_14769/githubcom_oswjknimpb/nimpb/compiler/nimpb_build /tmp/nimble_14769/githubcom_oswjknimpb/nimpb/compiler/nimpb_build.nim

It looks like isNilOrWhitespace procedure was removed in Nim version 1.4.0 https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_1_4_0.md#language-changes Perhaps you should use isEmptyOrWhitespace (https://nim-lang.org/docs/strutils.html#isEmptyOrWhitespace%2Cstring)

geohuz commented 3 years ago

compile failed on 1.4.8, really hope it will be fixed soon.