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

[lcms] Update to v2.16 #42187

Merged
merged 2 commits into from
Dec 9, 2024
Merged

[lcms] Update to v2.16 #42187

merged 2 commits into from
Dec 9, 2024

Conversation

donny-dont
Copy link
Contributor

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

Copy link
Contributor Author

@donny-dont donny-dont left a comment

Choose a reason for hiding this comment

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

Migrating to the meson port present in 2.16. Only thing I'm not sure of how to make the CMake config that was present before. Think this change will break libjxl since it references the config.

--- a/src/lcms2.def
+++ b/src/lcms2.def
@@ -1,5 +1,3 @@
-LIBRARY LCMS2.DLL
Copy link
Contributor Author

Choose a reason for hiding this comment

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


// Handle "register" keyword
-#if defined(CMS_NO_REGISTER_KEYWORD)
+#if __cplusplus >= 201703L || defined(CMS_NO_REGISTER_KEYWORD)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ports/lcms/vcpkg.json Outdated Show resolved Hide resolved
@@ -13,5 +13,28 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"features": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

Only thing I'm not sure of how to make the CMake config that was present before. Think this change will break libjxl since it references the config.

Alternatives:

  • Write it manually.
  • Move reverse dependencies to pkg-config.

ports/lcms/vcpkg.json Outdated Show resolved Hide resolved
ports/lcms/vcpkg.json Outdated Show resolved Hide resolved
ports/lcms/portfile.cmake Outdated Show resolved Hide resolved
ports/lcms/vcpkg.json Outdated Show resolved Hide resolved
@MonicaLiu0311 MonicaLiu0311 added the category:port-update The issue is with a library, which is requesting update new revision label Nov 18, 2024
@MonicaLiu0311 MonicaLiu0311 marked this pull request as draft November 18, 2024 07:01
@donny-dont donny-dont force-pushed the lcms-2.16 branch 2 times, most recently from 24b687c to 4551952 Compare November 18, 2024 22:02
@donny-dont donny-dont marked this pull request as ready for review November 19, 2024 01:26
@donny-dont
Copy link
Contributor Author

@dg0yt @MonicaLiu0311 is there any way to see what the failure is on linux? My windows build with the same port completed.

@MonicaLiu0311
Copy link
Contributor

Please get failure logs here. Steps to view CI errors: #38994 (comment):

CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /mnt/vcpkg-ci/downloads/tools/cmake-3.30.1-linux/cmake-3.30.1-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j33
    Working Directory: /mnt/vcpkg-ci/b/openimageio/x64-linux-dbg
    See logs for more information:
      /mnt/vcpkg-ci/b/openimageio/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  /mnt/vcpkg-ci/installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  ports/openimageio/portfile.cmake:75 (vcpkg_cmake_install)
  scripts/ports.cmake:196 (include)

install-x64-linux-dbg-out.log

@dg0yt
Copy link
Contributor

dg0yt commented Nov 19, 2024

TLDNR: There is a stray -D-pthread which is probably meant to be a -pthread.

@donny-dont
Copy link
Contributor Author

TLDNR: There is a stray -D-pthread which is probably meant to be a -pthread.

Good catch. Trying to reproduce in WSL now to see where thats coming from.

@donny-dont
Copy link
Contributor Author

With the amount of packages required and the number of failures I've had over the course of the day because my Ubuntu WSL2 setup was missing some apt-get packages I don't think I'll get further with this today.

Just curious if the CI can be restarted if #42175 lands?

@MonicaLiu0311
Copy link
Contributor

Just curious if the CI can be restarted if #42175 lands?

It is currently in the reviewed status, please wait a moment.

@donny-dont
Copy link
Contributor Author

TLDNR: There is a stray -D-pthread which is probably meant to be a -pthread.

Ok so I got the x64-linux failure locally. I searched the CMakeCache.txt to see where the -pthread was coming from.

Line 1561: PC_LIBRAW_CFLAGS:INTERNAL=-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/libraw;-pthread;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/jasper;-DLIBJASPER_STATIC_DEFINE
	Line 1563: PC_LIBRAW_CFLAGS_OTHER:INTERNAL=-pthread;-DLIBJASPER_STATIC_DEFINE
	Line 1567: PC_LIBRAW_LDFLAGS:INTERNAL=-L/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../lib/manual-link;-lraw;-L/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../lib;-llcms2;-lm;-pthread;-lz;-ljasperd;-ljpeg
	Line 1568: PC_LIBRAW_LDFLAGS_OTHER:INTERNAL=-pthread
	Line 1578: PC_LIBRAW_R_CFLAGS:INTERNAL=-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/libraw;-pthread;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/jasper;-DLIBJASPER_STATIC_DEFINE
	Line 1580: PC_LIBRAW_R_CFLAGS_OTHER:INTERNAL=-pthread;-DLIBJASPER_STATIC_DEFINE
	Line 1584: PC_LIBRAW_R_LDFLAGS:INTERNAL=-L/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../lib;-lraw_r;-llcms2;-lm;-pthread;-lz;-ljasperd;-ljpeg
	Line 1585: PC_LIBRAW_R_LDFLAGS_OTHER:INTERNAL=-pthread
	Line 1595: PC_LIBRAW_R_STATIC_CFLAGS:INTERNAL=-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/libraw;-pthread;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/jasper;-DLIBJASPER_STATIC_DEFINE
	Line 1597: PC_LIBRAW_R_STATIC_CFLAGS_OTHER:INTERNAL=-pthread;-DLIBJASPER_STATIC_DEFINE
	Line 1599: PC_LIBRAW_R_STATIC_LDFLAGS:INTERNAL=-L/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../lib;-lraw_r;-llcms2;-lm;-pthread;-lz;-ljasperd;-ljpeg
	Line 1600: PC_LIBRAW_R_STATIC_LDFLAGS_OTHER:INTERNAL=-pthread
	Line 1613: PC_LIBRAW_STATIC_CFLAGS:INTERNAL=-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/libraw;-pthread;-I/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../../include/jasper;-DLIBJASPER_STATIC_DEFINE
	Line 1615: PC_LIBRAW_STATIC_CFLAGS_OTHER:INTERNAL=-pthread;-DLIBJASPER_STATIC_DEFINE
	Line 1617: PC_LIBRAW_STATIC_LDFLAGS:INTERNAL=-L/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../lib/manual-link;-lraw;-L/home/dev/vcpkg-upstream/installed/x64-linux/debug/lib/pkgconfig/../../lib;-llcms2;-lm;-pthread;-lz;-ljasperd;-ljpeg
	Line 1618: PC_LIBRAW_STATIC_LDFLAGS_OTHER:INTERNAL=-pthread

The find module for libraw uses pkgconfig so that's where the CFLAGS values are arriving from. Its own pkconfig file did not have -pthread in it, but it did reference lcms. Then I looked at the pkgconfig from lcms.

prefix=${pcfiledir}/../..
includedir=${prefix}/include
libdir=${prefix}/lib

Name: lcms2
Description: LCMS Color Management Library
Version: 2.16

Libs: "-L${libdir}" -llcms2 -lm -pthread
Cflags: "-I${includedir}" -pthread

So it is the problem here. So in these cases do we remove the -pthread from Cflags? I can open up a patch on the lcms repo with a suggested fix for this.

@dg0yt
Copy link
Contributor

dg0yt commented Nov 20, 2024

-pthread in the pc files is not the problem. But maybe it is used wrongly (for definitions, prepending -D).

@donny-dont donny-dont force-pushed the lcms-2.16 branch 6 times, most recently from 8d5d92d to 71395b3 Compare November 25, 2024 23:09
@donny-dont
Copy link
Contributor Author

Okay @dg0yt I think this is ready for review. The x64-linux triplet build passed in CI and for me locally.

@donny-dont
Copy link
Contributor Author

There appears to have been an issue with Python when the checks ran. Can we rerun @dg0yt @MonicaLiu0311 ? The last run was fine.

@dg0yt
Copy link
Contributor

dg0yt commented Nov 27, 2024

You can add an empty commit (git commit --allow-empty -m CI and push) to run CI again.

@donny-dont
Copy link
Contributor Author

Ok all the checks are 🟢 ! This ready to go @dg0yt ?

@dg0yt
Copy link
Contributor

dg0yt commented Nov 30, 2024

LGTM. (Omitting nitpicks.)
But somebody else must approve.

@MonicaLiu0311
Copy link
Contributor

Feature fastfloat is tested successfully in the following triplet:

x64-windows
x64-windows-static

Features threaded,tools are tested successfully in the following triplet:

x86-windows
x64-windows
x64-windows-static

@BillyONeal BillyONeal marked this pull request as draft December 2, 2024 23:03
@donny-dont donny-dont marked this pull request as ready for review December 2, 2024 23:49
@MonicaLiu0311 MonicaLiu0311 removed the info:reviewed Pull Request changes follow basic guidelines label Dec 3, 2024
lgritz pushed a commit to AcademySoftwareFoundation/OpenImageIO that referenced this pull request Dec 4, 2024
When using pkgconfig the value of `<NAME>_CFLAGS_OTHER` can contain
compiler flags along with preprocessor definitions. If there is a
compiler flag and its passed to `target_compile_definitions` then it
will be treated as if it is a preprocessor definition.

Found a case where a statically compiled LibRaw with a statically
compiled Little-CMS caused `LibRaw_DEFINITIONS` to have `-pthread` in
its listing which was passed to the compiler as a definition,
`-D-pthread`. This caused a build failure with `auto-moc`.

Add an additional parameter for the `add_oiio_plugin` macro to take
`COMPILE_OPTIONS` and pass those to `target_compile_options` which can
differentiate between compiler flags and preprocessor definitions. Pass
`LibRaw_DEFINITIONS` to the CMake macro to prevent the above error.

Issue found while updating Little-CMS in
microsoft/vcpkg#42187 and the change fixes the
build issue found there. This is an attempt to upstream it so the issue
is fixed.

Signed-off-by: Don Olmstead <don.j.olmstead@gmail.com>
@donny-dont
Copy link
Contributor Author

Ok I split the change to openimageio off into #42532 . This contains the patch to make it so lcms will build properly with these changes. It was landed in openimageio's repository.

@MonicaLiu0311 MonicaLiu0311 added the info:reviewed Pull Request changes follow basic guidelines label Dec 5, 2024
@MonicaLiu0311
Copy link
Contributor

The change has been accepted upstream, but no new version has been released, so it can be temporarily accepted as a patch until the next version appears.

@donny-dont
Copy link
Contributor Author

The change has been accepted upstream, but no new version has been released, so it can be temporarily accepted as a patch until the next version appears.

👋 @MonicaLiu0311 because this PR wasn’t moving and there was a newer version of openimageio I moved those changes to #42532 . If you want to merge that first I’m happy to rebase this PR after it lands.

@MonicaLiu0311
Copy link
Contributor

v3.0.1.0 was released 3 days ago, and OpenImageIO/pull/4556 was merged yesterday. Has it been included in the latest version?

@MonicaLiu0311 MonicaLiu0311 removed the info:reviewed Pull Request changes follow basic guidelines label Dec 5, 2024
@MonicaLiu0311 MonicaLiu0311 marked this pull request as draft December 6, 2024 08:47
@donny-dont donny-dont force-pushed the lcms-2.16 branch 2 times, most recently from f647ca8 to a21a758 Compare December 6, 2024 20:33
Use the meson build. Remove obsolete patches and CMake build.
@donny-dont donny-dont marked this pull request as ready for review December 6, 2024 21:48
@donny-dont
Copy link
Contributor Author

Alrighty this is rebased now that the changes to openimageio landed in 53a53a3 and ready to land

lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Dec 9, 2024
…mySoftwareFoundation#4556)

When using pkgconfig the value of `<NAME>_CFLAGS_OTHER` can contain
compiler flags along with preprocessor definitions. If there is a
compiler flag and its passed to `target_compile_definitions` then it
will be treated as if it is a preprocessor definition.

Found a case where a statically compiled LibRaw with a statically
compiled Little-CMS caused `LibRaw_DEFINITIONS` to have `-pthread` in
its listing which was passed to the compiler as a definition,
`-D-pthread`. This caused a build failure with `auto-moc`.

Add an additional parameter for the `add_oiio_plugin` macro to take
`COMPILE_OPTIONS` and pass those to `target_compile_options` which can
differentiate between compiler flags and preprocessor definitions. Pass
`LibRaw_DEFINITIONS` to the CMake macro to prevent the above error.

Issue found while updating Little-CMS in
microsoft/vcpkg#42187 and the change fixes the
build issue found there. This is an attempt to upstream it so the issue
is fixed.

Signed-off-by: Don Olmstead <don.j.olmstead@gmail.com>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Dec 9, 2024
…mySoftwareFoundation#4556)

When using pkgconfig the value of `<NAME>_CFLAGS_OTHER` can contain
compiler flags along with preprocessor definitions. If there is a
compiler flag and its passed to `target_compile_definitions` then it
will be treated as if it is a preprocessor definition.

Found a case where a statically compiled LibRaw with a statically
compiled Little-CMS caused `LibRaw_DEFINITIONS` to have `-pthread` in
its listing which was passed to the compiler as a definition,
`-D-pthread`. This caused a build failure with `auto-moc`.

Add an additional parameter for the `add_oiio_plugin` macro to take
`COMPILE_OPTIONS` and pass those to `target_compile_options` which can
differentiate between compiler flags and preprocessor definitions. Pass
`LibRaw_DEFINITIONS` to the CMake macro to prevent the above error.

Issue found while updating Little-CMS in
microsoft/vcpkg#42187 and the change fixes the
build issue found there. This is an attempt to upstream it so the issue
is fixed.

Signed-off-by: Don Olmstead <don.j.olmstead@gmail.com>
@MonicaLiu0311 MonicaLiu0311 added the info:reviewed Pull Request changes follow basic guidelines label Dec 9, 2024
@BillyONeal BillyONeal merged commit 4fbfcff into microsoft:master Dec 9, 2024
17 checks passed
@BillyONeal
Copy link
Member

Thank you!

@donny-dont donny-dont deleted the lcms-2.16 branch December 9, 2024 19:16
@donny-dont
Copy link
Contributor Author

Thank you for all the assistance with it!

lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Dec 16, 2024
…mySoftwareFoundation#4556)

When using pkgconfig the value of `<NAME>_CFLAGS_OTHER` can contain
compiler flags along with preprocessor definitions. If there is a
compiler flag and its passed to `target_compile_definitions` then it
will be treated as if it is a preprocessor definition.

Found a case where a statically compiled LibRaw with a statically
compiled Little-CMS caused `LibRaw_DEFINITIONS` to have `-pthread` in
its listing which was passed to the compiler as a definition,
`-D-pthread`. This caused a build failure with `auto-moc`.

Add an additional parameter for the `add_oiio_plugin` macro to take
`COMPILE_OPTIONS` and pass those to `target_compile_options` which can
differentiate between compiler flags and preprocessor definitions. Pass
`LibRaw_DEFINITIONS` to the CMake macro to prevent the above error.

Issue found while updating Little-CMS in
microsoft/vcpkg#42187 and the change fixes the
build issue found there. This is an attempt to upstream it so the issue
is fixed.

Signed-off-by: Don Olmstead <don.j.olmstead@gmail.com>
@luzpaz luzpaz mentioned this pull request Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-update The issue is with a library, which is requesting update new revision info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants