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

make build should build kmeshctl #1113

Open
hzxuzhonghu opened this issue Dec 12, 2024 · 2 comments
Open

make build should build kmeshctl #1113

hzxuzhonghu opened this issue Dec 12, 2024 · 2 comments
Labels
good first issue Good for newcomers kind/enhancement New feature or request

Comments

@hzxuzhonghu
Copy link
Member

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 hzxuzhonghu added kind/enhancement New feature or request good first issue Good for newcomers labels Dec 12, 2024
@Insomniac2904
Copy link
Contributor

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.

@hzxuzhonghu
Copy link
Member Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants