Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix link issues with qt6 resources #7915

Merged
merged 8 commits into from
Jan 19, 2024

Conversation

sloriot
Copy link
Member

@sloriot sloriot commented Dec 6, 2023

No description provided.

@sloriot sloriot added Batch_1 First Batch of PRs under testing Under Testing and removed Batch_1 First Batch of PRs under testing labels Dec 6, 2023
@lrineau
Copy link
Member

lrineau commented Dec 7, 2023

I think I have eventually found the culprit lines: see the fix in 811f78c.

Before

Before that commit, the following command

rm -rf /tmp/build || true; cmake -DCGAL_TEST_SUITE=ON -S ~/Git/cgal-master -B /tmp/build -DWITH_examples=ON -DCGAL_ENABLE_TESTING=ON && ctest --test-dir /tmp/build -j12 -L Linear_cell_complex_Examples --stop-on-failure --output-on-failure

was failing, and the first line of the output of CTest were:

Internal ctest changing into directory: /tmp/build
Test project /tmp/build
      Start   2: check build system
      Start 768: copy source_dir of Linear_cell_complex_Examples
 1/29 Test #768: copy source_dir of Linear_cell_complex_Examples ...............   Passed    0.01 sec
 2/29 Test   #2: check build system ............................................   Passed    0.16 sec
      Start 766: compilation of  gmap_linear_cell_complex_3
      Start 770: compilation of  linear_cell_complex_3
      Start 772: compilation of  linear_cell_complex_3_attributes_management
      Start 774: compilation of  linear_cell_complex_3_incremental_builder
      Start 776: compilation of  linear_cell_complex_3_insert
      Start 778: compilation of  linear_cell_complex_3_operations
      Start 780: compilation of  linear_cell_complex_3_with_colored_vertices
      Start 782: compilation of  linear_cell_complex_3_with_mypoint
      Start 784: compilation of  linear_cell_complex_4
      Start 786: compilation of  plane_graph_to_lcc_2
      Start 788: compilation of  voronoi_2
      Start 790: compilation of  voronoi_3
 3/29 Test #780: compilation of  linear_cell_complex_3_with_colored_vertices ...***Failed   24.13 sec
[  0%] Automatic MOC for target CGAL_Qt6_moc_and_resources
[  0%] Built target CGAL_Qt6_moc_and_resources_autogen
[  0%] Building CXX object examples/Arrangement_on_surface_2/CMakeFiles/CGAL_Qt6_moc_and_resources.dir/CGAL_Qt6_moc_and_resources_autogen/mocs_compilation.cpp.o
[100%] Linking CXX static library libCGAL_Qt6_moc_and_resources.a
/usr/bin/ranlib: unable to copy file 'libCGAL_Qt6_moc_and_resources.a'; reason: No such file or directory
gmake[3]: *** [examples/Arrangement_on_surface_2/CMakeFiles/CGAL_Qt6_moc_and_resources.dir/build.make:203: examples/Arrangement_on_surface_2/libCGAL_Qt6_moc_and_resources.a] Error 1
gmake[3]: *** Deleting file 'examples/Arrangement_on_surface_2/libCGAL_Qt6_moc_and_resources.a'
gmake[2]: *** [CMakeFiles/Makefile2:6414: examples/Arrangement_on_surface_2/CMakeFiles/CGAL_Qt6_moc_and_resources.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:14065: examples/Linear_cell_complex/CMakeFiles/linear_cell_complex_3_with_colored_vertices.dir/rule] Error 2
gmake: *** [Makefile:4690: linear_cell_complex_3_with_colored_vertices] Error 2

After

After that commit 811f78c, the same command succeeds, and the first lines of CTest are:

Internal ctest changing into directory: /tmp/build
Test project /tmp/build
      Start   2: check build system
      Start 769: copy source_dir of Linear_cell_complex_Examples
 1/30 Test #769: copy source_dir of Linear_cell_complex_Examples ...............   Passed    0.01 sec
 2/30 Test   #2: check build system ............................................   Passed    0.16 sec
      Start 109: compilation of  CGAL_Qt6_moc_and_resources
 3/30 Test #109: compilation of  CGAL_Qt6_moc_and_resources ....................   Passed    6.45 sec
      Start 767: compilation of  gmap_linear_cell_complex_3
      Start 771: compilation of  linear_cell_complex_3
      Start 773: compilation of  linear_cell_complex_3_attributes_management
      Start 775: compilation of  linear_cell_complex_3_incremental_builder
      Start 777: compilation of  linear_cell_complex_3_insert
      Start 779: compilation of  linear_cell_complex_3_operations
      Start 781: compilation of  linear_cell_complex_3_with_colored_vertices
      Start 783: compilation of  linear_cell_complex_3_with_mypoint
      Start 785: compilation of  linear_cell_complex_4
      Start 787: compilation of  plane_graph_to_lcc_2
      Start 789: compilation of  voronoi_2
      Start 791: compilation of  voronoi_3
[...]

The diff is those two lines, that appear very early in the CTest results:

      Start 109: compilation of  CGAL_Qt6_moc_and_resources
 3/30 Test #109: compilation of  CGAL_Qt6_moc_and_resources ....................   Passed    6.45 sec

The issue before 811f78c was that the tests added by cgal_add_test(${exe_name}) were added before the target ${exe_name} was linked with CGAL imported target (and in particular CGAL::CGAL_Qt6).

Now that I have managed to reproduce the bug, and fix it locally, I am now quite confident that we have found the eventual fix.

I still do not understand why it seems the bug was only detected on ArchLinux.

@sloriot
Copy link
Member Author

sloriot commented Dec 11, 2023

Still not sufficient, see for example here

@lrineau
Copy link
Member

lrineau commented Jan 10, 2024

There is still an issue: all plugins depend on the Polyhedron_3 target, and that target is built several times in parallel. That can lead to another race-condition, like

https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-6.0-Ic-147/Polyhedron_Demo/TestReport_gimeno_Debian-testing-clang-main.gz

The simplest fix is to remove the dependency to Polyehdron_3. @sloriot what do you think?

@sloriot
Copy link
Member Author

sloriot commented Jan 10, 2024

There is still an issue: all plugins depend on the Polyhedron_3 target, and that target is built several times in parallel. That can lead to another race-condition, like

https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-6.0-Ic-147/Polyhedron_Demo/TestReport_gimeno_Debian-testing-clang-main.gz

The simplest fix is to remove the dependency to Polyehdron_3. @sloriot what do you think?

Looks good to me

@lrineau lrineau force-pushed the CGAL-fix_qt_resources_dependencies branch from 258fd30 to 1491b75 Compare January 11, 2024 14:32
@lrineau
Copy link
Member

lrineau commented Jan 18, 2024

It seems this time this PR is working correctly, now.

At least in last week testsuite Test Results of CGAL-6.0-Ic-147, #Polyhedron_Demo it seems fine. I have grepped for Linking.*demo_framework in all the testresults and it was present only once, in Polyhedron_Demo.

cgal /srv/CGAL/www/testsuite $ zgrep 'Linking.*demo_framework' CGAL-6.0-Ic-147/*/*ArchLinux-clang*gz   
CGAL-6.0-Ic-147/Polyhedron_Demo/TestReport_gimeno_ArchLinux-clang-CXX17-Release.gz:Linking CXX shared library libdemo_framework.so
CGAL-6.0-Ic-147/Polyhedron_Demo/TestReport_gimeno_ArchLinux-clang.gz:Linking CXX shared library libdemo_framework.so
CGAL-6.0-Ic-147/Polyhedron_Demo/TestReport_gimeno_ArchLinux-clang-Release.gz:Linking CXX shared library libdemo_framework.so
CGAL-6.0-Ic-147/Polyhedron_Demo/TestReport_lrineau_ArchLinux-clang-CXX20-Release.gz:Linking CXX shared library libdemo_framework.so
zsh: exit 1     zgrep 'Linking.*demo_framework' CGAL-6.0-Ic-147/*/*ArchLinux-clang*gz
zsh: exit 1

@sloriot sloriot self-assigned this Jan 19, 2024
@sloriot sloriot merged commit 2e4139c into CGAL:master Jan 19, 2024
9 checks passed
@sloriot sloriot deleted the CGAL-fix_qt_resources_dependencies branch January 19, 2024 10:42
@lrineau lrineau added this to the 6.0-beta milestone Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants