In February I stopped work on my lunarender project.
Today I wanted to setup demo server but I was stopped by not being able to compile it on linux.
I developed it on windows with nim 1.6.2 and then I tried to compile it on linux (with nim 1.6.2). I got some error messages - it looks like there was some namespace collision.
I tried to set same version of nim on both machines via choosenim, which probably worked. See linux log:
severak@kapybara:~/lunarender3$ nimble --version
nimble v0.13.1 compiled at 2022-05-05 01:16:54
git hash: couldn't determine git hash
severak@kapybara:~/lunarender3$ nim --version
Nim Compiler Version 1.6.6 [Linux: amd64]
Compiled at 2022-05-05
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 0565a70eab02122ce278b98181c7d1170870865c
active boot switches: -d:release
and windows log:
C:\severak\lunarender3>nimble --version
nimble v0.13.1 compiled at 2022-05-05 01:37:24
git hash: couldn't determine git hash
C:\severak\lunarender3>nim --version
Nim Compiler Version 1.6.6 [Windows: amd64]
Compiled at 2022-05-05
Copyright (c) 2006-2021 by Andreas Rumpf
active boot switches: -d:release
But dependencies of project (installed via nimble install) are not the same version. Build works on Windows:
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on https://github.com/timotheecour/asynctools@#pr_fix_compilation already satisfied
Verifying dependencies for asynctools@#pr_fix_compilation
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on vmath@>= 1.1.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on chroma@>= 0.2.5 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on zippy@>= 0.6.2 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on flatty@>= 0.2.2 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on nimsimd@>= 1.0.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on bumpy@>= 1.0.3 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on vmath@>= 1.0.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on nimpb_protoc@any version already satisfied
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Building lunarender3/lunarender3.exe using c backend
But fails on linux:
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on httpbeast@>= 0.2.2 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on asynctools@#0e6bdc3ed5bae8c7cc9 already satisfied
Verifying dependencies for asynctools@#0e6bdc3ed5bae8c7cc9
Info: Dependency on https://github.com/timotheecour/asynctools@#pr_fix_compilation already satisfied
Verifying dependencies for asynctools@#pr_fix_compilation
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on vmath@>= 1.1.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on chroma@>= 0.2.5 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on zippy@>= 0.6.2 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on flatty@>= 0.2.2 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on nimsimd@>= 1.0.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on bumpy@>= 1.0.3 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on vmath@>= 1.0.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on nimpb_protoc@any version already satisfied
Verifying dependencies for [email protected]
Info: Dependency on zippy@>= 0.7.4 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Info: Dependency on [email protected] already satisfied
Verifying dependencies for [email protected]
Building lunarender3/lunarender3 using c backend
Tip: 35 messages have been suppressed, use --verbose to show them.
Error: Build failed for package: lunarender3
... Execution failed with exit code 1
... Command: /home/severak/.nimble/bin/nim c --colors:on --noNimblePath -d:NimblePkgVersion=0.1.0 --path:/home/severak/.nimble/pkgs/jester-0.5.0 --path:/home/severak/.nimble/pkgs/httpbeast-0.4.0 --path:'/home/severak/.nimble/pkgs/asynctools-#0e6bdc3ed5bae8c7cc9' --path:'/home/severak/.nimble/pkgs/asynctools-#pr_fix_compilation' --path:/home/severak/.nimble/pkgs/pixie-3.1.2 --path:/home/severak/.nimble/pkgs/vmath-1.1.4 --path:/home/severak/.nimble/pkgs/chroma-0.2.5 --path:/home/severak/.nimble/pkgs/zippy-0.9.11 --path:/home/severak/.nimble/pkgs/flatty-0.3.4 --path:/home/severak/.nimble/pkgs/nimsimd-1.0.8 --path:/home/severak/.nimble/pkgs/bumpy-1.1.1 --path:/home/severak/.nimble/pkgs/vmath-1.1.4 --path:/home/severak/.nimble/pkgs/nimpb-0.2.0 --path:/home/severak/.nimble/pkgs/nimpb_protoc-0.1.0 --path:/home/severak/.nimble/pkgs/zippy-0.9.11 --path:/home/severak/.nimble/pkgs/cligen-1.5.20 --path:/home/severak/.nimble/pkgs/benchy-0.0.1 --hints:off -o:/home/severak/lunarender3/lunarender3 /home/severak/lunarender3/src/lunarender3.nim
/home/severak/.nimble/pkgs/pixie-3.1.2/pixie/fileformats/gif.nim(104, 14) Error: undeclared identifier: 'initBitStream'
candidates (edit distance, scope distance); see '--spellSuggest':
(5, 5): 'bitstreams' [module declared in /home/severak/.nimble/pkgs/pixie-3.1.2 /pixie/fileformats/gif.nim(1, 69)]
Is there any way how to synchronize dependencies version on these two different environments? Can somebody try to build my program?
I just got your program to build on Linux with fresh git clones at HEAD of all its transitive deps with a few minor fix-ups. { These may not be the best workarounds/fixes, but they compile, anyway. :-) }
diff --git a/src/lunarender3.nim b/src/lunarender3.nim
index dcf2be0..7b6bf3e 100644
--- a/src/lunarender3.nim
+++ b/src/lunarender3.nim
@@ -8,6 +8,7 @@ import benchy
import style
import zippy
import os
+let ffPng = PngFormat # pixie probably renamed this
proc server(data="test.mbtiles", port=5000, cache="") =
## starts tile-serving server
and
diff --git a/src/tile.nim b/src/tile.nim
index 26e2ccf..b85f153 100644
--- a/src/tile.nim
+++ b/src/tile.nim
@@ -33,7 +33,7 @@ proc toDrawType*(ftype: vector_tile_Tile_GeomType): FeatDrawType =
result = dtPoint
of LINESTRING:
result = dtLine
- of POLYGON:
+ of POLYGONS:
result = dtPolygon
proc `$`(tileValue: vector_tile_Tile_Value): string =
diff --git a/src/vector_tile.proto b/src/vector_tile.proto
index 13b9b80..dc28958 100644
--- a/src/vector_tile.proto
+++ b/src/vector_tile.proto
@@ -9,7 +9,7 @@ message Tile {
UNKNOWN = 0;
POINT = 1;
LINESTRING = 2;
- POLYGON = 3;
+ POLYGONS = 3;
}
// Variant type encoding
diff --git a/src/vector_tile_pb.nim b/src/vector_tile_pb.nim
index dd2860d..7f60f61 100644
--- a/src/vector_tile_pb.nim
+++ b/src/vector_tile_pb.nim
@@ -13,7 +13,7 @@ type
UNKNOWN = 0
POINT = 1
LINESTRING = 2
- POLYGON = 3
+ POLYGONS = 3 # bumpy defines a `type Polygon`
vector_tile_Tile* = ref vector_tile_TileObj
vector_tile_TileObj* = object of Message
layers: seq[vector_tile_Tile_Layer]
So, you may want to make similar-ish updates to get it working again, then update all your dep versions to be the most recent, and then, to avoid future woes, introduce a "version lock file" situation as Araq mentioned.After some fidddling here and there (manually installing nimpb, tweaking built process a bit), Cblake's method worked. Thanks a lot for posting it!
However, I needed to compile nimble on both linux and windows, which is not exactly user friendly.