kmesh icon indicating copy to clipboard operation
kmesh copied to clipboard

`make build` should build kmeshctl

Open hzxuzhonghu opened this issue 11 months ago • 3 comments

What would you like to be added:

Now when running make build, it does not build kmeshctl. We have to run make kmeshctl. I would think make build should build all the components

Why is this needed:

hzxuzhonghu avatar Dec 12 '24 02:12 hzxuzhonghu

I thought to replace in Makefile:

.PHONY: build
build:
	 VERSION=$(VERSION) ./kmesh_compile.sh

OUT ?= kmeshctl
.PHONY: kmeshctl
kmeshctl:
	$(call printlog, BUILD, $(APPS4))
	$(QUIET) (export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(ROOT_DIR)mk; \
		CGO_ENABLED=0 $(GO) build -gcflags $(GOGCFLAGS) -ldflags $(GOLDFLAGS) -o $(OUT) $(GOFLAGS) ./ctl/main.go)

with

.PHONY: build 

OUT ?= kmeshctl

build: 
	VERSION=$(VERSION) ./kmesh_compile.sh
	$(QUIET) (export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(ROOT_DIR)mk; \
		CGO_ENABLED=0 $(GO) build -gcflags $(GOGCFLAGS) -ldflags $(GOLDFLAGS) -o $(OUT) $(GOFLAGS) ./ctl/main.go)

I tried this and it works fine and no test error.

Insomniac2904 avatar Dec 17 '24 16:12 Insomniac2904

@Insomniac2904 My mistake, seems build.sh is calling make in the container, but does not copy the built binaries to the host. We should fix the copy_to_host in hack/utils.sh

hzxuzhonghu avatar Dec 18 '24 01:12 hzxuzhonghu

/assign

adwait-godbole avatar Jan 29 '25 19:01 adwait-godbole

/assign

Flying-Tom avatar May 22 '25 08:05 Flying-Tom