[build2] possible to do something similar to DESTDIR= make install?

Boris Kolpackov boris at codesynthesis.com
Sat Aug 19 09:02:27 UTC 2017


Norbert Lange <nolange79 at gmail.com> writes:
 
> Bootstrap works fine, but static build failed.
> Exhibit A: Running just in a subdirectory as I planned:
> 
> tmp/build2-toolchain/_bstr/p1/build2/b-boot build2/@_bstr/p2/
> config.cxx=g++ config.bin.lib=static
> error: out_base suffix does not match src_root
>   info: src_root: ./
>   info: out_base: _bstr/p2/
> 
> Exhibit B: Adding a subdirectory:
> /tmp/build2-toolchain/_bstr/p1/build2/b-boot build2/@_bstr/p2/build2/
> config.cxx=g++ config.bin.lib=static
> build2/buildfile:5:15: error: unable to determine src_root for imported libbutl
>   info: consider configuring _bstr/p2/libbutl/
> 
> Exhibit C: Building libbutl first (note that this would accept
> @_bstr/p2/ aswell)
> /tmp/build2-toolchain/_bstr/p1/build2/b-boot
> libbutl/@_bstr/p2/libbutl/ config.cxx=g++ config.bin.lib=static
> mkdir fsdir{_bstr/p2/libbutl/}
> ...<snip>...
> /tmp/build2-toolchain/_bstr/p1/build2/b-boot build2/@_bstr/p2/build2/
> config.cxx=g++ config.bin.lib=static
> build2/buildfile:5:15: error: unable to determine src_root for imported libbutl
>   info: consider configuring _bstr/p2/libbutl/

I am not completely certain what's going on here, but I suspect you are
trying to have the out directory inside src or some such. In build2 those
should not be subdirectories of each other (one way or another).

In the <src_root>/@<out_root>/ syntax the first is the source directory
while the second is the output directory (inside it will have structure
parallel to source).

Some typical examples would be:

$ ls
build2-X.Y.Z/

$ b-boot build2-X.Y.Z/@build2-build/ ...

$ b-boot build2-X.Y.Z/@build/build2/ ...

Let me also add that I realize this is all (unfortunately) undocumented
so it's all our fault ;-).


 
> Not sure how to proceed there. Git repo is updated with a README,
> should you want to know the steps I am doing, or want to try for
> yourself.

Yes, if the above does not help, I would like more detailed steps
to reproduce the problem.


> Now to something else, libbutl and build2. Are those expected to be
> developed together, having always the same version,
> or could eg. libbutl be stable and not receiving updates and
> version-numbers like build2?

Yes, it is safe to assume they will always be released in lock-step.
The only variation could be in bugfix releases (e.g., 0.7.1 vs 0.7.0).
Plus they can only be built together via a bootstrap process. So I
would suggest using approach #1 if possible.


> PS. those error messages, out_base suffix restrictions and pragmatic
> reliance on adding a slash at the end of paths
> is really confusing. sure you don`t want to add some explicit
> arguments (like --source <path>) for that, its easy to mess up,
> especially in scripts?

Yes, we plan to relax the need for trailing slash at some point (by
stat'ing the path and detecting that it is indeed a directory). Also,
the command line syntax is described a bit in b(1):

https://build2.org/build2/doc/b.xhtml

Thanks,
Boris



More information about the users mailing list