Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Nov 2018 06:10:42 -0700
From:      Adam Weinberger <adamw@adamw.org>
To:        freebsd@omnilan.de
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Intention of the clean target vs clean-depends
Message-ID:  <CAP7rwchJgZDewqg0PS7BEoQ0JDSHte2kV2ROGYd1Z-pC%2B__1Mw@mail.gmail.com>
In-Reply-To: <61d03ae6-4e88-291e-d68f-bfa35ec33b01@omnilan.de>
References:  <1ec31adb-5916-45de-dd9f-ee6be5a97a44@omnilan.de> <61d03ae6-4e88-291e-d68f-bfa35ec33b01@omnilan.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 6, 2018 at 12:38 AM Harry Schmalzbauer <freebsd@omnilan.de> wro=
te:
>
> Am 05.11.2018 um 13:03 schrieb Harry Schmalzbauer:
> > Hello,
> >
> > I'm about to overhaul some scripts and continue wondering why 'make
> > clean' removes ${WRKDIR} of all dependencies, although there's the
> > clean-depends target.
> > The comment in bsd.ports.mk makes me think 'clean' shouldn't delete
> > dependencies:
> > # clean                 - Remove ${WRKDIR} and other temporary files
> > used for building.
> > # clean-depends - Do a "make clean" for all dependencies.
> >
> > Thanks fpr clarification,
>
> Hello,
>
> I'm really interested why it is how it is.
> I'd highly appreciate if someone can confirm that the current behaviour
> of the clean: target is the intended behaviour.
> If so, the clean-depends: can be retired, can it?
> I'm ignoring this =E2=80=93 to my understanding =E2=80=93 oddity for more=
 then a decade,
> without ever stumbling over any scenario where the behaviour would have
> been self clarifiying.
> For now I'm using the clean-wrkdir: target instead of clean:, but since
> nobody answered yet, I guess my question is unclear or I'm missing
> somthing ultimate obvious, so the question isn't unclear but stupid?!?
>
> Thanks,
>
> -harry

Hi Harry,

It is quite intentional. If a port is half-built, or if it's built
with a previous version, running "make install" on it can install the
wrong version or potentially error out (especially if any of its deps
have changed). It's imperative that all dependencies be in a clean
state before building a target. "make clean" provides a single
entry-point to put the tree in a clean state.

Back before packages actually worked and building from the tree was
the norm, getting people to run "make clean" before "make install" was
like pulling teeth. Separating clean: from clean-depends: would have
been disastrous. So no, it's not a mistake, and it works as intended.

I think the problem is the comment. The comment for clean-depends
should probably be removed, as it's not expected that end-users will
run it, and the comment for clean: could be "Remove ${WRKDIR} and
other temporary files used for building from this port and all its
dependencies." What do you think?

# Adam


--=20
Adam Weinberger
adamw@adamw.org
https://www.adamw.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAP7rwchJgZDewqg0PS7BEoQ0JDSHte2kV2ROGYd1Z-pC%2B__1Mw>