From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qG9nJsCy6mFftgAAgWs5BA (envelope-from ) for ; Fri, 21 Jan 2022 14:18:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gFgSH8Cy6mEsKwAAG6o9tA (envelope-from ) for ; Fri, 21 Jan 2022 14:18:56 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 28C242C537 for ; Fri, 21 Jan 2022 14:18:56 +0100 (CET) Received: from localhost ([::1]:39184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAtoX-0007Vn-6M for larch@yhetil.org; Fri, 21 Jan 2022 08:18:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAtIN-0004Um-W8 for emacs-orgmode@gnu.org; Fri, 21 Jan 2022 07:45:37 -0500 Received: from [2a00:1450:4864:20::12d] (port=43004 helo=mail-lf1-x12d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAtHR-0004mv-M9 for emacs-orgmode@gnu.org; Fri, 21 Jan 2022 07:44:41 -0500 Received: by mail-lf1-x12d.google.com with SMTP id y15so25366291lfa.9 for ; Fri, 21 Jan 2022 04:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=lbrkFfh2ZYC0JFjgWX8oVX3RM3RVQmsIUpaVgccA6XI=; b=odTMXmb9Uv8MhK3p8nCQQgHJZiG+0ds7qRyaMXUtB564rCtNayJ7mqL1Yb0Vax8CFi iKg4Wbe/0vSZYyD8TSdrE0x8wn49b7HeQhxBOyjqPdeGhni1aUDtS7cLSD5UKpqBm9We F4c27FoxHckzKuZL/rfwzuPngWXTISsx9F60lf16vSZ3y/4FwFaYOD9/V+WgFvbvuEKP 56ByxSD89kXfxU//AUJEV35mOcXe8jqRJTvA+qxc3loE+cEc5XDRZqDSuWkmbPNMRhWA EnXx49tKij2qaq7Ig1M+zN6/yTR65M2yXY2y9+7i2wmbjHNpb91uS4RCunX+Be1Hmtve yKBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=lbrkFfh2ZYC0JFjgWX8oVX3RM3RVQmsIUpaVgccA6XI=; b=UX7ogjTxQxTlDBAgmYzvnvyyydwqMLoF1FyI39/eh6t6AttQVPseHcnyZ+VSR5AA2Y ekhK8aEm9byfqfssDK8yHZokusoNA9Gtcx/v7i+Wed1luOylEhHyOQw5TgQ3oRmBCTBq Ydai/9DHesWp6HVUhVNZ/Dc+n1em6aBTy34sTrk9HrMF9PracoxeWq1YQHed/K//RRnW 4UnpCpNjeof7iteYZ9Y/KrbJ8aqpEeNACCyfwGvupTAzBIX14c7FDPiNsqieGG5s8meq iLGv4tISjyAo7XoZNQ3ZHs5d4jlgqMcCMnN5F4/jv9a11poxljWBSEnb5msaCmbnhOcP zAGg== X-Gm-Message-State: AOAM530jSLyUOk7RBqh/BgY5kUEfby8UbCf54whbQboXcGxl+7p6zoof LLoernXVNlgE5lL7QIn27eQ= X-Google-Smtp-Source: ABdhPJw0FVPcmduyYYCUvf8n/A95QoAgtJNZ+4is/7Jo7n8vsoKbDQSK2HNGICFBAG+TojuD0TqREA== X-Received: by 2002:a2e:b5ac:: with SMTP id f12mr3048915ljn.158.1642769070913; Fri, 21 Jan 2022 04:44:30 -0800 (PST) Received: from localhost ([141.105.67.194]) by smtp.gmail.com with ESMTPSA id 23sm245468lfz.4.2022.01.21.04.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 04:44:30 -0800 (PST) From: Ihor Radchenko To: Max Nikulin Subject: Re: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file In-Reply-To: References: <5d7eba13-b717-a12a-5f89-7d2c9414917e@gmail.com> <87y23hr045.fsf@localhost> <1a42304e-47b6-48c3-01b4-6d858ddf7770@gmail.com> <87lezdnpcp.fsf@localhost> Date: Fri, 21 Jan 2022 20:48:58 +0800 Message-ID: <87mtjpz22t.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::12d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=yantar92@gmail.com; helo=mail-lf1-x12d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642771136; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=lbrkFfh2ZYC0JFjgWX8oVX3RM3RVQmsIUpaVgccA6XI=; b=tf8bEKIaS+SdXC1UfCOmlUQUOUzR95BoIay7An6Y6wgQZE+ixd1cLZinmaD1zudVeuRQ3S J3k5b56g7F7PPlXNt+1A+GKOaM8CqxyzaWQyC3XDoqsfx4vt88CkJwuyBpWZkhiGt4mzfU gtdf6oAlJJi0TcJ+gBLKpFjj/KIdLGcMxdKfpKGmNVS/RXxi+TDeVO45fp8WawUh/XCNFG XqNrM+vF/IXQbTqDT+zfObV4T4Gq8UP+DkMSEjU8EJ1L+4gnymuiQYxhcqMwJtj3VI2kkp 0VTHEc9Dr97n+SchVJwlcpFcxmubZiTUw7eWfcEF+MIkQAkBVeWuUwWt8khO0Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642771136; a=rsa-sha256; cv=none; b=pODg6rsoCnaxnrG0e3VBesWt71pLHQaGmCucmCtW4onTQao0AVwrGLCDNZk3K13Aa9uvPI hg/4UKrNem40ezvTJu7z8hA3LM/YcinGZdz5J9Kzva+FrCjqbx1wnblGsDoXoL/M+f43EU GsobW3JtN+GNB9nt/l7CxCHZWFrpJNO+crjQmGaYtei2vsgjptNwlBoa48uqUA+jR8bqqD Tiajj8/U8srhedv+tjG6bcI3phI25DAUBYVVkhVGKirbBY4lKID/O00cSi+oBhB0Rpufcv FVYadcVDU5HCbvo4JgtGgXQBKU+rtlSHS5dcDpCcNl4/D5sqcQC1zmfLBbuEMQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=odTMXmb9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.82 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=odTMXmb9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 28C242C537 X-Spam-Score: -3.82 X-Migadu-Scanner: scn1.migadu.com X-TUID: ya0w0R+JXi81 Max Nikulin writes: >> #!/bin/bash >> gjl_package=plantuml >> gjl_jar="plantuml.jar" >> source /usr/share/java-config-2/launcher/launcher.bash > > It seems with with the suggested patch both -Djava.awt.headless=true and > -headless are passed to jar. I suspect it is either redundant or > launcher.bash converts "-headless" to "-Djava.awt.headless=true". In > ubuntu there is no room for special treatment of "-headless" option by > the shell wrapper: It is redundant, but should not cause any harm. plantuml source code has: if (argsArray.length > 0 && argsArray[0].equalsIgnoreCase("-headless")) { System.setProperty("java.awt.headless", "true"); } I can of course add a condition to not add -headless if we are running jar, but I do not see much benefit except purity argument. >> I feel that running headless mode in the ob-plantuml is deliberate. > > https://plantuml.com/faq > "Basically, this is because PlantUML needs to have access to some > graphical resources" > > I have no idea what is actually affected. It mostly looks like otherwise there are some harmless warnings in the output. > Which peace of code (java or plantuml.jar) handles "-headless" option? > This question affects decision if jar and executable wrapper modes may > share same list of arguments. Plantuml site recommends namely > -Djava.awt.headless=true. Anyway with or without the patch, > "-Djava.awt.headless=true" is added unconditionally in the jar mode. I > would revert that patch and either add it to java header argument or to > a new defcustom. I do not see much point customising this particular argument. We _do not_ want plantuml in gui mode. Ever. Otherwise, babel behaviour will be unpredictable. If we make it customizeable, the only "benefit" would be allowing users to shoot their own leg. > Are there cases when :cmdline header argument is not enough and extra > custom variable org-plantuml-args (org-plantump-executable-args) should > be used? > Actually I have realized that I do not understand why babel code uses > mix of defcustom and header arguments. The latter are more flexible and > may be adjusted per source block. On the other hand they may be set in > init file. Even java executable and path to jar file may be obtained > from header arguments. Good questions. I think that the main reason is that most of header args are not merged - only the last value is used. If you define :cmdline in source block, it will override system-wide settings. Having an additional defcustom allows to provide a "permanent" set of parameters - to be used no matter what. I realise that the current situation is kind of awkward. Maybe we should encourage ob-* libraries to use special header args instead of defcustoms and modify built-in libraries in this spirit. Would you be interested to write a feature request? Best, Ihor