AdaCore / RecordFlux

Formal specification and generation of verifiable binary parsers, message generators and protocol state machines
Apache License 2.0
106 stars 7 forks source link

Missing `alr build` step either in instructions or in Makefile #1296

Closed mgrojo closed 2 months ago

mgrojo commented 6 months ago

Using Alire 2.0.1 and following the steps in the development guide I got these errors:

mgr@mgr-B50-80:~/src/github/AdaCore/RecordFlux$ make install_devel
gprbuild -p -j0 -Pgenerated/librflxlang.gpr \
    -XLIBRARY_TYPE=static-pic \
    -XLIBRFLXLANG_LIBRARY_TYPE=relocatable \
    -XLIBRFLXLANG_STANDALONE=encapsulated
librflxlang.gpr:6:06: imported project file "gnatcoll" not found
gnatcoll_gmp.gpr:24:06: imported project file "gnatcoll" not found
gnatcoll_gmp.gpr:24:06: imported by "/home/mgr/src/github/AdaCore/RecordFlux/generated/gnatcoll-bindings/gmp/gnatcoll_gmp.gpr"
gnatcoll_gmp.gpr:24:06: imported by "/home/mgr/src/github/AdaCore/RecordFlux/generated/librflxlang.gpr"
gnatcoll_gmp.gpr:45:43: unknown package or project "Gnatcoll"
gnatcoll_iconv.gpr:24:06: imported project file "gnatcoll" not found
gnatcoll_iconv.gpr:24:06: imported by "/home/mgr/src/github/AdaCore/RecordFlux/generated/gnatcoll-bindings/iconv/gnatcoll_iconv.gpr"
gnatcoll_iconv.gpr:24:06: imported by "/home/mgr/src/github/AdaCore/RecordFlux/generated/librflxlang.gpr"
gnatcoll_iconv.gpr:45:43: unknown package or project "Gnatcoll"
langkit_support.gpr:1:06: imported project file "gnatcoll" not found
langkit_support.gpr:1:06: imported by "/home/mgr/src/github/AdaCore/RecordFlux/generated/langkit/langkit/support/langkit_support.gpr"
langkit_support.gpr:1:06: imported by "/home/mgr/src/github/AdaCore/RecordFlux/generated/librflxlang.gpr"
gprbuild: "generated/librflxlang.gpr" processing failed
make: *** [Makefile:212: generated/lib/relocatable/dev/librflxlang.so] Error 4

The problem was, that the project files did not exist in the directories present in GPR_PROJECT_PATH generated by Alire in the eval $(make printenv_gnat) step.

To continue building, I had to run:


cd build/alire
alr build
cd -
make install_devel
``
treiher commented 6 months ago

Thank you for the report! This problem is caused by a behavior change in Alire 2.0. It worked fine with previous Alire versions. We will update the Makefile accordingly.

mgrojo commented 2 months ago

I've tried to build the new release (v0.23.0) and got hit again by this issue when following the updated development guide at the make parser or make test steps. My previous workaround hasn't solved these steps, though, the make targets still have problems to find the gnatcoll projects. Which would be the recommended workaround for this release?

mgrojo commented 2 months ago

Apparently, some of the steps done for working around #1300 has solved this problem and now make parser and make test pass, so maybe it was my problem understanding the steps in the development guide.

make test has ended with this error, by the way:

  + Exception ignored in: <module 'threading' from '/usr/lib/python3.10/threading.py'>
  + Traceback (most recent call last):
  +   File "/usr/lib/python3.10/threading.py", line 1537, in _shutdown
  +     atexit_call()
  +   File "/usr/lib/python3.10/concurrent/futures/process.py", line 93, in _python_exit
  +     thread_wakeup.wakeup()
  +   File "/usr/lib/python3.10/concurrent/futures/process.py", line 79, in wakeup
  +     self._writer.send_bytes(b"")
  +   File "/usr/lib/python3.10/multiprocessing/connection.py", line 200, in send_bytes
  +     self._send_bytes(m[offset:offset + size])
  +   File "/usr/lib/python3.10/multiprocessing/connection.py", line 411, in _send_bytes
  +     self._send(header + buf)
  +   File "/usr/lib/python3.10/multiprocessing/connection.py", line 368, in _send
  +     n = write(self._handle, buf)
  + OSError: [Errno 9] Bad file descriptor
======================================================================== 1 failed, 10 passed, 25 warnings in 19.62s =========================================================================
make: *** [Makefile:432: test_end_to_end] Error 1
treiher commented 2 months ago

The original issue has been fixed in f9ce6841824629552c60a8e3e46159ff5411022b. If you can reproduce the issue with the current main, please reopen this ticket.

The error for make test is a transient error which we only have seen a couple of times in our CI so far. The error shouldn't occur if you rerun the tests. It looks like a bug in Python's multiprocessing implementation. Unfortunately, we were not able to reproduce the error locally. If you can reproduce it, please open a new ticket.

mgrojo commented 2 months ago

I rerun make test and the former problem was not reproduced. It ended in this way:

===================================================== 50 failed, 2959 passed, 20 skipped, 1 xfailed, 30 warnings in 1096.09s (0:18:16) ======================================================
make: *** [Makefile:447: test_optimized] Error 1

I don't know if that is expected or not, so I simply put this message here for your information. I can open a new ticket if desired.