From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.5 Received: by atuin.qyliss.net (Postfix, from userid 496) id 2659B46292; Mon, 28 Jun 2021 17:32:09 +0000 (UTC) Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id A7B33461D1; Mon, 28 Jun 2021 17:31:44 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id A43304620E; Mon, 28 Jun 2021 17:31:41 +0000 (UTC) Received: from forward3-smtp.messagingengine.com (forward3-smtp.messagingengine.com [66.111.4.237]) by atuin.qyliss.net (Postfix) with ESMTPS id CDF4A4618B for ; Mon, 28 Jun 2021 17:31:35 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailforward.nyi.internal (Postfix) with ESMTP id C5C491940397; Mon, 28 Jun 2021 13:31:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 28 Jun 2021 13:31:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=PkfjxEqzxgjojIoN5YABlimCV7Ur4Et23jHL6+iGgeU=; b=e60mbOo1 Ubt90ZGQ+vl/mzw+BQYoE2oQKSV/x5HS9yJGgNa7SupFWhRtaQWhlJNKwOdeTGSt uMIvrbd79ok49JXuG1KmfPf22yDTLBEWsIROPmXOUiAyKCaP0zpFcUMyLAIinxaw GiF8XEygWvXoLL2ZLVOymNEhwzr93c3H/BuFLNlqwNkhDLC4C7SQk++vRjVmBpFf Cpt251CrE2P6hnWfIuO5ROFKoiBp4os4vgbsYjLDpW9RUhsdjdg+vvgdbIuHoKGH 0kvE6+Odhs8mu/MW+KVbMx3XpRXlra37vEFjng7TT2t8uW1Paa1JA1jUmgMcAws8 D1CY6BVjKkHXSQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeehgedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehlhihs shgrucftohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhephe dtkeethfduudffhedtffegtddthefgfeelgedvhefgieefvdevuedtfeeiteeinecuffho mhgrihhnpehgohdrthhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepqhihlhhishhssegvvhgvrdhqhihlihhsshdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Jun 2021 13:31:33 -0400 (EDT) Received: by eve.qyliss.net (Postfix, from userid 1000) id 8C5A215EE; Mon, 28 Jun 2021 17:31:31 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH platform2 1/2] common-mk: add goproto_library source_relative opt Date: Mon, 28 Jun 2021 17:31:05 +0000 Message-Id: <20210628173106.1128138-2-hi@alyssa.is> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210628173106.1128138-1-hi@alyssa.is> References: <20210628173106.1128138-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 45WCL7H7OQXYHBGYW6PWDOCOZTD4QKUP X-Message-ID-Hash: 45WCL7H7OQXYHBGYW6PWDOCOZTD4QKUP X-MailFrom: qyliss@eve.qyliss.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Puck Meerburg X-Mailman-Version: 3.3.4 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We need this for the go_package changes in protoc-gen-go 1.5.x. If we didn't use source-relative paths, the full module path would be repeated in the output location, so we'd get paths like src/chromiumos/vm_tools/vm_crash/chromiumos/vm_tools/vm_crash/vm_crash.pb.go. To avoid the duplication, we either need to set source_relative, or set proto_out_dir to just go/src. The latter isn't workable, because then everything two libraries that both use common.proto will both generate outputs called "go/src/common.pb.go", which will upset GN. --- common-mk/proto_library.gni | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common-mk/proto_library.gni b/common-mk/proto_library.gni index fb9fb4231d..23645a134f 100644 --- a/common-mk/proto_library.gni +++ b/common-mk/proto_library.gni @@ -225,6 +225,9 @@ template("proto_library") { # proto_lib_dirs (optional) # Directories to search for protos a proto file depends on. # proto_in_dir and "${sysroot}/usr/share/proto" are added by default. +# source_relative (optional) +# If true, the output file is placed in the same relative directory as the +# input file (but under proto_out_dir). template("goproto_library") { action(target_name) { forward_variables_from(invoker, @@ -254,6 +257,10 @@ template("goproto_library") { go_plugin_parameters = [] + if (defined(invoker.source_relative) && invoker.source_relative) { + go_plugin_parameters += [ "paths=source_relative" ] + } + if (defined(invoker.gen_grpc) && invoker.gen_grpc) { go_plugin_parameters += [ "plugins=grpc" ] } -- 2.31.1