Compile Pd failed on Mac m1
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Bug Report
There is a build error with make
### What did you do?
Run command `make build`.
### What did you expect to see?
Get the binary `pd-server` under the project folder
### What did you see instead?
It breaks with logs as follows:
```shell
hbu@Pauls-MacBook-Air pd % make build
./scripts/embed-dashboard-ui.sh
+ Clean up existing asset file
+ Fetch TiDB Dashboard Go module
- TiDB Dashboard directory: /Users/hbu/go/pkg/mod/github.com/pingcap/tidb-dashboard@v0.0.0-20220518164040-4d621864a9a0
+ Create download cache directory: /Users/hbu/TiDB/pd/.dashboard_download_cache
+ Discover TiDB Dashboard release version
- TiDB Dashboard release version: 2022.05.19.1
+ Check whether pre-built assets are available
- Cached archive does not exist
- Download pre-built embedded assets from GitHub release
- Download https://github.com/pingcap/tidb-dashboard/releases/download/v2022.05.19.1/embedded-assets-golang.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13.0M 100 13.0M 0 0 34428 0 0:06:36 0:06:36 --:--:-- 1146k
- Save archive to cache: /Users/hbu/TiDB/pd/.dashboard_download_cache/embedded-assets-golang-2022.05.19.1.zip
+ Unpack embedded asset from archive
Archive: /Users/hbu/TiDB/pd/.dashboard_download_cache/embedded-assets-golang-2022.05.19.1.zip
inflating: embedded_assets_handler.go
- Unpacked /Users/hbu/TiDB/pd/pkg/dashboard/uiserver/embedded_assets_handler.go
CGO_ENABLED=1 go build -gcflags '' -ldflags '-L/opt/homebrew/opt/llvm/lib -X "github.com/tikv/pd/server/versioninfo.PDReleaseVersion=v6.1.0-alpha-109-g6dd8240a-dirty" -X "github.com/tikv/pd/server/versioninfo.PDBuildTS=2022-06-08 07:25:42" -X "github.com/tikv/pd/server/versioninfo.PDGitHash=6dd8240aa9ccc5d43e5ec6c7da3635d780d90909" -X "github.com/tikv/pd/server/versioninfo.PDGitBranch=master" -X "github.com/tikv/pd/server/versioninfo.PDEdition=Community" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.InternalVersion=2022.05.19.1" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.Standalone=No" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.PDVersion=v6.1.0-alpha-109-g6dd8240a-dirty" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildTime=2022-06-08 07:25:42" -X "github.com/pingcap/tidb-dashboard/pkg/utils/version.BuildGitHash=4d621864a9a0"' -tags "" -o /Users/hbu/TiDB/pd/bin/pd-server cmd/pd-server/main.go
# github.com/shirou/gopsutil/disk
iostat_darwin.c:28:2: warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:132:1: note: 'IOMasterPort' has been explicitly marked deprecated here
# command-line-arguments
flag provided but not defined: -L/opt/homebrew/opt/llvm/lib
usage: link [options] main.o
-B note
add an ELF NT_GNU_BUILD_ID note when using ELF
-E entry
set entry symbol name
-H type
set header type
-I linker
use linker as ELF dynamic linker
-L directory
add specified directory to library path
-R quantum
set address rounding quantum (default -1)
-T address
set text segment address (default -1)
-V print version and exit
-X definition
add string value definition of the form importpath.name=value
-a no-op (deprecated)
-aslr
enable ASLR for buildmode=c-shared on windows (default true)
-benchmark string
set to 'mem' or 'cpu' to enable phase benchmarking
-benchmarkprofile base
emit phase profiles to base_phase.{cpu,mem}prof
-buildid id
record id as Go toolchain build id
-buildmode mode
set build mode
-c dump call graph
-compressdwarf
compress DWARF if possible (default true)
-cpuprofile file
write cpu profile to file
-d disable dynamic executable
-debugtextsize int
debug text section max size
-debugtramp int
debug trampolines
-dumpdep
dump symbol dependency graph
-extar string
archive program for buildmode=c-archive
-extld linker
use linker when linking in external mode
-extldflags flags
pass flags to external linker
-f ignore version mismatch
-g disable go package data checks
-h halt on error
-importcfg file
read import configuration from file
-installsuffix suffix
set package directory suffix
-k symbol
set field tracking symbol
-libgcc string
compiler support lib for internal linking; use "none" to disable
-linkmode mode
set link mode
-linkshared
link against installed Go shared libraries
-memprofile file
write memory profile to file
-memprofilerate rate
set runtime.MemProfileRate to rate
-msan
enable MSan interface
-n dump symbol table
-o file
write output to file
-pluginpath string
full path name for plugin
-r path
set the ELF dynamic linker search path to dir1:dir2:...
-race
enable race detector
-s disable symbol table
-strictdups int
sanity check duplicate symbol contents during object file reading (1=warn 2=err).
-tmpdir directory
use directory for temporary files
-v print link trace
-w disable DWARF generation
make: *** [pd-server] Error 2
```
### What version of PD are you using (`pd-server -V`)?
The latest code on branch `master`.
Contributor guide
Assessment
This issue has not been assessed yet.