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

Comprehensive shared builds tests and related tweaks #1459

Merged
merged 11 commits into from
Sep 27, 2023

Conversation

mosteo
Copy link
Member

@mosteo mosteo commented Sep 19, 2023

I apologize for the large amount of files changed in this PR. It's ugly on the surface but most of it are minor tweaks to the testsuite.

I was wary of only having a few tests for the new shared builds, when the bulk of our testsuite could apply to them too. So, now the default test driver by default runs the test twice, in sandboxed and shared modes (either can be disabled).

This uncovered a few bugs and subtle differences in behaviors between both modes. Besides the bugfixing, I've tried to homogenize these differences to save us maintenance headaches down the road.

The changes that are not bugfixes in this PR are:

  • New build_mode in test.yaml (takes either of both, sandboxed, shared).
  • Don't use the compiler version as input for the root crate, allowing more tests to run without a configured compiler.
    • (Most tests in shared mode required the detection of the compiler version, for which a new compiler_only_index is available.)
  • Delay config files generation in sandboxed mode to update/build time, to match shared dependencies behavior.
  • Include list of switches in hash input, to ensure config regeneration on switches overrides in manifests.
  • Require complete config at build time for sandboxed mode too, rather than attempting the build, to match shared behavior.

@mosteo mosteo force-pushed the feat/shared-tests branch 2 times, most recently from 3253295 to b365344 Compare September 20, 2023 05:37
@mosteo mosteo marked this pull request as ready for review September 20, 2023 13:38
@mosteo
Copy link
Member Author

mosteo commented Sep 20, 2023

My idea after this PR is to finally enable shared builds and publish the 2.0-rc1, so people can start to test it while I work on the backlog of bugs


# If mode is "both", track original files for later
if mode == "both":
self.save_working_dir()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there must be a "better" way to this.

Maybe @pmderodat if you have a minute to have a look. We want to run all the tests in two different modes, is there a nice way to do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we wait for @pmderodat feedback (I also thought that this is hackish), I will merge provisionally, we can revert/update later if there is a better way.

@Fabien-Chouteau
Copy link
Member

Hi @mosteo, I give the shared builds a try today and hit a first bump with externals:

$ alr get --build eagle_lander
ⓘ Deploying eagle_lander=1.2.0...                                                                              
ⓘ Deploying libgtk3=3.24.33...
error: directory "/home/chouteau/.cache/alire/builds/libgtk3_3.24.33_system" does not exist
error: alr encountered an unexpected error, re-run with -d for details.

I tried again:

$ alr get --build eagle_lander
ⓘ Deploying make=4.3.0...                                                                                      
error: directory "/home/chouteau/.cache/alire/builds/make_4.3.0_system" does not exist
error: alr encountered an unexpected error, re-run with -d for details.

And again with -d:

$ alr -d get --build eagle_lander
ⓘ Deploying pkg_config=0.29.2...                                                                               
stderr: ADA.IO_EXCEPTIONS.NAME_ERROR
stderr: directory "/home/chouteau/.cache/alire/builds/pkg_config_0.29.2_system" does not exist
stderr: raised ADA.IO_EXCEPTIONS.NAME_ERROR : directory "/home/chouteau/.cache/alire/builds/pkg_config_0.29.2_system" does not exist
[/home/chouteau/src/github/alire/alire/bin/alr]
0x10b9e93 ada__directories__set_directory at ???
0x7f85e7 Alire.Directories.Initialize at alire-directories.adb:477
0x7eef2a Alire.Directories.GuardDI at alire-directories.ads:264
0xcdcbe5 Alire.Roots.Print_Nested_Crates at alire-roots.adb:1137
0xcd44ff Alire.Roots.Deploy_Dependencies.Deploy_Release at alire-roots.adb:752
0xcef4da Alire.Roots.Traverse.Traverse_Wrap at alire-roots.adb:1951
0xd43603 Alire.Solutions.Traverse.Visit at alire-solutions.adb:1460
0xd41c87 Alire.Solutions.Traverse at alire-solutions.adb:1527
0xcef628 Alire.Roots.Traverse at alire-roots.adb:1955
0xcd472f Alire.Roots.Deploy_Dependencies at alire-roots.adb:763
0x4b3df6 Alr.Commands.Get.Retrieve at alr-commands-get.adb:177
0x4b89f7 Alr.Commands.Get.Execute at alr-commands-get.adb:356
0x54c9d6 Alr.Commands.Sub_Cmd.Execute at clic-subcommand-instance.adb:743
0x5586ce Alr.Commands.Execute at alr-commands.adb:498
0x44004a Alr.Main at alr-main.adb:10
0x442bd5 Main at b__alr-main.adb:2272
[/lib/x86_64-linux-gnu/libc.so.6]
0x7f17a4829d8e
0x7f17a4829e3e
[/home/chouteau/src/github/alire/alire/bin/alr]
0x43ff23 _start at ???
0xfffffffffffffffe

error: directory "/home/chouteau/.cache/alire/builds/pkg_config_0.29.2_system" does not exist
error: alr encountered an unexpected error, re-run with -d for details.

And the last time the build worked! As you can see Alire is complaining once for each external and then it works...

@mosteo
Copy link
Member Author

mosteo commented Sep 27, 2023

Curious, I have seen something similar with pins (at their regular location) sporadically, but hadn't managed to reproduce.

That stack trace will surely help, thanks. Besides, we shouldn't be creating these folders for system packages...

@mosteo mosteo merged commit 2753a7c into alire-project:master Sep 27, 2023
13 checks passed
@mosteo mosteo deleted the feat/shared-tests branch September 27, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants