Project

General

Profile

Actions

Bug #18805

closed

make it easy to compile our go binaries statically

Added by Ward Vandewege almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Story points:
-
Release relationship:
Auto

Subtasks 1 (0 open1 closed)

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

Updated by Ward Vandewege almost 3 years ago

  • Status changed from New to In Progress
Actions #2

Updated by Ward Vandewege almost 3 years 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 almost 3 years 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 almost 3 years 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 almost 3 years ago

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

Updated by Peter Amstutz over 2 years ago

  • Release set to 46
Actions

Also available in: Atom PDF