From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by sourceware.org (Postfix) with ESMTPS id D42903839C45 for ; Tue, 24 May 2022 11:27:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D42903839C45 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f49.google.com with SMTP id f21so21008977ejh.11 for ; Tue, 24 May 2022 04:27:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fc8nDIZz+wetmkB21SBLDKxJFgLiqztTtm78UtW8YPI=; b=518oNp5QpuHA0eDxKBRcup6ixT+UuLGc5MtGDJnMRTU+f9LSrgeOOiBAmlx7ZAPv4j kcAy5uwq3PJQ3E3ihKXSwxYZJqVY47t4Q1heaAB/rwLuS9pem2tDD/IoqPaQsnY5M1mZ fGOzLnWYdNdWiRpXLWLVOFszdwZQP7/GpIRglfyFdYE2F14uRqmQw61BzvJvLhVpfXrx 7osLE7OGNWyhvPwkiUvZu67p2VcVXtJ7xKm6suLc/mg0pCALSheh65o2TSeElWvYPsFa bQJckOh3O5ySXxpcyth1X6wH/BhEdVbdfGg8u1tb/VjjHwPon8pkzLkJdEKCP6jy1jl2 3IKQ== X-Gm-Message-State: AOAM531Rb7vPyO/+SE+vjyrrxF2giGcZjSmrix2QN8e3EeN2xBpi1zTh mXZ5qq4S+AnQiuj2qAXaHHVZrIJxZvJ8vQ== X-Google-Smtp-Source: ABdhPJzJ+DasYWhkl57gx4tk/9mH5Yrf2IL6oqnlye+g7hhwWEtF6qCkQItemshGDF4zm9joZjfGTw== X-Received: by 2002:a17:907:1c21:b0:6f4:7a8a:d6a2 with SMTP id nc33-20020a1709071c2100b006f47a8ad6a2mr24111660ejc.288.1653391626424; Tue, 24 May 2022 04:27:06 -0700 (PDT) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com. [209.85.218.50]) by smtp.gmail.com with ESMTPSA id zm17-20020a170906995100b006fef0c7072esm1645647ejb.144.2022.05.24.04.27.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 May 2022 04:27:05 -0700 (PDT) Received: by mail-ej1-f50.google.com with SMTP id f21so21008859ejh.11 for ; Tue, 24 May 2022 04:27:05 -0700 (PDT) X-Received: by 2002:a17:907:1c01:b0:6f4:2692:e23 with SMTP id nc1-20020a1709071c0100b006f426920e23mr23462115ejc.243.1653391625369; Tue, 24 May 2022 04:27:05 -0700 (PDT) MIME-Version: 1.0 References: <20220515191846.114257-1-luca.boccassi@gmail.com> <87y1yr1dgy.fsf@oracle.com> In-Reply-To: <87y1yr1dgy.fsf@oracle.com> From: Luca Boccassi Date: Tue, 24 May 2022 12:26:54 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ld: add --package-metadata To: "Jose E. Marchesi" Cc: binutils@sourceware.org, Nick Clifton Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2022 11:27:10 -0000 On Tue, 24 May 2022 at 12:13, Jose E. Marchesi wrote: > > > Hi Luca. > > >> I've added an optional usage of libjansson to provide additional validation, > >> so that it doesn't have to be reimplemented everywhere a thousand > >> times over. > >> For bootstrapping purposes the dep is optional and can be skipped, for example > >> in Debian/Ubuntu it would be annotated with so that everything > >> works out of the box. > > As far as I can see at https://systemd.io/COREDUMP_PACKAGE_METADATA/ the > payload encoded in JSON comprises a single object which must be a > dictionary, whose entries all contain strings. Basically: > > {"..." : "..."[, "..." : "..."]*} > > Isn't it a bit overkill to add a dependency to an external library just > to verify the format of the above? A regular expression would suffice, > even if a fastidious one due to the string format: > > S -> JSON string > B -> [\n\t ]* > > PAYLOAD -> B{BSB:BSB(,SB:BSB)*}B Hi, The specification actually is very explicit in supporting a full json payload, with the only limitations (certain unicode characters, int ranges) being explicitly called out. The example given is simple because it's just an example. I do expect the usage to expand at some point in the future. As mentioned in the patch the validation is entirely optional, and nothing will happen if the build dependency isn't provided, which will be the default in all distros. And it can also be explicitly disabled if desired. I could flip the default to force-disable if desired, but in practice I don't think it would make much difference, given how packages are built in minimal environments already. As a distribution builder I would very very much like to find out about build-time issues at build time, rather than at runtime. It's much cheaper and immediate. When you have 50000+ packages it is very much unrealistic to expect to runtime QA them all for every little thing like this. An automated, implicit build time check is so much cheaper, reliable and effective, and reduces the need to reimplement it every single time. Kind regards, Luca Boccassi