Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 440660

Summary: gnatbuild.eclass: /etc/ada/primary_compilers: No such file or directory
Product: Gentoo Linux Reporter: Martin von Gagern <Martin.vGagern>
Component: EclassesAssignee: ada team [OBSOLETE] <ada+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: creffett
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Martin von Gagern 2012-10-31 21:08:38 UTC
*
/var/tmp/portage/dev-lang/gnat-gcc-4.5.4/temp/environment: line 2608: /etc/ada/primary_compilers: No such file or directory
 * The list of primary compilers was empty and got assigned x86_64-pc-linux-gnu-gnat-gcc-4.5.
 * Please edit /etc/ada/primary_compilers and list there gnat profiles intended
 * for common use.

The file mentioned does not exist after the emerge, due to the fact that the directory containing it does not exist either.

So probably this should be fixed by the following modification to the gnatbuild_pkg_postinst function:

         . ${GnatCommon} || die "failed to source common code"
         if [[ ! -f ${PRIMELIST} ]] || [[ ! -s ${PRIMELIST} ]]; then
+                mkdir -p ${SETTINGSDIR}
                 echo "${gnat_profile}" > ${PRIMELIST}
Comment 1 Luke A. Guest 2014-10-14 15:05:11 UTC
I built dev-lang/gnat-gcc-4.6.4: the other day and it was looking for this file, it wasn't there.

[code]
>>> /usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.6/32/adalib/libgnat.so -> libgnat-4.6.so
 * The following gnat profile has been activated:
 * x86_64-pc-linux-gnu-gnat-gcc-4.6
 * 
 * The compiler has been installed as gnatgcc, and the coverage testing
 * tool as gnatgcov.
 * 
 * Ada handling in Gentoo allows you to have multiple gnat variants
 * installed in parallel and automatically manage Ada libs.
 * Please take a look at the Ada project page for some documentation:
 * http://www.gentoo.org/proj/en/prog_lang/ada/index.xml
 * 
/var/tmp/portage/dev-lang/gnat-gcc-4.6.4/temp/environment: line 2379: /etc/ada/primary_compilers: No such file or directory
 * The list of primary compilers was empty and got assigned x86_64-pc-linux-gnu-gnat-gcc-4.6.
 * Please edit /etc/ada/primary_compilers and list there gnat profiles intended
 * for common use.
>>> dev-lang/gnat-gcc-4.6.4 merged.
>>> Regenerating /etc/ld.so.cache...

>>> Recording dev-lang/gnat-gcc in "world" favorites file...

 * Messages for package dev-lang/gnat-gcc-4.6.4:

 * The following gnat profile has been activated:
 * x86_64-pc-linux-gnu-gnat-gcc-4.6
 * 
 * The compiler has been installed as gnatgcc, and the coverage testing
 * tool as gnatgcov.
 * 
 * Ada handling in Gentoo allows you to have multiple gnat variants
 * installed in parallel and automatically manage Ada libs.
 * Please take a look at the Ada project page for some documentation:
 * http://www.gentoo.org/proj/en/prog_lang/ada/index.xml
 * 
 * The list of primary compilers was empty and got assigned x86_64-pc-linux-gnu-gnat-gcc-4.6.
 * Please edit /etc/ada/primary_compilers and list there gnat profiles intended
 * for common use.
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * Regenerating GNU info directory index...
 * Processed 4 info files.

[/code]

I ended up doing: echo "x86_64-pc-linux-gnu-gnat-gcc-4.6" > /etc/ada/primary_compilers and I'm not sure if that's correct. 

Also, the compiler doesn't seem to be found, when typing any gnat* command at the shell. I had to log back in to activate it. Seems like it's not working properly and also seems like a nasty hack.
Comment 2 Steve Arnold archtester gentoo-dev 2014-10-15 16:10:42 UTC
This is an easy fix, however, George is the architect of the gnat eclass and bootstrap stuff (all I did was make some minor changes for ARM in preparation for the ARM bootstrap I'm still working on).  Off the top of my head, the only way to get Ada supported like the base languages (ie, building gcc with USE=ada) would be to have the stageballs built with Ada support (since you can't build the gnat piece without a working gnat, which is the whole purpose of the bootstrap package for each arch).  I thought George was working on a gnat upgrade, but I haven't heard anything recently (and I'm currently busier than a one-legged man at an a**-kicking contest...).  If you have some tangible ideas for the bootstrap and/or new eclass/ebuild stuff, then ping me and we'll test them.
Comment 3 George Shapovalov (RETIRED) gentoo-dev 2014-10-17 13:22:31 UTC
Stupid mistake. It is strange that I never triggered it - I guess I always had this directory created during "profiling" of the build system and then it was "just always there".. Anyway, the fix is in now (and the bug is fixed for real - BTW, that line was not in the eclass yet, why the bug was closed?).

On this:
(In reply to Luke A. Guest from comment #1)
> Also, the compiler doesn't seem to be found, when typing any gnat* command
> at the shell. I had to log back in to activate it. Seems like it's not
> working properly and also seems like a nasty hack.
Well, you do have to relogin or "source /etc/profile" after installing new (major) version of gnat. This has been the "standard behavior" even for the gcc (after you run gcc-config to activate new major version) for years and it directly tells you to do so in the post-build message as well..