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

Add ci-windows-shared-local.yml #2309

Merged

Conversation

wantehchang
Copy link
Collaborator

Add a CI workflow for building shared libraries with local dependencies on Windows.

@wantehchang wantehchang force-pushed the add-windows-shared-ci-workflow branch 2 times, most recently from 07ae2b8 to 02f3a7d Compare July 23, 2024 00:48
@wantehchang wantehchang marked this pull request as ready for review July 23, 2024 03:10
@wantehchang wantehchang requested review from vrabaud and y-guyon July 23, 2024 03:11
.github/workflows/ci-windows-shared-local.yml Outdated Show resolved Hide resolved
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_METAV1=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a thought: we could have a CI with a matrix testing all combinations of these experimental flags

Copy link
Collaborator Author

@wantehchang wantehchang Jul 29, 2024

Choose a reason for hiding this comment

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

That's a lot of combinations (16) to test. I think we just need to test three combinations:

  • No experimental features are enabled.
  • Only the gain map experimental feature is enabled. (Chrome uses this combination.)
  • All experimental features are enabled.

- name: Prepare libavif (cmake)
run: >
cmake -G Ninja -S . -B build
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should Debug be tested too? I remember difficulties when linking differently built dependencies and wonder if that should be exercised. Probably not worth the effort.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can looking into adding Debug later. Right now I am focusing on getting a clean (no compiler or linker warnings) Release build.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yannis: While working on related build issues on Windows, I remembered the linking issue you were referring to.

In Debug build, we compile source files with /MDd on Windows. The lowercase d means we are using a debug version of the run-time library. All of our dependencies need to be compiled with /MDd to avoid a linker warning.

We may be able to set the CMAKE_MSVC_RUNTIME_LIBRARY variable so that we use the /MD compiler option in all build configurations.

.github/workflows/ci-windows-shared-local.yml Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@vrabaud
Copy link
Collaborator

vrabaud commented Jul 23, 2024

Why not do a matrix in ci-windows.yml instead ? By adding

build type: [Debug, Release]
shared_libs: [OFF, ON]

codec-aom: 'LOCAL'
codec-dav1d: 'LOCAL'
extra-cache-key: ${{ matrix.compiler }}
- name: Leave compiler as default
Copy link
Collaborator

Choose a reason for hiding this comment

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

Setting those variables should probably be put in .github/actions/setup-windows

@vrabaud vrabaud added this to the v1.1.1 milestone Jul 24, 2024
@wantehchang wantehchang marked this pull request as draft July 26, 2024 02:44
@wantehchang
Copy link
Collaborator Author

I am changing this pull request to a draft because there seem to be linker warnings, and there is an unresolved symbol linker error if experimental features are enabled.

@wantehchang wantehchang force-pushed the add-windows-shared-ci-workflow branch from 46f69b0 to 4343faf Compare July 26, 2024 15:40
@wantehchang wantehchang marked this pull request as ready for review July 30, 2024 00:07
@wantehchang wantehchang requested review from vrabaud and y-guyon July 30, 2024 00:08
Copy link
Collaborator Author

@wantehchang wantehchang left a comment

Choose a reason for hiding this comment

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

I looked at the linker warnings carefully. I found that those linker warnings are only emitted when the linker error I reported in #2339 is there. So it should be fine to add this CI workflow as long as we avoid the linker error by turning off the gain map experimental feature. We can enable the other three experimental features.

- name: Prepare libavif (cmake)
run: >
cmake -G Ninja -S . -B build
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yannis: While working on related build issues on Windows, I remembered the linking issue you were referring to.

In Debug build, we compile source files with /MDd on Windows. The lowercase d means we are using a debug version of the run-time library. All of our dependencies need to be compiled with /MDd to avoid a linker warning.

We may be able to set the CMAKE_MSVC_RUNTIME_LIBRARY variable so that we use the /MD compiler option in all build configurations.

-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_METAV1=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
Copy link
Collaborator Author

@wantehchang wantehchang Jul 29, 2024

Choose a reason for hiding this comment

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

That's a lot of combinations (16) to test. I think we just need to test three combinations:

  • No experimental features are enabled.
  • Only the gain map experimental feature is enabled. (Chrome uses this combination.)
  • All experimental features are enabled.

@wantehchang wantehchang removed this from the v1.1.1 milestone Jul 30, 2024
Copy link
Collaborator Author

@wantehchang wantehchang left a comment

Choose a reason for hiding this comment

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

I removed the v1.1.1 milestone from this pull request.

.github/workflows/ci-windows-shared-local.yml Outdated Show resolved Hide resolved
@wantehchang wantehchang merged commit 3bd4c0f into AOMediaCodec:main Jul 30, 2024
16 checks passed
@wantehchang wantehchang deleted the add-windows-shared-ci-workflow branch July 30, 2024 20:07
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.

3 participants