AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

make prefix=... Argument is Ignored #56

Closed martinvahi closed 5 years ago

martinvahi commented 5 years ago

The "make install" does not place the build result to the folder that was specified at the prefix argument at the first run of the make. The details are in the citation of the console output, but what I did was:

  1. Installed the official GNAT community edition binaries from 2018_05 and put its bin folder on PATH.
  2. cloned the gprbuild and the xmlada
  3. cd gprbuild # source folder
  4. The xmlada source folder resides now at ../xmlada
  5. executed according to the gprbuild README.md:

./bootstrap.sh --with-xmlada=../xmlada --prefix=./bootstrap

  1. and then did the rest that is described at the console output citation.
ts2@linux-f26r:~/m_local/bin_p/Ada/kompil/gprbuild$ make prefix=/home/ts2/m_local/bin_p/Ada/v2019_02_28/gprbuild 
gprbuild -p -m   -j0 -XBUILD=production  gprbuild.gpr -XLIBRARY_TYPE=static -XXMLADA_BUILD=static
Setup
   [mkdir]        object directory for project GPR
   [mkdir]        library directory for project GPR
   [mkdir]        object directory for project Gprbuild
   [mkdir]        exec directory for project Gprbuild
Compile
   [Ada]          gprconfig-main.adb
   [Ada]          gprbuild-main.adb
   [Ada]          gprclean-main.adb
   [Ada]          gprinstall-main.adb
   [Ada]          gprslave.adb
   [Ada]          gprname-main.adb
   [Ada]          gprls-main.adb
   [Ada]          gprbind.adb
   [Ada]          gprlib.adb
   [C]            gpr_imports.c
   [Ada]          gpr-script.adb
   [Ada]          gpr-nmsc.adb
   [Ada]          gpr-compilation-protocol.adb
   [Ada]          gpr-version.adb
   [Ada]          gpr-sdefault.ads
   [Ada]          gpr-cset.adb
   [Ada]          gpr_build_util.adb
   [Ada]          gpr-compilation-sync.adb
   [Ada]          gpr-attr.adb
   [Ada]          gpr-opt.ads
   [Ada]          gpr-compilation-slave.adb
   [Ada]          gpr-util.adb
   [Ada]          gpr-knowledge.adb
   [Ada]          gpr-dect.adb
   [Ada]          gpr-tempdir.adb
   [Ada]          gpr-strt.adb
   [Ada]          gpr-ali.adb
   [Ada]          gpr-compilation.adb
   [Ada]          gpr-ext.adb
   [Ada]          gpr-debug.adb
   [Ada]          gpr.adb
   [Ada]          gpr-proc.adb
   [Ada]          gpr-scans.adb
   [Ada]          gpr-sinput.adb
   [Ada]          gpr-snames.adb
   [Ada]          gpr-util-aux.adb
   [Ada]          gpr-compilation-process.adb
   [Ada]          gpr-erroutc.adb
   [Ada]          gpr-compilation-process-waiter.adb
   [Ada]          gpr-output.adb
   [Ada]          gpr-part.adb
   [Ada]          gpr-conf.adb
   [Ada]          gpr-com.ads
   [Ada]          gpr-err.adb
   [Ada]          gpr-names.adb
   [Ada]          gpr-env.adb
   [Ada]          gpr-attr-pm.adb
   [Ada]          gpr-pp.adb
   [Ada]          gpr-osint.adb
   [Ada]          gpr-tree.adb
   [Ada]          gprconfig.ads
   [Ada]          gprbuild.adb
   [Ada]          gprbuild-compile.adb
   [Ada]          gprbuild-link.adb
   [Ada]          gprbuild-post_compile.adb
   [Ada]          gprclean.adb
   [Ada]          gprinstall.adb
   [Ada]          gprinstall-db.adb
   [Ada]          gprinstall-install.adb
   [Ada]          gprinstall-uninstall.adb
   [Ada]          gprname.adb
   [Ada]          gprls.adb
   [Ada]          gprexch.adb
Build Libraries
   [gprlib]       gpr.lexch
   [archive]      libgpr.a
   [index]        libgpr.a
Bind
   [gprbind]      gprconfig-main.bexch
   [gprbind]      gprbuild-main.bexch
   [Ada]          gprconfig-main.ali
   [Ada]          gprbuild-main.ali
   [gprbind]      gprclean-main.bexch
   [Ada]          gprclean-main.ali
   [gprbind]      gprinstall-main.bexch
   [Ada]          gprinstall-main.ali
   [gprbind]      gprslave.bexch
   [Ada]          gprslave.ali
   [gprbind]      gprname-main.bexch
   [Ada]          gprname-main.ali
   [gprbind]      gprls-main.bexch
   [Ada]          gprls-main.ali
   [gprbind]      gprbind.bexch
   [Ada]          gprbind.ali
   [gprbind]      gprlib.bexch
   [Ada]          gprlib.ali
Link
   [link]         gprconfig-main.adb
   [link]         gprbuild-main.adb
   [link]         gprclean-main.adb
   [link]         gprinstall-main.adb
   [link]         gprslave.adb
   [link]         gprname-main.adb
   [link]         gprls-main.adb
   [link]         gprbind.adb
   [link]         gprlib.adb
ts2@linux-f26r:~/m_local/bin_p/Ada/kompil/gprbuild$ make install
exe/production/gprinstall -p -f --target=x86_64-pc-linux-gnu  --prefix=/home/ts2/m_local/bin_p/Ada/v2019_02_28/GNAT_Community/bin/.. -XBUILD=production --mode=usage --install-name=gprbuild \
    -XINSTALL_MODE=nointernal gprbuild.gpr
Install project Gprbuild
warning: file does not exist '/home/ts2_andmed/m_local/bin_p/Ada/kompil/gprbuild/doc/pdf/*.pdf'
warning: file does not exist '/home/ts2_andmed/m_local/bin_p/Ada/kompil/gprbuild/doc/info/*.info'
warning: file does not exist '/home/ts2_andmed/m_local/bin_p/Ada/kompil/gprbuild/doc/txt/*.txt'
exe/production/gprinstall -p -f --target=x86_64-pc-linux-gnu  --prefix=/home/ts2/m_local/bin_p/Ada/v2019_02_28/GNAT_Community/bin/.. -XBUILD=production --target=x86_64-pc-linux-gnu --mode=usage  --install-name=gprbuild \
    -XINSTALL_MODE=internal gprbuild.gpr
Install project Gprbuild
ts2@linux-f26r:~/m_local/bin_p/Ada/kompil/gprbuild$ sync
ts2@linux-f26r:~/m_local/bin_p/Ada/kompil/gprbuild$ cd ../../v2019_02_28/gprbuild/
ts2@linux-f26r:~/m_local/bin_p/Ada/v2019_02_28/gprbuild$ ls
ts2@linux-f26r:~/m_local/bin_p/Ada/v2019_02_28/gprbuild$ cd ..

The issue is that the built gprbuild was not placed to

/home/ts2/m_local/bin_p/Ada/v2019_02_28/gprbuild

despite the fact that this was the path at the make "prefix" argument.

steve-cs commented 5 years ago

I believe this is likely intended behavior within the AdaCore packages. If you specify the same prefix value on both the build and install invocations of make it should work.

(Edit) Alternatively use "make prefix=\<dir> setup" to save the values for both build and install.

martinvahi commented 5 years ago

Strange. Well, if that is the case, I haven't tested what You say yet, then how about the idea that they should swap the default behavior to the classical version, where "prefix" argument does not require any extra "switches" to work and the "intended behavior" might be marked with an extra switch, let's say, "install_2_AdaCore_distribution_folder".

Thank You for the answer, of course.

t-14 commented 5 years ago

prefix argument is only used to install. There is no point to specify it during the build as it has no effect whatsoever.

martinvahi commented 5 years ago

@t-14 How do You explain the following line at the gprbuild README.md ?

make prefix=xxx SOURCE_DIR=/path/to/gprbuild/sources setup

Thank You for the answer(s).

steve-cs commented 5 years ago

@martinvahi Sorry, I was mistaken in both on how I remembered the documentation and how I actually build things.

I should have said: If you specify the prefix value in either the configuration (i.e. make setup) or installation (e.g. make install) invocations of make then it should work.

The recommended place to specify the prefix value is during configuration with make setup as mentioned in both the README.md as well as the Makefile. As @t-14 said, the only place it does any useful work (other than passing in and out of the makefile.setup file) is during installs, e.g. setting and using INSTALLER variables.

Hopefully that's clearer. You can verify by reading the Makefile itself.

t-14 commented 5 years ago

How do You explain the following line at the gprbuild README.md ?

This line is talking precisely of a setup make target. This entirely optional target basically just stores the prefix value for later retrieval by install target.