stcarrez / ada-awa

Ada Web Application - Framework to build high performance secure web applications
Apache License 2.0
93 stars 11 forks source link

Error with fresh install: wrong use of interface type in tagged conversion #39

Open Heziode opened 1 year ago

Heziode commented 1 year ago

Hi Stephane,

I trying to install AWA using Alire gut I got a compilation error.

Step to reproduce:

alr init --bin demo_awa
cd demo_awa
alr with awa
alr build

The trace of alr build is:

alr build
warn: Generating possibly incomplete environment because of missing dependencies
ⓘ gnat>=9: no build needed.
ⓘ Building demo_awa/demo_awa.gpr...
Compile
   [Ada]          el-expressions-nodes.adb
   [Ada]          util-properties-basic.adb
   [Ada]          util-properties-discrete.adb
   [Ada]          util-properties.adb
   [Ada]          util-properties-bundles.adb
   [Ada]          util-log-locations.adb
   [Ada]          util-log-appenders-rolling_files.adb
   [Ada]          util-log-appenders-files.adb
el-expressions-nodes.adb:517:61: error: wrong use of interface type in tagged conversion
el-expressions-nodes.adb:517:61: error: add 'Class to the target interface type

   compilation of el-expressions-nodes.adb failed

gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/workspaces/PhD_XP/alr_test/demo_awa/demo_awa.gpr"] exited with code 4
error: Compilation failed.

Am I the only one with this problem?

My setup: I running the full GNAT environment into a Docker container (with VS Code docker dev tools). I using a GNAT Pro 24.0

stcarrez commented 1 year ago

Yes, the new version of gcc (at least 13.x) introduced more checks and now refuses to compile a tyoe conversion that was accepted and considered legal before.

It is fixed by the following commit: https://github.com/stcarrez/ada-el/commit/13d22ea6ea566da05ba6e0f8b9f6382b1e97f8f3

Heziode commented 1 year ago

Hum, is there a way to tell alr which commits it should use for a dependency?

Or should I attempt to build from source (cloning the project)?

stcarrez commented 1 year ago

I don't know how to do that for alr.

It's best if you build from sources. I would recommend trying:

git clone --recursive https://github.com/stcarrez/ada-awa.git
cd ada-awa
./configure --prefix=/usr/local
make
make install
Heziode commented 1 year ago

By cloning the repository, and doing your instruction, I got the following error with make (compilation):

for i in ada-lzma ada-util ada-el ada-security ada-wiki ada-servlet openapi-ada ada-asf ada-keystore ada-ado dynamo awa; do \
   make -C "$i" build ; \
done
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-lzma'
gprbuild -m -q -p -Plzmada.gpr -XBUILD=distrib -XPROCESSORS=8 -XLZMA_LIBRARY_TYPE=static
gprbuild -m -q -p -Psamples.gpr -XBUILD=distrib -XPROCESSORS=8
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-lzma'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-util'
mkdir -p obj/utilada_lzma/static
mkdir -p obj/utilada_unit/static
mkdir -p obj/utilada_http/static
gprbuild -m -q -p -Putilada_core.gpr -XHARDWARE_PLATFORM=x86_64 -XBUILD=distrib -XPROCESSORS=8 -XUTIL_LIBRARY_TYPE=static
gprbuild -m -q -p -Putilada_base.gpr -XHARDWARE_PLATFORM=x86_64 -XBUILD=distrib -XPROCESSORS=8 -XUTIL_LIBRARY_TYPE=static
gprbuild -m -q -p -Putilada_sys.gpr -XHARDWARE_PLATFORM=x86_64 -XBUILD=distrib -XPROCESSORS=8 -XUTIL_LIBRARY_TYPE=static
gprbuild -m -q -p -Putilada_xml.gpr -XHARDWARE_PLATFORM=x86_64 -XBUILD=distrib -XPROCESSORS=8 -XUTIL_LIBRARY_TYPE=static
gprbuild -m -q -p -Putilada_curl.gpr -XHARDWARE_PLATFORM=x86_64 -XBUILD=distrib -XPROCESSORS=8 -XUTIL_LIBRARY_TYPE=static
gprbuild -m -q -p -Putilada_aws.gpr -XHARDWARE_PLATFORM=x86_64 -XBUILD=distrib -XPROCESSORS=8 -XUTIL_LIBRARY_TYPE=static
gprbuild -m -q -p -Putilada_lzma.gpr -XHARDWARE_PLATFORM=x86_64 -XBUILD=distrib -XPROCESSORS=8 -XUTIL_LIBRARY_TYPE=static
utilada_lzma.gpr:3:06: imported project file "lzmada" not found
gprbuild: "utilada_lzma.gpr" processing failed
Makefile:50: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-util'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-el'
gprbuild -m -q -p -Pelada.gpr -XBUILD=distrib -XPROCESSORS=8 -XEL_LIBRARY_TYPE=static
elada.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
elada.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_base" not found
elada.gpr:7:19: unknown project "config"
elada.gpr:7:26: unknown string type "library_type_type"
elada.gpr:8:11: unknown project "config"
elada.gpr:8:18: unknown string type "build_type"
elada.gpr:8:32: unknown package or project "Config"
elada.gpr:12:25: unknown variable "Library_Type"
elada.gpr:18:29: "Config" is not an imported or extended project
elada.gpr:19:29: "Config" is not an imported or extended project
elada.gpr:20:29: "Config" is not an imported or extended project
elada.gpr:23:41: unknown projects "Config.Binder" or "Config"
elada.gpr:23:55: unknown attribute "default_switches"
gprbuild: "elada.gpr" processing failed
Makefile:30: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-el'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-security'
gprbuild -m -q -p -Psecurity.gpr -XBUILD=distrib -XPROCESSORS=8 -XSECURITY_LIBRARY_TYPE=static
security.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
security.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
security.gpr:3:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_xml" not found
security.gpr:9:19: unknown project "config"
security.gpr:9:26: unknown string type "library_type_type"
security.gpr:13:25: unknown variable "Library_Type"
security.gpr:17:30: unknown project "Config"
security.gpr:19:27: "Config" is not an imported or extended project
security.gpr:20:28: "Config" is not an imported or extended project
security.gpr:21:29: "Config" is not an imported or extended project
security.gpr:22:29: "Config" is not an imported or extended project
gprbuild: "security.gpr" processing failed
Makefile:41: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-security'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-wiki'
gprbuild -m -q -p -Pwikiada.gpr -XBUILD=distrib -XPROCESSORS=8 -XWIKI_LIBRARY_TYPE=static
wikiada.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
wikiada.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_core" not found
wikiada.gpr:7:19: unknown project "config"
wikiada.gpr:7:26: unknown string type "library_type_type"
wikiada.gpr:9:19: unknown project "config"
wikiada.gpr:9:26: unknown string type "yes_no"
wikiada.gpr:12:09: unknown variable "Use_Ada_Util"
wikiada.gpr:22:25: unknown variable "Library_Type"
wikiada.gpr:28:28: "Config" is not an imported or extended project
wikiada.gpr:29:29: "Config" is not an imported or extended project
wikiada.gpr:30:29: "Config" is not an imported or extended project
wikiada.gpr:33:41: unknown projects "Config.Binder" or "Config"
wikiada.gpr:33:55: unknown attribute "default_switches"
gprbuild: "wikiada.gpr" processing failed
Makefile:51: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-wiki'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-servlet'
mkdir -p obj/servletada_ews/static
mkdir -p obj/servletada_unit/static
mkdir -p obj/servletada_all/static
gprbuild -m -q -p -Pservletada.gpr -XBUILD=distrib -XPROCESSORS=8 -XSERVLET_LIBRARY_TYPE=static
servletada.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
servletada.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
servletada.gpr:3:06: imported project file "/workspaces/PhD_XP/src/ada-awa/elada" not found
servletada.gpr:4:06: imported project file "/workspaces/PhD_XP/src/ada-awa/security" not found
servletada.gpr:10:19: unknown project "config"
servletada.gpr:10:26: unknown string type "library_type_type"
servletada.gpr:17:25: unknown variable "Library_Type"
servletada.gpr:21:30: unknown project "Config"
servletada.gpr:23:27: "Config" is not an imported or extended project
servletada.gpr:24:28: "Config" is not an imported or extended project
servletada.gpr:25:29: "Config" is not an imported or extended project
servletada.gpr:26:29: "Config" is not an imported or extended project
gprbuild: "servletada.gpr" processing failed
Makefile:39: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-servlet'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/openapi-ada'
mkdir -p obj/openapi_server/static
gprbuild -m -q -p -Popenapi.gpr -XBUILD=distrib -XPROCESSORS=8 -XOPENAPI_LIBRARY_TYPE=static
openapi.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
openapi.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
openapi.gpr:3:06: imported project file "/workspaces/PhD_XP/src/ada-awa/security" not found
openapi.gpr:9:19: unknown project "config"
openapi.gpr:9:26: unknown string type "library_type_type"
openapi.gpr:12:25: unknown variable "Library_Type"
openapi.gpr:19:28: "Config" is not an imported or extended project
openapi.gpr:20:29: "Config" is not an imported or extended project
openapi.gpr:21:29: "Config" is not an imported or extended project
openapi.gpr:24:41: unknown projects "Config.Binder" or "Config"
openapi.gpr:24:55: unknown attribute "default_switches"
gprbuild: "openapi.gpr" processing failed
Makefile:94: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/openapi-ada'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-asf'
gprbuild -m -q -p -Pasf.gpr -XBUILD=distrib -XPROCESSORS=8 -XASF_LIBRARY_TYPE=static
asf.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
asf.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
asf.gpr:3:06: imported project file "/workspaces/PhD_XP/src/ada-awa/elada" not found
asf.gpr:4:06: imported project file "/workspaces/PhD_XP/src/ada-awa/security" not found
asf.gpr:5:06: imported project file "/workspaces/PhD_XP/src/ada-awa/servletada" not found
asf.gpr:11:19: unknown project "config"
asf.gpr:11:26: unknown string type "library_type_type"
asf.gpr:16:25: unknown variable "Library_Type"
asf.gpr:20:30: unknown project "Config"
asf.gpr:22:27: "Config" is not an imported or extended project
asf.gpr:23:28: "Config" is not an imported or extended project
asf.gpr:24:29: "Config" is not an imported or extended project
asf.gpr:25:29: "Config" is not an imported or extended project
gprbuild: "asf.gpr" processing failed
Makefile:85: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-asf'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-keystore'
gprbuild -m -q -p -Pkeystoreada.gpr -XBUILD=distrib -XPROCESSORS=8 -XKEYSTORE_LIBRARY_TYPE=static
keystoreada.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
keystoreada.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
keystoreada.gpr:8:19: unknown project "config"
keystoreada.gpr:8:26: unknown string type "library_type_type"
keystoreada.gpr:11:25: unknown variable "Library_Type"
keystoreada.gpr:18:28: "Config" is not an imported or extended project
keystoreada.gpr:19:29: "Config" is not an imported or extended project
keystoreada.gpr:20:29: "Config" is not an imported or extended project
keystoreada.gpr:23:41: unknown projects "Config.Binder" or "Config"
keystoreada.gpr:23:55: unknown attribute "default_switches"
gprbuild: "keystoreada.gpr" processing failed
Makefile:120: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-keystore'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/ada-ado'
libs=`echo '"-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lm -lrt -latomic -lssl -lcrypto -ldl"' | sed -e 's,^ *,,' -e 's,  , ,g' -e 's, $,,g' | sed -e 's, ," \& ASCII.NUL \& ",g'` ; \
    libs=`echo "$libs" | sed -e 's,ASCII.NUL & "" & ASCII.NUL,ASCII.NUL,g'`;\
gnatprep -DMYSQL_LIB="$libs" src/mysql/mysql-lib.gpb src/mysql/mysql-lib.ads
gnatprep -DHAVE_MYSQL=True \
         -DHAVE_SQLITE=True \
         -DHAVE_POSTGRESQL=True \
         regtests/ado-testsuite-drivers.gpb regtests/ado-testsuite-drivers.adb
gnatprep -DHAVE_MYSQL=True \
          -DHAVE_SQLITE=True \
          -DHAVE_POSTGRESQL=True \
          src/drivers/ado-drivers-initialize.gpb src/drivers/ado-drivers-initialize.adb
mkdir -p obj/ado_sqlite/static
mkdir -p obj/ado_mysql/static
mkdir -p obj/ado_postgresql/static
mkdir -p obj/ado_all/static
gprbuild -m -q -p -Pado.gpr -XBUILD=distrib -XPROCESSORS=8 -XADO_LIBRARY_TYPE=static
ado.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
ado.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
ado.gpr:3:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_xml" not found
ado.gpr:9:19: unknown project "config"
ado.gpr:9:26: unknown string type "library_type_type"
ado.gpr:13:25: unknown variable "Library_Type"
ado.gpr:24:41: unknown projects "Config.Binder" or "Config"
ado.gpr:24:55: unknown attribute "default_switches"
ado.gpr:27:28: "Config" is not an imported or extended project
ado.gpr:28:29: "Config" is not an imported or extended project
gprbuild: "ado.gpr" processing failed
Makefile:159: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/ada-ado'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/dynamo'
gnatprep -DCONFIG_DIR='"/usr/local/share/dynamo/base"' -DVERSION='"1.4.0"' \
          src/gen-configs.gpb src/gen-configs.ads
gprbuild -m -q -p -Pdynamo -XBUILD=distrib -XPROCESSORS=8
dynamo.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
dynamo.gpr:3:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
dynamo.gpr:4:06: imported project file "/workspaces/PhD_XP/src/ada-awa/elada" not found
dynamo.gpr:5:06: imported project file "/workspaces/PhD_XP/src/ada-awa/asf" not found
dynamo.gpr:6:06: imported project file "/workspaces/PhD_XP/src/ada-awa/servletada" not found
dynamo.gpr:7:06: imported project file "/workspaces/PhD_XP/src/ada-awa/ado_all" not found
dynamo.gpr:8:06: imported project file "gnatprj" not found
dynamo.gpr:20:28: unknown project "Config"
dynamo.gpr:37:30: unknown project "Config"
dynamo.gpr:38:28: unknown project "Config"
dynamo.gpr:40:27: "Config" is not an imported or extended project
dynamo.gpr:41:28: "Config" is not an imported or extended project
dynamo.gpr:42:29: "Config" is not an imported or extended project
dynamo.gpr:43:27: "Config" is not an imported or extended project
gprbuild: "dynamo" processing failed
Makefile:52: recipe for target 'local-build' failed
make[1]: *** [local-build] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/dynamo'
make[1]: Entering directory '/workspaces/PhD_XP/src/ada-awa/awa'
mkdir -p obj/awa_unit/static
mkdir -p obj/awa_workspaces/static
mkdir -p obj/awa_mail/static
mkdir -p obj/awa_counters/static
mkdir -p obj/awa_storages/static
mkdir -p obj/awa_images/static
mkdir -p obj/awa_comments/static
mkdir -p obj/awa_jobs/static
mkdir -p obj/awa_votes/static
mkdir -p obj/awa_tags/static
mkdir -p obj/awa_wikis/static
mkdir -p obj/awa_blogs/static
mkdir -p obj/awa_questions/static
mkdir -p obj/awa_countries/static
mkdir -p obj/awa_settings/static
mkdir -p obj/awa_changelogs/static
mkdir -p obj/awa_setup/static
mkdir -p obj/awa_sysadmin/static
gprbuild -m -q -p -Pawa.gpr -XBUILD=distrib -XPROCESSORS=8 -XAWA_LIBRARY_TYPE=static
awa.gpr:1:06: imported project file "/workspaces/PhD_XP/src/ada-awa/config" not found
awa.gpr:2:06: imported project file "/workspaces/PhD_XP/src/ada-awa/utilada_sys" not found
awa.gpr:3:06: imported project file "/workspaces/PhD_XP/src/ada-awa/elada" not found
awa.gpr:4:06: imported project file "/workspaces/PhD_XP/src/ada-awa/wikiada" not found
awa.gpr:5:06: imported project file "/workspaces/PhD_XP/src/ada-awa/ado" not found
awa.gpr:6:06: imported project file "/workspaces/PhD_XP/src/ada-awa/asf" not found
awa.gpr:7:06: imported project file "/workspaces/PhD_XP/src/ada-awa/security" not found
awa.gpr:8:06: imported project file "/workspaces/PhD_XP/src/ada-awa/keystoreada" not found
awa.gpr:15:19: unknown project "config"
awa.gpr:15:26: unknown string type "library_type_type"
awa.gpr:16:28: unknown project "Config"
awa.gpr:18:17: unknown project "config"
awa.gpr:18:24: unknown string type "yes_no"
awa.gpr:19:22: unknown project "config"
awa.gpr:19:29: unknown string type "yes_no"
awa.gpr:25:25: unknown variable "Library_Type"
awa.gpr:32:27: "Config" is not an imported or extended project
awa.gpr:33:28: "Config" is not an imported or extended project
awa.gpr:34:29: "Config" is not an imported or extended project
gprbuild: "awa.gpr" processing failed
Makefile:160: recipe for target 'static' failed
make[1]: *** [static] Error 5
make[1]: Leaving directory '/workspaces/PhD_XP/src/ada-awa/awa'
Makefile:19: recipe for target 'build' failed
make: *** [build] Error 2

Btw, the dependency pkg-config is not listed in the README but it is required.

Heziode commented 1 year ago

Ok,

I was able to compile the project. I had to modify in all GPR file the path to all project that is in submodules here.

Furthermore, dynamo generates the wrong with in GPR to access GPR units. It generates gnatprj in my case instead of gpr.

I have also reported this issue https://github.com/stcarrez/ada-servlet/issues/13.


I keep this issue open, even if I was able to compile the project, because it does not compile "out of the box", nether with Makefile nor Alire.


In addition, @reznikmm suggest to move all alire-*.toml in a subdirectory and renaming all to alire.toml in order to manage more efficiently the "monorepo" style. (source).