From nobody Thu May 05 08:41:15 2022 X-Original-To: freebsd-erlang@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BBB741ACD195 for ; Thu, 5 May 2022 08:41:25 +0000 (UTC) (envelope-from pat@patmaddox.com) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kv6cN24Fdz3kNg for ; Thu, 5 May 2022 08:41:24 +0000 (UTC) (envelope-from pat@patmaddox.com) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1A2D45C012E; Thu, 5 May 2022 04:41:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 05 May 2022 04:41:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=patmaddox.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1651740078; x= 1651826478; bh=d8fwCPEpTrLkmOHCOkcsmD8ajQ4b0Za9KOJaL7GJe2o=; b=M L8T65eBdRwAVG+LhF2mWp13D0SQVa7ibYVvxM6C2vjVCOXncSMuEVvDWKELBACvN 6L6UucmiGvNFfo/R8GCyw6uSLud4ALhNYODQYDgkSeAi3lmDnerxH3Cq24lJ3O5D c/jipNfSFqqWzAtYxuFnUBVy5qRC5SZoLu1mfbWJB11S+bfdx5D2PP1tD1WpI2kf C+8R2q2RE0LZNvnpeoRuwvDJl5Dtk8GXqbaJ8oSrHf9Y+4Zk//lPv/Xg9kTH03mx NcQZw1slWd5/KqDyX/0dgVEW2+kdfHKj5iWdbrkHhtT1pZg3CYj7xaI+5fjy2/Cr 7AWKNeXklvzRzyIzL22Jg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1651740078; x=1651826478; bh=d8fwCPEpTrLkm OHCOkcsmD8ajQ4b0Za9KOJaL7GJe2o=; b=qWaJbhcS8TylNikuHdksEVYbcntgj 2gQzsuCCNSPFvMTdtgcYYFtgGETAD4YJnUs7nST4Sbc9vV8k4lS0lffBjhfkyPyL jlAkBwm6gmQDiWIQrJUWWfUB+qNBTpWn4e40MfRWeKCcYXpvcGxBur0zOd+jmPOR 4+XHLwucDzUDVSiGceYZHYYWJgfSm9Sz7DKdIILSGHIDnh9ylNysfbLrDpm+vCZN QwsDdI54UVzL5gN3AsWuWE0bIuJCzImTqFisccurdhvSVD25NI1Q3ifN2N2teqkz fda951FkqurZAkO63FgZ4ULm4aCTVNj7vylRxCYl6wVUnXoqkXx4S9btQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffokfgjfhggtgfgsehtqh hmtdertdejnecuhfhrohhmpedfrfgrthcuofgrugguohigfdcuoehprghtsehprghtmhgr ugguohigrdgtohhmqeenucggtffrrghtthgvrhhnpeeufeeijeetfeetfefggefhfffghf dvhffggefgjeefieeukeevfeffudejjeeitdenucffohhmrghinhepghhithhhuhgsrdgt ohhmpdhfrhgvvggsshgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepphgrthesphgrthhmrgguughogidrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 May 2022 04:41:17 -0400 (EDT) From: "Pat Maddox" To: "Dave Cottlehuber" Cc: erlang Subject: Re: package mix release works, port doesn't? (and neither is self-contained) Date: Thu, 05 May 2022 01:41:15 -0700 X-Mailer: MailMate (1.13.2r5673) Message-ID: <7814C787-2101-45DC-971D-2571E29EF4F6@patmaddox.com> In-Reply-To: <9B6718AD-FC61-4DBC-8DF1-9FF0E207B945@patmaddox.com> References: <42EA9771-2440-49D3-BEFA-05A888F8D90A@patmaddox.com> <9B6718AD-FC61-4DBC-8DF1-9FF0E207B945@patmaddox.com> List-Id: Support of Erlang-related ports List-Archive: https://lists.freebsd.org/archives/freebsd-erlang List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-erlang@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Kv6cN24Fdz3kNg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=patmaddox.com header.s=fm3 header.b="M L8T65e"; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=qWaJbhcS; dmarc=none; spf=pass (mx1.freebsd.org: domain of pat@patmaddox.com designates 66.111.4.27 as permitted sender) smtp.mailfrom=pat@patmaddox.com X-Spamd-Result: default: False [-4.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[patmaddox.com:s=fm3,messagingengine.com:s=fm1]; FREEFALL_USER(0.00)[pat]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.27]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[patmaddox.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[patmaddox.com:+,messagingengine.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-erlang]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.27:from] X-ThisMailContainsUnwantedMimeParts: N On 4 May 2022, at 23:48, Pat Maddox wrote: > On 4 May 2022, at 7:16, Dave Cottlehuber wrote: > >> On Wed, 4 May 2022, at 11:16, Pat Maddox wrote: > >>> I still don=E2=80=99t understand why I need an erlang runtime at all = >>> though, >>> after the mix release has been built. >>> >>> Pat >> >> you don't; whether erts is bundled in the release is defined in your >> mix release config. I'm assuming your ExAmple app picks up whatever >> the default is, see the hello app for an appropriate example. I have found the culprit. mix release sets an ERTS_BIN env var in the startup script: = https://github.com/elixir-lang/elixir/blob/main/lib/mix/lib/mix/tasks/rel= ease.ex#L1428 However, the port replaces it: = https://cgit.freebsd.org/ports/tree/lang/elixir-devel/Makefile#n48 So where mix release produces the following lines in = ex_ample/releases/0.1.0/elixir: ERTS_BIN=3D ERTS_BIN=3D"$SCRIPT_PATH"/../../erts-12.3./bin/ The port changes them to: ERTS_BIN=3D/usr/local/lib/erlang24/bin/ ERTS_BIN=3D/usr/local/lib/erlang24/bin/ Removing the post-patch target solves the problem: I can run `ex_ample = start_iex` with no erlang or elixir installed. It uses the erts bundled = in /usr/local/libexec/ex_ample/erts-12.3.1/. Removing post-patch however breaks the current lang/elixir-devel build, = because now erl is not in the path. We have two scenarios: 1. lang/erlang-runtime24 is installed (and not lang/erlang) - this needs = the post-patch 2. lang/erlang is installed - this does not need the post-patch, and in = fact the post-patch breaks the bundled erts in mix releases. How should we go about solving this? One simple idea is to call `which = erl` to see if it exists, and if so then we can skip the post-patch. Another idea is to add a PROVIDES_ERL variable, and make = lang/erlang-runtime24 add erl to /usr/local/bin, and conflict with = lang/erlang. If you want full erlang on your system, you could set = PROVIDES_ERLANG=3Dlang/erlang. Perhaps it=E2=80=99s even simpler. Instead of: BUILD_DEPENDS=3D erlang-runtime${ERLANG_VER}>0:lang/erlang-runtime${ERLAN= G_VER} RUN_DEPENDS=3D erlang-runtime${ERLANG_VER}>0:lang/erlang-runtime${ERLANG_= VER} It could be: DEPENDS=3D erl:lang/erlang-runtime${ERLANG_VER} and again lang/erlang-runtime24 would install /usr/local/bin/erl. I am quite new to FreeBSD ports and makefiles in general though, so am = interested in a good approach to this. Pat