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.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 58B9F1810C; Thu, 29 Jul 2021 10:11:29 +0000 (UTC) Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id A9DE617ED5; Thu, 29 Jul 2021 10:10:22 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id C881A17E15; Thu, 29 Jul 2021 10:10:17 +0000 (UTC) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by atuin.qyliss.net (Postfix) with ESMTPS id 1A35217D5D for ; Thu, 29 Jul 2021 10:10:09 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id CD5123200977 for ; Thu, 29 Jul 2021 06:10:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 29 Jul 2021 06:10:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Ag5mO/5VnKWtD aIpaesXBlTKE8rFS25HAhYICSI9z10=; b=fFozOgg6h+nK/fRj3Am/meoAanrMX 8QgbhUqo5v5TtdafaOpw2gUo5QMX9HJ70I2YTEsyzYJY7d++Ri/myGajPIRiFXcL zmEx6qTG6aS1G21or/Pr479NbYTzk/Lc2ePLN/kWWXuU7rkOJuL8QnacRvydO4q/ xu/MZE6iLEs84Vu8HcfD9jltO5sXSoqol/PB8uxkP6SkCFKd1p2ZxBNi4P1dDP9D sXtyLmy4j6jyX0tLwbtt22t7Uo6R9bm5Ra6NvP2B4E7Em2Kv95AFmGNZ8kliwWmB qNmlU8YAhdDBEOqydsbfg6X3viTGfHoaCp2iVGj0Gycmiom83gOVVNX8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=Ag5mO/5VnKWtDaIpaesXBlTKE8rFS25HAhYICSI9z10=; b=qluSlbqH Wj0DM0mQrqp8bJH/XdAhbvgLJNvGqKMoRROo+WhplMywcEvL61cHoj2S5rOSUckt SL+2hVniIAnnW/Qp+eTsItIugdNI0r201RY9apMskDr9ZieVHPeAvedK3SbSUnrN MQl6uVqLETYNuLWKXubf575usUsfOge7G0NYK3Kx3nch1JCe9yCewaz92cz8/cIY DDxZIC0TnrTDnppDp/suduESgah3wVHWj9AkPG4WVJRsQxY9BJ/dnc6u5H8m+vjv KX4wm/sAsLhzyWW/qqna/ShPY5yLOrawJ/5VDKpN8HUCfm7UR3K8ayACcygmCmcf YBJonrkRfspBXw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrhedugddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhs qeenucggtffrrghtthgvrhhnpeehtdektefhudduffehtdffgedttdehgfefleegvdehgf eifedvveeutdefieetieenucffohhmrghinhepghhordhtohenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehqhihlihhsshesvghvvgdrqhihlh hishhsrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 29 Jul 2021 06:10:07 -0400 (EDT) Received: by eve.qyliss.net (Postfix, from userid 1000) id 0228913E9; Thu, 29 Jul 2021 10:10:03 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH nixpkgs 1/6] chromiumOSPackages.vm_protos: set full go_package Date: Thu, 29 Jul 2021 10:09:23 +0000 Message-Id: <20210729100928.1965341-2-hi@alyssa.is> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210729100928.1965341-1-hi@alyssa.is> References: <20210729100928.1965341-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: OPPZHFRKJ55IHXZXDM2YDMGATIP5S5G5 X-Message-ID-Hash: OPPZHFRKJ55IHXZXDM2YDMGATIP5S5G5 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 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: This will be required by future versions of protoc-gen-go. (Current versions already warn about it.) --- ...-mk-don-t-leak-source-absolute-paths.patch | 4 +- ...ommon-mk-.gn-don-t-hardcode-env-path.patch | 4 +- ...er-don-t-leak-source-absolute-paths.patch} | 6 +- ...tools-sommelier-Switch-to-the-stabl.patch} | 6 +- .../linux/chromium-os/sommelier/default.nix | 4 +- ...-goproto_library-source_relative-opt.patch | 48 +++++++++ ...tools-proto-set-go_package-correctly.patch | 102 ++++++++++++++++++ .../linux/chromium-os/vm_protos/default.nix | 5 + 8 files changed, 167 insertions(+), 12 deletions(-) rename pkgs/os-specific/linux/chromium-os/sommelier/{0003-sommelier-don-t-leak-source-absolute-paths.patch => 0005-sommelier-don-t-leak-source-absolute-paths.patch} (82%) rename pkgs/os-specific/linux/chromium-os/sommelier/{0004-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch => 0006-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch} (99%) create mode 100644 pkgs/os-specific/linux/chromium-os/vm_protos/0003-common-mk-add-goproto_library-source_relative-opt.patch create mode 100644 pkgs/os-specific/linux/chromium-os/vm_protos/0004-vm_tools-proto-set-go_package-correctly.patch diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch b/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch index 03ec2b1df64..c2e33dbde66 100644 --- a/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch +++ b/pkgs/os-specific/linux/chromium-os/common-mk/0001-common-mk-don-t-leak-source-absolute-paths.patch @@ -1,7 +1,7 @@ From ae0c98ed2715c685b0cb97ac6e5d65101168b625 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 24 Nov 2019 16:56:11 +0000 -Subject: [PATCH 1/4] common-mk: don't leak source-absolute paths +Subject: [PATCH 1/6] common-mk: don't leak source-absolute paths Source-absolute paths like //vm_tools/whatever were being leaked to subprocesses, which of course didn't know how to understand them. @@ -203,5 +203,5 @@ index e64aedabe0..fb9fb4231d 100644 } } -- -2.31.1 +2.32.0 diff --git a/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch b/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch index 95f29531fec..a6ac5b1e9ac 100644 --- a/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch +++ b/pkgs/os-specific/linux/chromium-os/common-mk/0002-common-mk-.gn-don-t-hardcode-env-path.patch @@ -1,7 +1,7 @@ From 7d33bcd724ec79d00281c2752f9642be25782370 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 24 Nov 2019 17:20:46 +0000 -Subject: [PATCH 2/4] common-mk: .gn: don't hardcode env path +Subject: [PATCH 2/6] common-mk: .gn: don't hardcode env path This is needlessly non-portable. --- @@ -19,5 +19,5 @@ index e7dba8c91c..e29fcd61ee 100644 -script_executable = "/usr/bin/env" +script_executable = "env" -- -2.31.1 +2.32.0 diff --git a/pkgs/os-specific/linux/chromium-os/sommelier/0003-sommelier-don-t-leak-source-absolute-paths.patch b/pkgs/os-specific/linux/chromium-os/sommelier/0005-sommelier-don-t-leak-source-absolute-paths.patch similarity index 82% rename from pkgs/os-specific/linux/chromium-os/sommelier/0003-sommelier-don-t-leak-source-absolute-paths.patch rename to pkgs/os-specific/linux/chromium-os/sommelier/0005-sommelier-don-t-leak-source-absolute-paths.patch index c37876988f9..d40ff8f022c 100644 --- a/pkgs/os-specific/linux/chromium-os/sommelier/0003-sommelier-don-t-leak-source-absolute-paths.patch +++ b/pkgs/os-specific/linux/chromium-os/sommelier/0005-sommelier-don-t-leak-source-absolute-paths.patch @@ -1,7 +1,7 @@ -From e3995d3367ae642f3eb0b4c395813af47464a65f Mon Sep 17 00:00:00 2001 +From 04bdfd44bbaa9f619d3ff03cad3273c46493396e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 1 Dec 2019 17:04:04 +0000 -Subject: [PATCH 3/4] sommelier: don't leak source-absolute paths +Subject: [PATCH 5/6] sommelier: don't leak source-absolute paths --- vm_tools/sommelier/wayland_protocol.gni | 2 +- @@ -21,5 +21,5 @@ index f894adf81d..28bb5a006b 100644 } } -- -2.31.1 +2.32.0 diff --git a/pkgs/os-specific/linux/chromium-os/sommelier/0004-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch b/pkgs/os-specific/linux/chromium-os/sommelier/0006-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch similarity index 99% rename from pkgs/os-specific/linux/chromium-os/sommelier/0004-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch rename to pkgs/os-specific/linux/chromium-os/sommelier/0006-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch index 5db01538eae..c7b1eeafc0d 100644 --- a/pkgs/os-specific/linux/chromium-os/sommelier/0004-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch +++ b/pkgs/os-specific/linux/chromium-os/sommelier/0006-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch @@ -1,7 +1,7 @@ -From ac39fe3d341cc33dfd5f47d5301c2a6aaf743a34 Mon Sep 17 00:00:00 2001 +From e97193872755e44aae51dd88e9323d8a069a40ca Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 2 Apr 2021 17:55:55 +0000 -Subject: [PATCH 4/4] Revert "Revert "vm_tools: sommelier: Switch to the stable +Subject: [PATCH 6/6] Revert "Revert "vm_tools: sommelier: Switch to the stable version of xdg-shell"" This reverts commit 32050c0ea6c00c16999915856b40a6a6b8b41bb9. @@ -1836,5 +1836,5 @@ index 79bcf6a3b3..d3157cd8a9 100644 struct wl_list link; }; -- -2.31.1 +2.32.0 diff --git a/pkgs/os-specific/linux/chromium-os/sommelier/default.nix b/pkgs/os-specific/linux/chromium-os/sommelier/default.nix index c995689c4f5..b45ab330c34 100644 --- a/pkgs/os-specific/linux/chromium-os/sommelier/default.nix +++ b/pkgs/os-specific/linux/chromium-os/sommelier/default.nix @@ -7,8 +7,8 @@ common-mk { platformSubdir = "vm_tools/sommelier"; platform2Patches = [ - ./0003-sommelier-don-t-leak-source-absolute-paths.patch - ./0004-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch + ./0005-sommelier-don-t-leak-source-absolute-paths.patch + ./0006-Revert-Revert-vm_tools-sommelier-Switch-to-the-stabl.patch ]; buildInputs = [ diff --git a/pkgs/os-specific/linux/chromium-os/vm_protos/0003-common-mk-add-goproto_library-source_relative-opt.patch b/pkgs/os-specific/linux/chromium-os/vm_protos/0003-common-mk-add-goproto_library-source_relative-opt.patch new file mode 100644 index 00000000000..e921abd8032 --- /dev/null +++ b/pkgs/os-specific/linux/chromium-os/vm_protos/0003-common-mk-add-goproto_library-source_relative-opt.patch @@ -0,0 +1,48 @@ +From 211eea8e623c9e9beb61f38720c718f080bae883 Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Mon, 28 Jun 2021 17:10:46 +0000 +Subject: [PATCH 3/6] common-mk: add goproto_library source_relative opt + +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. + +Reviewed-by: Cole Helbling +--- + 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.32.0 + diff --git a/pkgs/os-specific/linux/chromium-os/vm_protos/0004-vm_tools-proto-set-go_package-correctly.patch b/pkgs/os-specific/linux/chromium-os/vm_protos/0004-vm_tools-proto-set-go_package-correctly.patch new file mode 100644 index 00000000000..d77bcf2bdef --- /dev/null +++ b/pkgs/os-specific/linux/chromium-os/vm_protos/0004-vm_tools-proto-set-go_package-correctly.patch @@ -0,0 +1,102 @@ +From fae12c5b06864c0a9687320735c9bed9219c30c8 Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Wed, 16 Jun 2021 16:09:01 +0000 +Subject: [PATCH 4/6] vm_tools: proto: set go_package correctly + +protoc-gen-go 1.5.x has become a lot stricter about this. We have to +use import_mapping for common.proto because it ends up being included +in multiple Go libraries. I'm not sure why it needs to be built once +per library, but that's the way it works. + +Reviewed-by: Cole Helbling +--- + vm_tools/proto/BUILD.gn | 5 +++++ + vm_tools/proto/tremplin.proto | 2 +- + vm_tools/proto/vm_crash.proto | 2 +- + vm_tools/proto/vm_guest.proto | 1 + + vm_tools/proto/vm_host.proto | 1 + + 5 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/vm_tools/proto/BUILD.gn b/vm_tools/proto/BUILD.gn +index 79c9b94c9f..aadc40165c 100644 +--- a/vm_tools/proto/BUILD.gn ++++ b/vm_tools/proto/BUILD.gn +@@ -60,6 +60,8 @@ goproto_library("vm-crash-gorpcs") { + proto_in_dir = "./" + proto_out_dir = "go/src/chromiumos/vm_tools/vm_crash" + gen_grpc = true ++ source_relative = true ++ import_mapping = [ "common.proto=chromiumos/vm_tools/vm_crash" ] + sources = [ + "${proto_in_dir}/common.proto", + "${proto_in_dir}/vm_crash.proto", +@@ -97,6 +99,7 @@ goproto_library("tremplin-gorpcs") { + proto_in_dir = "./" + proto_out_dir = "go/src/chromiumos/vm_tools/tremplin_proto" + gen_grpc = true ++ source_relative = true + sources = [ "${proto_in_dir}/tremplin.proto" ] + } + +@@ -120,6 +123,8 @@ goproto_library("vm-gorpcs") { + proto_in_dir = "./" + proto_out_dir = "go/src/chromiumos/vm_tools/vm_rpc" + gen_grpc = true ++ source_relative = true ++ import_mapping = [ "common.proto=chromiumos/vm_tools/vm_rpc" ] + sources = [ + "${proto_in_dir}/common.proto", + "${proto_in_dir}/vm_guest.proto", +diff --git a/vm_tools/proto/tremplin.proto b/vm_tools/proto/tremplin.proto +index aac76f7a9e..e6a7bbed0e 100644 +--- a/vm_tools/proto/tremplin.proto ++++ b/vm_tools/proto/tremplin.proto +@@ -8,7 +8,7 @@ option cc_enable_arenas = true; + + // This file defines services for tremplin, the container springboard service. + package vm_tools.tremplin; +-option go_package = "tremplin_proto"; ++option go_package = "chromiumos/vm_tools/tremplin_proto"; + + // This needs to be duplicated because the gyp rule for building + // go code makes it difficult to have imports. +diff --git a/vm_tools/proto/vm_crash.proto b/vm_tools/proto/vm_crash.proto +index 6e4f62fe13..3cd4279989 100644 +--- a/vm_tools/proto/vm_crash.proto ++++ b/vm_tools/proto/vm_crash.proto +@@ -7,7 +7,7 @@ syntax = "proto3"; + option cc_enable_arenas = true; + + package vm_tools.cicerone; +-option go_package = "vm_crash"; ++option go_package = "chromiumos/vm_tools/vm_crash"; + + import "common.proto"; + +diff --git a/vm_tools/proto/vm_guest.proto b/vm_tools/proto/vm_guest.proto +index 86f11d0812..d0946078d5 100644 +--- a/vm_tools/proto/vm_guest.proto ++++ b/vm_tools/proto/vm_guest.proto +@@ -8,6 +8,7 @@ option cc_enable_arenas = true; + + // This file defines services that will be running in the guest VM. + package vm_tools; ++option go_package = "chromiumos/vm_tools/vm_rpc"; + + import "common.proto"; + import "google/protobuf/timestamp.proto"; +diff --git a/vm_tools/proto/vm_host.proto b/vm_tools/proto/vm_host.proto +index a8bd066f61..19759b0271 100644 +--- a/vm_tools/proto/vm_host.proto ++++ b/vm_tools/proto/vm_host.proto +@@ -8,6 +8,7 @@ option cc_enable_arenas = true; + + // This file defines services that will be running on the host for the VM. + package vm_tools; ++option go_package = "chromiumos/vm_tools/vm_rpc"; + + import "common.proto"; + +-- +2.32.0 + diff --git a/pkgs/os-specific/linux/chromium-os/vm_protos/default.nix b/pkgs/os-specific/linux/chromium-os/vm_protos/default.nix index e87d0c57e78..cded9c988b3 100644 --- a/pkgs/os-specific/linux/chromium-os/vm_protos/default.nix +++ b/pkgs/os-specific/linux/chromium-os/vm_protos/default.nix @@ -7,6 +7,11 @@ common-mk { nativeBuildInputs = [ go-protobuf ]; buildInputs = [ grpc openssl protobuf ]; + platform2Patches = [ + ./0003-common-mk-add-goproto_library-source_relative-opt.patch + ./0004-vm_tools-proto-set-go_package-correctly.patch + ]; + NIX_CFLAGS_COMPILE = [ "-Wno-error=array-bounds" "-Wno-error=deprecated-declarations" -- 2.32.0