Project

General

Profile

Actions

Bug #18805

closed

make it easy to compile our go binaries statically

Added by Ward Vandewege 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
02/28/2022
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release relationship:
Auto

Subtasks 1 (0 open1 closed)

Task #18806: review 18805-easy-static-compilationResolvedTom Clegg02/28/2022

Actions
Actions #1

Updated by Ward Vandewege 4 months ago

  • Status changed from New to In Progress
Actions #2

Updated by Ward Vandewege 4 months ago

Ready for review at 9ffdf93f954bfe7bfe2269d361961d653caea146 on branch 18805-easy-static-compilation

developer-run-tests: #2933

This makes

cd cmd/arvados-server
CGO_ENABLED=0 GOOS=linux go build -ldflags='-s -w -extldflags=-static' -tags static

work without issues.

Actions #3

Updated by Ward Vandewege 4 months ago

  • Subject changed from remove unnecessary C from our codebase to make it easy to compile our go binaries statically
Actions #4

Updated by Tom Clegg 4 months ago

LGTM.

For posterity, we determined C.sysconf(C._SC_CLK_TCK) always returns 100. The reason USER_HZ exists in the first place is to scale measurements based on the kernel-configurable HZ value to the units expected by lots of existing userland code that assumed HZ was always 100. IOW, USER_HZ is non-configurable constant by design. It is 100 on all platforms except alpha and ia64, i.e., on all platforms that have Go runtimes. Another data point: there's a Go sysconf library (https://github.com/tklauser/go-sysconf) whose _SC_CLK_TCK func just returns 100 instead of doing a syscall.

Actions #5

Updated by Ward Vandewege 4 months ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Resolved
Actions #6

Updated by Peter Amstutz 3 months ago

  • Release set to 46
Actions

Also available in: Atom PDF