From 066d877f4ab3baf786fed6553a056da2c0e010a7 Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Fri, 24 Oct 2025 12:46:29 -0700 Subject: [PATCH 1/8] Rename a variable --- Protobuf.Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index cfc6f9fb..933b2748 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -1,12 +1,12 @@ LOCAL_DIR := $(ROOT_DIR)/.local -LOCALBIN := $(LOCAL_DIR)/bin +LOCAL_BIN_DIR := $(LOCAL_DIR)/bin ## Versions PROTOC_VERSION=26.1 # protoc binary installation PROTOC_ZIP = protoc-$(PROTOC_VERSION)-osx-universal_binary.zip -PROTOC = $(LOCALBIN)/protoc@$(PROTOC_VERSION)/protoc +PROTOC = $(LOCAL_BIN_DIR)/protoc@$(PROTOC_VERSION)/protoc $(PROTOC): @echo Downloading protocol buffers... @mkdir -p $(LOCAL_DIR) From f732d4521c7e98899ec60468125b455aa229b9f2 Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Fri, 24 Oct 2025 12:46:57 -0700 Subject: [PATCH 2/8] Improve the assignment --- Protobuf.Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index 933b2748..9b0859fc 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -2,11 +2,11 @@ LOCAL_DIR := $(ROOT_DIR)/.local LOCAL_BIN_DIR := $(LOCAL_DIR)/bin ## Versions -PROTOC_VERSION=26.1 +PROTOC_VERSION := 26.1 # protoc binary installation -PROTOC_ZIP = protoc-$(PROTOC_VERSION)-osx-universal_binary.zip -PROTOC = $(LOCAL_BIN_DIR)/protoc@$(PROTOC_VERSION)/protoc +PROTOC_ZIP := protoc-$(PROTOC_VERSION)-osx-universal_binary.zip +PROTOC := $(LOCAL_BIN_DIR)/protoc@$(PROTOC_VERSION)/protoc $(PROTOC): @echo Downloading protocol buffers... @mkdir -p $(LOCAL_DIR) From 63a1caafce964a0b8ebcbabe6975239448d23f71 Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Fri, 24 Oct 2025 12:47:24 -0700 Subject: [PATCH 3/8] Fix a target definition --- Protobuf.Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index 9b0859fc..952b6f04 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -19,6 +19,7 @@ $(PROTOC): protoc_gen_grpc_swift: swift build --product protoc-gen-grpc-swift +.PHONY: protoc-gen-swift protoc-gen-swift: swift build --product protoc-gen-swift From f7524bc7803eddba86126ad9be313be58c068c69 Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Fri, 24 Oct 2025 12:51:00 -0700 Subject: [PATCH 4/8] Merge similar targets --- Protobuf.Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index 952b6f04..5479ef15 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -16,15 +16,13 @@ $(PROTOC): @unzip -o $(PROTOC_ZIP) 'include/*' -d $(dir $@) @rm -f $(PROTOC_ZIP) -protoc_gen_grpc_swift: - swift build --product protoc-gen-grpc-swift - .PHONY: protoc-gen-swift protoc-gen-swift: - swift build --product protoc-gen-swift + @$(SWIFT) build --product protoc-gen-swift + @$(SWIFT) build --product protoc-gen-grpc-swift .PHONY: protos -protos: $(PROTOC) protoc_gen_grpc_swift protoc-gen-swift +protos: $(PROTOC) protoc-gen-swift @echo Generating protocol buffers source code... @$(PROTOC) Sources/Containerization/SandboxContext/SandboxContext.proto \ --plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift \ From d49019aa6c8bd6c5f6937733a742015c1ac57c1b Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Fri, 24 Oct 2025 12:51:09 -0700 Subject: [PATCH 5/8] Improve comments --- Protobuf.Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index 5479ef15..d747dfce 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -1,10 +1,10 @@ LOCAL_DIR := $(ROOT_DIR)/.local LOCAL_BIN_DIR := $(LOCAL_DIR)/bin -## Versions +# Versions PROTOC_VERSION := 26.1 -# protoc binary installation +# Protoc binary installation PROTOC_ZIP := protoc-$(PROTOC_VERSION)-osx-universal_binary.zip PROTOC := $(LOCAL_BIN_DIR)/protoc@$(PROTOC_VERSION)/protoc $(PROTOC): From 909dd909640e6c7be65a4146e00eef69c6601aa3 Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Fri, 24 Oct 2025 19:28:10 -0700 Subject: [PATCH 6/8] Add a target to clean protos --- Protobuf.Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index d747dfce..e7a6b899 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -34,3 +34,7 @@ protos: $(PROTOC) protoc-gen-swift --swift_opt=Visibility=Public \ -I. @"$(MAKE)" update-licenses + +.PHONY: clean-protos +clean-protos: + @rm -rf $(LOCAL_DIR) From 3bf02808f179195075d72bacd1606220191121fa Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Wed, 29 Oct 2025 13:42:08 -0700 Subject: [PATCH 7/8] Add a license header --- Protobuf.Makefile | 14 ++++++++++++++ licenserc.toml | 1 + 2 files changed, 15 insertions(+) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index e7a6b899..9e252864 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -1,3 +1,17 @@ +# Copyright © 2025 Apple Inc. and the Containerization project authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + LOCAL_DIR := $(ROOT_DIR)/.local LOCAL_BIN_DIR := $(LOCAL_DIR)/bin diff --git a/licenserc.toml b/licenserc.toml index a7e2c041..43b81fcf 100644 --- a/licenserc.toml +++ b/licenserc.toml @@ -4,6 +4,7 @@ headerPath = "scripts/license-header.txt" includes = [ "Makefile", + "*.Makefile", "*.swift", "*.h", "*.cpp", From 9faec98cb5c8765f6b988e9af64cfb1ca7017f7d Mon Sep 17 00:00:00 2001 From: Dmitry Kovba Date: Wed, 29 Oct 2025 14:31:51 -0700 Subject: [PATCH 8/8] Improve the target for cleaning proto tools --- Protobuf.Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Protobuf.Makefile b/Protobuf.Makefile index 9e252864..3af1aaf2 100644 --- a/Protobuf.Makefile +++ b/Protobuf.Makefile @@ -49,6 +49,7 @@ protos: $(PROTOC) protoc-gen-swift -I. @"$(MAKE)" update-licenses -.PHONY: clean-protos -clean-protos: - @rm -rf $(LOCAL_DIR) +.PHONY: clean-proto-tools +clean-proto-tools: + @echo Cleaning proto tools... + @rm -rf $(LOCAL_DIR)/bin/protoc*