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

Feature/vcpkg linux #2078

Merged
merged 58 commits into from
May 30, 2024
Merged

Feature/vcpkg linux #2078

merged 58 commits into from
May 30, 2024

Conversation

sylvlecl
Copy link
Member

@sylvlecl sylvlecl commented May 2, 2024

Continuing work on VCPKG for Linux, basically trying to simplify workflows from #2049 and using manifest mode.

Status

  • Build OK for all workflows
  • Caching OK for all workflows

Overall strategy

Merge this in feature branch feature/vcpkg-dependencies first.
The whole feature branch will be merged only once it brings sufficient added value to existing mechanisms.

In particular, when we are able to remove the use of antares-deps in favor of using vcpkg would be a good time to do so.

Documentation should be updated in feature/vcpkg-dependencies when the developer workflow is clear.

sylvlecl added 19 commits May 2, 2024 08:58
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
sylvlecl added 10 commits May 2, 2024 18:56
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
- name: Cache vcpkg binary dir
if: always()
Copy link
Member

Choose a reason for hiding this comment

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

Even in the case of build errors ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question :
I think it makes sense:

  • if the dependencies build works and the project build fails, we need to keep the dependencies to not rebuild them in a later workflow
  • if it's the build of a dependency which fails, I think it is still better to save the cache because other dependencies may have succeeded. Also, because we restore the previous cache, this should keep previously cached items which have not been rebuilt (like the ones that would have been rebuilt after the dependency that failed)

@sylvlecl
Copy link
Member Author

To be checked before merging:

I am not sure the windows artifact will be complete now, because with the default triplet "x64-windows", dependencies are built as DLLs, which will include zlib and minizip. Currently, they are linked statically.

I would propose to introduce custom triplets for this, and also to avoid building debug artifacts of dependencies.

@sylvlecl sylvlecl marked this pull request as draft May 16, 2024 08:33
sylvlecl added 2 commits May 16, 2024 11:02
 - link statically with chosen libraries
 - build only release artifacts on CI

Signed-off-by: Sylvain Leclerc <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

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

remove ?

Signed-off-by: Sylvain Leclerc <[email protected]>
@a-zakir a-zakir mentioned this pull request May 23, 2024
path: ${{ env.VCPKG_CACHE_DIR }}
key: vcpkg-cache-centos7-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }}
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-centos7-
Copy link
Contributor

@a-zakir a-zakir May 23, 2024

Choose a reason for hiding this comment

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

wow! i would recommend to place the "install vcpkg and the restore cache" jobs in dedicated file

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately it does not seem so easy, because we cannot have "post actions" in composite github actions :(
See actions/runner#1478

I wanted to have the 3 steps "install VCPKG", "restore cache" and "save cache" in the same action, but it's not possible.
If we keep the save step separate, it will be messy because you need to know "internal details" of the other steps (the cahce key basically).

So I'm afraid I will leave it this way for now ...

else ()
find_dependency(minizip)
if (NOT minizip_FOUND)
message (FATAL_ERROR "Minizip dependency (minizip or minizip-ng) not found.")
Copy link
Contributor

Choose a reason for hiding this comment

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

specify minimal version? according to this commit, at least v 3.0.7 and back are incompatible with Simulator.
minizip target is confusing it actually refers to minizip-ng and not the "original" project

@@ -8,7 +8,7 @@ target_link_libraries(test-writer
Boost::unit_test_framework
Antares::result_writer
test_utils_unit
MINIZIP::minizip
MINIZIP::minizip-ng
Copy link
Contributor

Choose a reason for hiding this comment

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

is this works with the "minizip" target ?

- name: Install cmake 3.28
run: pip3 install cmake==3.28.4

- name: Install VCPKG
Copy link
Contributor

Choose a reason for hiding this comment

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

@JasonMarechal25 JasonMarechal25 marked this pull request as ready for review May 29, 2024 13:10
@JasonMarechal25 JasonMarechal25 marked this pull request as draft May 29, 2024 13:13
@JasonMarechal25 JasonMarechal25 marked this pull request as ready for review May 29, 2024 15:37
@JasonMarechal25 JasonMarechal25 changed the base branch from feature/vcpkg-dependencies to develop May 29, 2024 15:39
JasonMarechal25 and others added 2 commits May 29, 2024 17:42
- Define  minimal version for boost and minizip
- remove BOOST_TEST_DYN_LINK

---------

Co-authored-by: Florian OMNES <[email protected]>
Copy link

sonarcloud bot commented May 30, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@JasonMarechal25 JasonMarechal25 merged commit 88a3aa7 into develop May 30, 2024
7 checks passed
@JasonMarechal25 JasonMarechal25 deleted the feature/vcpkg-linux branch May 30, 2024 13:58
JasonMarechal25 pushed a commit that referenced this pull request Jun 5, 2024
**Description**

Continues the work of #2078 (which should be merged before in feature
branch feature/vcpkg-dependencies), to push further the use of VCPKG,
and in particular remove the need for the home-made antares-deps
repository.

Hence, this includes:
 - Addition of sirius-solver "overlay" port to install sirius with VCPKG
 - Removal of antares-deps and associated code

---------

Signed-off-by: Sylvain Leclerc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants