Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Dec 2017 17:58:38 +0000
From:      Shivansh Rai <shivansh@freebsd.org>
To:        Alan Somers <asomers@freebsd.org>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Different behavior when running `make`
Message-ID:  <CAF%2Bp1HuBt5O49Wphs1jMjkmZWCUXHa4AKLMivKEpe1FH2GjtEw@mail.gmail.com>
In-Reply-To: <CAOtMX2jSbhvqf6uwb6as88VsZpLagC3nXpvUDTYvZJO3g%2BHgyA@mail.gmail.com>
References:  <CAF%2Bp1Htw%2Baf4dfy8oFgXUPx1v7s1y84-Hv7rz4P9Yh%2BwOToNyQ@mail.gmail.com> <CAOtMX2jSbhvqf6uwb6as88VsZpLagC3nXpvUDTYvZJO3g%2BHgyA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Awesome, thanks a lot!
I've made the relevant updates and removed dependence on pwd:
https://github.com/shivansh/smoketestsuite/compare/f3f68db...b9902cf
Will update D12249 too.
-- Shivansh

On Fri, Dec 8, 2017 at 9:58 PM Alan Somers <asomers@freebsd.org> wrote:

> On Fri, Dec 8, 2017 at 8:01 AM, Shivansh Rai <shivansh@freebsd.org> wrote:
>
>> Hello all,
>>
>> I'm currently working on a tool for automating generation of smoketests
>> for
>> all the utilities in the base system [1]. Until now I was testing things
>> on
>> a very old branch from around August (git sha 92d8705), and after updating
>> my branch (git sha 7ea30ed) I'm starting to notice a different behavior.
>>
>> The tool is located at `~/freebsd/tools/tools/smoketestsuite` [2] in my
>> system.
>> Executing `make` inside [2] produces the following output -
>> ```
>> [Creating objdir
>>
>> /usr/obj/usr/home/zeebsd/freebsd/amd64.amd64/tools/tools/smoketestsuite...]
>> c++ -I/usr/local/include -std=c++11 -c logging.cpp
>> c++: error: no such file or directory: 'logging.cpp'
>> c++: error: no input files
>> *** Error code 1
>> ```
>>
>> The interesting thing to be noted is the first line of the above trace
>> where a new directory under `/usr/obj` is created (I've noticed this for
>> the first time, after I updated my branch).
>>
>> The location
>> `/usr/obj/usr/home/zeebsd/freebsd/amd64.amd64/tools/tools/smoketestsuite`
>> [3] is empty, and it seems that `make` tries to look up `logging.cpp` (and
>> all other files) in [3] instead of [2]. This is evident from the fact that
>> if I manually populate [3] will all the relevant files, everything works
>> fine.
>> Also, all the side-effects which `make` introduces (new files, new
>> binaries
>> etc.) are populated at [3] instead of [2].
>>
>> If the tool is kept at a location outside the src tree (not under
>> `~/freebsd`), everything works fine (and the temporary directory under
>> `/usr/obj` is not created for those locations when `make` is executed). So
>> the problem seems to be in the way `make` is running inside the src tree.
>>
>> I've attached the system call trace for the failing execution.
>> It'd be extremely helpful if someone could please shed light on what seems
>> to be the problem here, and what should be the right workflow.
>>
>> [1]: For some more reference, the tool is currently available at `
>> https://github.com/shivansh/smoketestsuite/' (svn branch) (D12249).
>> [2]: `~/freebsd/tools/tools/smoketestsuite`
>> [3]:
>> `/usr/obj/usr/home/zeebsd/freebsd/amd64.amd64/tools/tools/smoketestsuite`
>>
>> Thanks in advance!
>> With best regards,
>> Shivansh Rai
>>
>
> make is failing because it's implicitly cd'ing to
> ${MAKEOBJDIRPREFIX}/${.CURDIR} before running any commands.  I don't know
> if that's at all contingent on the build being started from within a
> FreeBSD source tree, but the easiest solution is to work with the build
> system rather than against it.  I've attached a working version.  The
> scripts don't all work, however.  They still contain assumptions about pwd,
> for example at scripts/fetch_utils.sh:32.
>
> -Alan
>



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