Bug 132407

Summary: [patch] pass TMPDIR around
Product: Ports & Packages Reporter: Eygene Ryabinkin <rea-fbsd>
Component: Individual Port(s)Assignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
pass-TMPDIR.diff
none
bsd.port.mk-pass-TMPDIR.diff none

Description Eygene Ryabinkin 2009-03-08 12:40:02 UTC
Currently multimedia/ffmpeg's configure script wants contents of /tmp
(or $TMPDIR) to be allowed to be executable, so /tmp + noexec breaks
the port.  Manual correction of this is well-known: 'TMPDIR=/var/tmp
make install clean' works perfectly.  But for automated upgrades, for
example, via 'portupgrade -a' it is better if we will be able to pass
TMPDIR from make.conf.  But this isn't possible with the current port
Makefile contents, they should be modified to include TMPDIR to the
build tools environment.

Fix: The following patch teaches Makefile to include TMPDIR to the build
tools environment.  I had tested it on my installation and it works
perfectly for me.
How-To-Repeat: 
Mount /tmp with option 'noexec' and try to build the port.  It will
fail on the configure stage.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-03-08 12:40:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-multimedia

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Eygene Ryabinkin 2009-04-24 05:00:57 UTC
Gentlemen, good day.

Could you, please, glance at this PR and tell if the patch can be
committed.  It is useful for people with non-executable /tmp and
should not harm anything else.

Thanks!
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #
Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2009-04-24 08:08:47 UTC
> Could you, please, glance at this PR and tell if the patch can be
> committed.  It is useful for people with non-executable /tmp and
> should not harm anything else.

This is not a good patch. All ./configure using ports have the same
issue. I don't see why we should address this is ffmpeg port.
Either you fix this generally in bsd.port.mk (and I see bsd.kde.mk
already have the proposed fix), or you should put
CONFIGURE_ENV="TMPDIR=/var/tmp" to your /etc/make.conf instead.

-- 
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

> With a 10 MHz 386 the downloading speed would most likely drop
> to a crawl or stop with the decoding process etc.
I think most 10MHz 386 users are quite accustomed to things dropping
to a crawl.
Comment 4 Eygene Ryabinkin 2009-04-24 16:23:24 UTC
Pav, good day.

Fri, Apr 24, 2009 at 09:08:47AM +0200, Pav Lucistnik wrote:
> This is not a good patch. All ./configure using ports have the same
> issue. I don't see why we should address this is ffmpeg port.
> Either you fix this generally in bsd.port.mk (and I see bsd.kde.mk
> already have the proposed fix), or you should put
> CONFIGURE_ENV=3D"TMPDIR=3D/var/tmp" to your /etc/make.conf instead.

I think that I'll better fix bsd.port.mk: the new patch is below.
bsd.kde.mk passed TMPDIR down only for package building, but I think
that my modification should pass it always.

Thanks for suggestions!

--- bsd.port.mk-pass-TMPDIR.diff begins here ---
=46rom d12eb79d31daea3ea9e16bd932b9de333a0cf63f Mon Sep 17 00:00:00 2001
=46rom: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Date: Fri, 24 Apr 2009 19:17:35 +0400
Subject: [PATCH] bsd.port.mk: pass TMPDIR from /etc/make.conf down to the t=
ools

Sometimes ports want to put executables to the $TMPDIR (/tmp by-default)
during configure/build stages.  Such ports will be broken when /tmp is
mounted with 'noexec' flag.  This patch addresses this problem and
allows automated port builds (e.g. via portupgrade) with TMPDIR set from
/etc/make.conf.

Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
---
 Mk/bsd.port.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 324ed4a..647ac62 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1292,6 +1292,13 @@ WITHOUT_${W}:=3D	true
=20
 DOS2UNIX_REGEX?=3D	.*
=20
+# Respect TMPDIR passed via make.conf or similar and pass it down
+# to configure and make.
+.ifdef TMPDIR
+MAKE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
+CONFIGURE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
+.endif # TMPDIR
+
=20
 # Start of pre-makefile section.
 .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
--=20
1.6.2.4
--- bsd.port.mk-pass-TMPDIR.diff ends here ---
--=20
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #
Comment 5 Eygene Ryabinkin 2009-05-04 07:38:30 UTC
Pav, everyone, good day.

Fri, Apr 24, 2009 at 07:23:24PM +0400, Eygene Ryabinkin wrote:
> Fri, Apr 24, 2009 at 09:08:47AM +0200, Pav Lucistnik wrote:
> > This is not a good patch. All ./configure using ports have the same
> > issue. I don't see why we should address this is ffmpeg port.
> > Either you fix this generally in bsd.port.mk (and I see bsd.kde.mk
> > already have the proposed fix), or you should put
> > CONFIGURE_ENV="TMPDIR=/var/tmp" to your /etc/make.conf instead.
> 
> I think that I'll better fix bsd.port.mk: the new patch is below.
> bsd.kde.mk passed TMPDIR down only for package building, but I think
> that my modification should pass it always.

Any thoughts about the patch for bsd.port.mk provided in the previous
mail?  I had put the patch to
  http://codelabs.ru/fbsd/patches/Mk/bsd.port.mk-pass-TMPDIR.diff
if someone has troubles to extract it from the PR.

Thanks!
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #
Comment 6 Pav Lucistnik freebsd_committer freebsd_triage 2009-05-04 08:36:26 UTC
> Any thoughts about the patch for bsd.port.mk provided in the previous
> mail?  I had put the patch to
>   http://codelabs.ru/fbsd/patches/Mk/bsd.port.mk-pass-TMPDIR.diff
> if someone has troubles to extract it from the PR.


You also need to delete corresponding section of bsd.kde.mk, otherwise
it ends up being defined twice.

-- 
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

Orfax's hip flask contained Old Janx Spirit, a mixture of potions of
stupidity, paralysis, naivery, ruination, lose memories, confusion,
and slime mold juice, with a twist of lemon.
    - from a post on Angband Community Forum
Comment 7 Pav Lucistnik freebsd_committer freebsd_triage 2009-05-04 08:36:52 UTC
Responsible Changed
From-To: freebsd-multimedia->portmgr

it's now infrastructure PR
Comment 8 Eygene Ryabinkin 2009-05-04 13:46:48 UTC
Pav, good day.

Mon, May 04, 2009 at 09:36:26AM +0200, Pav Lucistnik wrote:
> > Any thoughts about the patch for bsd.port.mk provided in the previous
> > mail?  I had put the patch to
> >   http://codelabs.ru/fbsd/patches/Mk/bsd.port.mk-pass-TMPDIR.diff
> > if someone has troubles to extract it from the PR.
> 
> You also need to delete corresponding section of bsd.kde.mk, otherwise
> it ends up being defined twice.

Done, please see the attached patch or the patch at the above URL.
Ffmpeg still builds fine, a couple of other ports are fine too.

Thanks!
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #
Comment 9 Erwin Lansing freebsd_committer freebsd_triage 2009-05-18 16:11:55 UTC
State Changed
From-To: open->analyzed

Prepare for an experimental cluster run.
Comment 10 Eygene Ryabinkin 2009-06-05 07:43:15 UTC
Gentlemen, good day.

> From-To:	open->analyzed
> By:		erwin
> When:		Mon May 18 15:11:55 UTC 2009
> Why:		Prepare for an experimental cluster run.

Were there any outcome from the experimental run or it just hadn't
yet started/finished?

Thanks!
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #
Comment 11 Erwin Lansing freebsd_committer freebsd_triage 2009-06-11 10:09:36 UTC
State Changed
From-To: analyzed->closed

Committed, thanks!
Comment 12 dfilter service freebsd_committer freebsd_triage 2009-06-11 10:09:42 UTC
erwin       2009-06-11 09:09:29 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.kde.mk bsd.port.mk 
  Log:
  Pass TMPDIR on to configure and make environments.
  
  PR:             132407
  Submitted by:   Eygene Ryabinkin <rea-fbsd@codelabs.ru>
  
  Revision  Changes    Path
  1.81      +1 -6      ports/Mk/bsd.kde.mk
  1.623     +14 -1     ports/Mk/bsd.port.mk
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"