pelias / pbf2json

An OpenStreetMap pbf parser which exports json, allows you to cherry-pick tags and handles denormalizing ways and relations. Available as a standalone binary and comes with a convenient npm wrapper.
https://pelias.io
MIT License
143 stars 36 forks source link

build: update build targets (OS/ARCH) #107

Closed missinglink closed 3 years ago

missinglink commented 3 years ago

this PR makes some changes to the way the prebuilt binaries in ./build are generated:

I'm assuming that both linux/darwin 64-bit ARM machines return arm64 as their arch and not arm? Can someone with one of these machines please confirm with require('os') os.platform(), os.arch()?

note: this effectively drops support for 32-bit architectures, which I'm fine with, it is 2021 after all...

missinglink commented 3 years ago

The windows binary is named pbf2json.win32-x64, does that even make sense? ie. don't win32 and x64 contradict each other?

[edit] agh yeah this seems to be correct, weird, but correct: https://nodejs.org/api/process.html#process_process_platform

orangejulius commented 3 years ago

Here you go :)

$ node
Welcome to Node.js v17.0.1.
Type ".help" for more information.
> const os = require('os');
undefined
> os.platform()
'darwin'
> os.arch()
'arm64'
orangejulius commented 3 years ago

I checked out this branch on my M1 Macbook Air. All the nodejs tests pass, and running go build works fine.

There's one tiny minor failure when running go test:

$ go test
--- FAIL: TestComputeCentroidForClosedPolygon (0.00s)
    centroid_test.go:84: 
            Error Trace:    centroid_test.go:84
            Error:          Not equal: 
                            expected: "0.0000000"
                            actual  : "-0.0000000"

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1 +1 @@
                            -0.0000000
                            +-0.0000000
            Test:           TestComputeCentroidForClosedPolygon
FAIL
exit status 1
FAIL    github.com/pelias/pbf2json  0.123s