Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Mar 2024 23:10:41 +0100
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        Moin Rahman <bofh@freebsd.org>
Cc:        "freebsd-ports@FreeBSD.org" <freebsd-ports@freebsd.org>
Subject:   Re: how to see order of make targets steps in ports tree?
Message-ID:  <43ace529-cb8b-4ea1-b07c-b5af50342781@quip.cz>
In-Reply-To: <D0E257C5-08A1-45BF-95A4-1367864D96BD@freebsd.org>
References:  <610f900f-658f-474d-885a-abbe709a00f7@quip.cz> <49B3BF7D-E6B0-409B-B37B-F8F5660E099D@freebsd.org> <8f0601e3-c57f-4d67-8047-1c92088e886d@quip.cz> <B68E3C0A-8FC7-414B-8874-4F11F87415D2@freebsd.org> <530b7a49-470c-4437-ba95-ec68bc5ad1a4@quip.cz> <D0E257C5-08A1-45BF-95A4-1367864D96BD@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14/03/2024 22:20, Moin Rahman wrote:
> 
> 
>> On Mar 14, 2024, at 10:08 PM, Miroslav Lachman <000.fbsd@quip.cz> wrote:
>>
>> On 14/03/2024 20:59, Moin Rahman wrote:
>>>> On Mar 14, 2024, at 8:57 PM, Miroslav Lachman <000.fbsd@quip.cz> wrote:
>>>> On 14/03/2024 20:35, Moin Rahman wrote:
>>>>>> On Mar 14, 2024, at 7:55 PM, Miroslav Lachman <000.fbsd@quip.cz> wrote:
>>>>>>
>>>>>> Is there a way to see the order of the executed steps by "make"?
>>>>>>
>>>>>> tl;dr: I know "make" will run many targets like fetch, checksum, extract, patch... but I would like to see some verbose info about these steps, mainly what is the order of the steps when I run "make".
>>>>>> I tried to create some patch to one the port and it seems like "shebangfix" is run before "patch" but I don't know how to see what is true order of the targets.
>>>>>>
>>>>> ❯ rg --no-filename '^_USES_patch' Mk | sort
>>>>> _USES_patch+= 190:pathfix
>>>>> _USES_patch+= 200:dos2unix
>>>>> _USES_patch+= 210:fix-shebang
>>>>> _USES_patch+= 290:gnome-pre-patch
>>>>> _USES_patch+= 600:charsetfix-post-patch
>>>>> _USES_patch+= 650:post-patch-erlang
>>>>> _USES_patch= 701:cabal-post-patch
>>>>
>>>> Good to know this grep! Thanks.
>>>> But where is the step using patches from port's "files" directory?
>>>>
>>>> Kind regards
>>>> Miroslav Lachman
>>> rg do-patch Mk
>>
>> Is this the right order and is this a complete list of targets?
>> It seems to me that some things are in the wrong order.
>>
>> # grep -h -rE '[0-9]{3}:' /usr/ports/Mk/ | sed -E 's/.*=[[:space:]]//;s/^[[:space:]]+//;s/ ([0-9]{3}:)/\n\1/g;s/ \\$//' | grep -E '^[0-9]{3}:' | sort
>> 010:check-build-conflicts
>> 050:ask-license
>> 050:extract-message
>> 050:post-chroot
>> 050:stage-message
>> 100:build-message
>> 100:checksum
>> 100:install-message
>> 100:package-message
>> 100:patch-message
>> 100:pre-everything
>> 100:stage-dir
>> 100:test-message
>> 125:show-unsupported-system-error
>> 150:build-depends
..
..
>> 940:add-plist-post ${POST_PLIST:C/^/990:/}
>> 950:move-uniquefiles-plist
>> 995:electronfix-stage-qa
>> 995:stage-qa
>> 999:extract-fixup-modes
>>
>> Kind regards
>> Miroslav Lachman
> 
> You are looking at it on a wrong perspective I think.
> The numbers matter only within a single target.
> 
> So if you consider my earlier examples you will see that we have 701 in patch target.
> 
> Bu definitely patch target takes place lot earlier in the targets then the others in this list.

I am still trying to have a complete picture of how all the steps are 
executed.
Is it really not possible to show it by some flag to "make"?

If I need to see the order of rc script execution, I can run:

  # rcorder /etc/rc.d/* /usr/local/etc/rc.d/*

If I need to see what is done inside of starting one specific rc script, 
I can run:

  # sh -x /usr/local/etc/rc.d/apache24 start

But I still cannot find a way to see the order of steps to build a 
package (beside reading of all files in Mk which I do not understand much)

When I get these info, how can I know if fix-shebang is executed before 
or after the do-patch?

# grep -rh '^_USES_patch' Mk | sort
_USES_patch+=   190:pathfix
_USES_patch+=   200:dos2unix
_USES_patch+=   210:fix-shebang
_USES_patch+=   290:gnome-pre-patch
_USES_patch+=   600:charsetfix-post-patch
_USES_patch+=   650:post-patch-erlang
_USES_patch=    701:cabal-post-patch

# grep -r :do-patch Mk/
Mk/bsd.port.mk:      300:pre-patch 450:pre-patch-script 500:do-patch \

It would be really helpful to see what and when is executed on specific 
port when I run the "make" command.

Kind regards
Miroslav Lachman




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43ace529-cb8b-4ea1-b07c-b5af50342781>