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

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

Merged
merged 1 commit into from
Nov 4, 2021
Merged

Conversation

missinglink
Copy link
Member

@missinglink missinglink commented Nov 4, 2021

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

  • adds a new build target pbf2json.darwin-arm64 to support the new Macs
  • deprecate and remove pbf2json.linux-arm (this was a 32-bit build)
  • add pbf2json.linux-arm64 to replace it (64-bit linux ARM build)
  • fix pbf2json.win32-x64 (this was a 32-bit build incorrectly labeled as 64-bit)

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
Copy link
Member Author

missinglink commented Nov 4, 2021

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
Copy link
Member

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
Copy link
Member

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

@missinglink missinglink merged commit 5280e18 into master Nov 4, 2021
@missinglink missinglink deleted the compile-targets branch November 4, 2021 15:02
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.

2 participants