Vcpkg: [alembic] build failure on macOS (and possibly Linux)

Created on 5 Sep 2020  ·  24Comments  ·  Source: microsoft/vcpkg

This is broken again now. For two reasons. One is upstream and has been reported (another -werror one). It's fixed but the fix is not in a tagged Alembic release (yet).

In the meantime the reason that the port is broken on macOS (and presumably Linux) is that this line was added to the top of profile.cmake:

vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "OSX" "Linux")

I guess this should be

vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP")

as Alembic builds fine on macOS and Linux.

CONTROL also has a Supports: line added that lists Windows as the only supported platform but it seems this isn't relevant for the build to succeed.

port-feature

Most helpful comment

@NancyLi1013 Here is a diff that works for me on macOS and should fix the commit that broke the port as well as reference the latest version of Alembic (1.7.15), released yesterday. You should test on Linux & Windows.

diff --git a/ports/alembic/CONTROL b/ports/alembic/CONTROL
index e58acda67..840a08d46 100644
--- a/ports/alembic/CONTROL
+++ b/ports/alembic/CONTROL
@@ -1,7 +1,7 @@
 Source: alembic
-Version: 1.7.13
+Version: 1.7.15
 Port-Version: 1
 Build-Depends: ilmbase, hdf5
 Description: Alembic is an open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications.
 Homepage: https://alembic.io/
-Supports: windows & !arm & !uwp & !static
+Supports: windows | osx | linux & !arm & !uwp & !static
diff --git a/ports/alembic/portfile.cmake b/ports/alembic/portfile.cmake
index 6c9a2b57d..80dcbcd85 100644
--- a/ports/alembic/portfile.cmake
+++ b/ports/alembic/portfile.cmake
@@ -1,4 +1,4 @@
-vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "OSX" "Linux")
+vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP")

 vcpkg_buildpath_length_warning(37)

@@ -7,8 +7,8 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
 vcpkg_from_github(
     OUT_SOURCE_PATH SOURCE_PATH
     REPO alembic/alembic
-    REF cfe114639ef7ad084d61e71ab86a17e708d838ae  #v1.7.13
-    SHA512 38b797c1179e759870f10afc4a2182bc3e874eacecc9627c879d3a5cf35e49c83cae80600678427e5c22d6576d0e6280ce3cf0a2ac505f1df74ec4a8bdb083b5
+    REF a3ad9600f5b5299dffda3d285aeab89023d2d801 #v1.7.15
+    SHA512 db2b08c2c0426735498225e100c77871273dbf508f3791405a7fe7923714dcb708dcfbf336ae2a0419c10cac9707ccac575f9767e9396d35abcfd90c9b2b3184
     HEAD_REF master
     PATCHES
         fix-find-openexr-ilmbase.patch
(END)

All 24 comments

The upstream fixed version can be tested if the vcpkg_from_github in profile.cmake is temporarily set to:

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO lamiller0/alembic
    HEAD_REF fuzzer_fixes_leak_and_bad_index
    PATCHES
        fix-find-openexr-ilmbase.patch
)

Are we STILL having issues building alembic project?
Just downloaded master branch and no issues at all!

image

What platform are you on? Build fails for me immediately on macOS because of said line in the profile.cmake. When I comment the line out the build starts but eventually fails because of the -werror issue.

❯ vcpkg install alembic
Computing installation plan...
The following packages will be built and installed:
    alembic[core]:x64-osx
Detecting compiler hash for triplet x64-osx...
Starting package 1/1: alembic:x64-osx
Building package alembic[core]:x64-osx...
Could not locate cached archive: /Users/moritz/.cache/vcpkg/archives/23/2365d01b0f771470dddeb6c40ac70652fecdd325.zip
CMake Error at scripts/cmake/vcpkg_fail_port_install.cmake:93 (message):
  Target 'OSX' not supported by alembic!

Call Stack (most recent call first):
  ports/alembic/portfile.cmake:1 (vcpkg_fail_port_install)
  scripts/ports.cmake:79 (include)

Error: Building package alembic:x64-osx failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: alembic:x64-osx
  Vcpkg version: 2020.06.15-unknownhash

If you visit that issue you see that some compilers do not emit a warning for an unused variable which means no error which means the build succeeds.
But only on some platform(s) with some compilers.

On that note. These changes were added to those port files three days ago. The previous Alembic vcpkg breakage was purely upstream. This one is 50/50.
So you do not have issues still. You have issues again. Beers.

Hi @virtualritz
Thanks for posting this issue.
I noticed the issue that you reported to upstream. It would be better to wait for the reply from upstream before we do next action to this port. What do you think?

No, I would do the fixes asap since some compilers do not issue a warning for an unused variable and the build is not broken everywhere thus.

You can also test the fixes on all platforms by temporarily poining to the other repo as I outlined in my 2nd post on this ticket.

@virtualritz Have you contacted us before regarding issues with this same port (as they call it)?

These changes were added to those port files three days ago.

Are you able to track down when those changes were added or committed and by whom?

Have you contacted us before regarding issues with this same port (as they call it)?

@sfhacker Yes.

Are you able to track down when those changes were added or committed and by whom?

Yes.

Upstream issue got closed.

@NancyLi1013 Here is a diff that works for me on macOS and should fix the commit that broke the port as well as reference the latest version of Alembic (1.7.15), released yesterday. You should test on Linux & Windows.

diff --git a/ports/alembic/CONTROL b/ports/alembic/CONTROL
index e58acda67..840a08d46 100644
--- a/ports/alembic/CONTROL
+++ b/ports/alembic/CONTROL
@@ -1,7 +1,7 @@
 Source: alembic
-Version: 1.7.13
+Version: 1.7.15
 Port-Version: 1
 Build-Depends: ilmbase, hdf5
 Description: Alembic is an open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications.
 Homepage: https://alembic.io/
-Supports: windows & !arm & !uwp & !static
+Supports: windows | osx | linux & !arm & !uwp & !static
diff --git a/ports/alembic/portfile.cmake b/ports/alembic/portfile.cmake
index 6c9a2b57d..80dcbcd85 100644
--- a/ports/alembic/portfile.cmake
+++ b/ports/alembic/portfile.cmake
@@ -1,4 +1,4 @@
-vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "OSX" "Linux")
+vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP")

 vcpkg_buildpath_length_warning(37)

@@ -7,8 +7,8 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
 vcpkg_from_github(
     OUT_SOURCE_PATH SOURCE_PATH
     REPO alembic/alembic
-    REF cfe114639ef7ad084d61e71ab86a17e708d838ae  #v1.7.13
-    SHA512 38b797c1179e759870f10afc4a2182bc3e874eacecc9627c879d3a5cf35e49c83cae80600678427e5c22d6576d0e6280ce3cf0a2ac505f1df74ec4a8bdb083b5
+    REF a3ad9600f5b5299dffda3d285aeab89023d2d801 #v1.7.15
+    SHA512 db2b08c2c0426735498225e100c77871273dbf508f3791405a7fe7923714dcb708dcfbf336ae2a0419c10cac9707ccac575f9767e9396d35abcfd90c9b2b3184
     HEAD_REF master
     PATCHES
         fix-find-openexr-ilmbase.patch
(END)

@virtualritz
Thanks for your above information and also for moving this issue forward.
In fact, I have tested the latest version 1.7.15 two days ago and it can be built successfully on Windows and failed on linux and osx.

On Linux:

/home/user/vcpkg/buildtrees/alembic/src/9023d2d801-71fc0d388b.clean/lib/Alembic/AbcGeom/ICamera.h: In copy constructor ‘Alembic::AbcGeom::v12::ICameraSchema::ICameraSchema(const Alembic::AbcGeom::v12::ICameraSchema&)’:
/home/user/vcpkg/buildtrees/alembic/src/9023d2d801-71fc0d388b.clean/lib/Alembic/AbcGeom/ICamera.h:101:17: error: implicitly-declared ‘Alembic::AbcGeom::v12::ICameraSchema& Alembic::AbcGeom::v12::ICameraSchema::operator=(const Alembic::AbcGeom::v12::ICameraSchema&)’ is deprecated [-Werror=deprecated-copy]
  101 |         *this = iCopy;
      |                 ^~~~~
/home/user/vcpkg/buildtrees/alembic/src/9023d2d801-71fc0d388b.clean/lib/Alembic/AbcGeom/ICamera.h:98:5: note: because ‘Alembic::AbcGeom::v12::ICameraSchema’ has user-provided ‘Alembic::AbcGeom::v12::ICameraSchema::ICameraSchema(const Alembic::AbcGeom::v12::ICameraSchema&)’
   98 |     ICameraSchema(const ICameraSchema& iCopy)
      |     ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

On macOS:

 /Users/vcpkg/Nancy/vcpkg/buildtrees/alembic/src/9023d2d801-71fc0d388b.clean/lib/Alembic/AbcCoreHDF5/Tests/TimeSamplingTests.cpp:46:10: fatal error: 'hdf5    .h' file not found
159 #include <hdf5.h>
160          ^~~~~~~~
161 1 error generated.

Seems to be further fix.

@NancyLi1013

Did you build the tagged 1.7.15 or the latest master of Alembic after the tag? Because there were more fixes and it's not a problem using one of those commits as REF in the portfile.cmake (that's what my patch is already doing, in fact).

Please confirm which REF you used from the Alembic repo. to build on Linux so I can report upstream.

The macOS issue is a missing/not found HDF5 dependency. I do not see this on my machine on macOS but I do have HDF5 installed by other means than vcpkg. Which would indicate that somehow the Build-Depends: ilmbase, hdf5 in CONTROL doesn't do the right thing.

Thanks for your investigation about this issue.

I used the same REFwith you.

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO alembic/alembic
    REF a3ad9600f5b5299dffda3d285aeab89023d2d801
    SHA512 db2b08c2c0426735498225e100c77871273dbf508f3791405a7fe7923714dcb708dcfbf336ae2a0419c10cac9707ccac575f9767e9396d35abcfd90c9b2b3184
    HEAD_REF master
    PATCHES
        fix-find-openexr-ilmbase.patch
)

For macOS issue, we might need to check how hdf5is used in alembic. In fact, we prefer to recommend to use the port that provided in vcpkg.

@NancyLi1013
HDF5 is an _optional_ dependency of Alembic and its use is _discouraged_ since years as the Ogawa backend has better performance (see e.g. here or here).

So while this doesn't solve the HDF5 breakage you see on macOS I would consider this a minor issue that may never come up with anyone using the port in a contemporary setting.

So I suggest this which will at least make the port work in the default configuration:

Source: alembic
Version: 1.7.15
Port-Version: 1
Build-Depends: ilmbase
Description: Alembic is an open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications.
Homepage: https://alembic.io/
Supports: windows | osx | linux & !arm & !uwp & !static

Feature: boost
Description: Boost support
Build-Depends: boost

Feature: hdf5
Description: HDF5 backend
Build-Depends: hdf5

Feature: zlib
Description: zlib support
Build-Depends: zlib

@virtualritz
Thanks again for your help.

I will check this later and also update the comment.

@NancyLi1013, is there anything you're missing to fix this now?

Hi @virtualritz
Sorry for the long delay. I am busy on other work these days. I rebuild this on my Linux machine just now and it failed with the same error as before:

/home/user/vcpkg/buildtrees/alembic/src/9023d2d801-71fc0d388b/lib/Alembic/AbcGeom/ICamera.h:101:17: error: implicitly-declared ‘Alembic::AbcGeom::v12::ICameraSchema& Alembic::AbcGeom::v12::ICameraSchema::operator=(const Alembic::AbcGeom::v12::ICameraSchema&)’ is deprecated [-Werror=deprecated-copy]
  101 |         *this = iCopy;
      |                 ^~~~~
/home/user/vcpkg/buildtrees/alembic/src/9023d2d801-71fc0d388b/lib/Alembic/AbcGeom/ICamera.h:98:5: note: because ‘Alembic::AbcGeom::v12::ICameraSchema’ has user-provided ‘Alembic::AbcGeom::v12::ICameraSchema::ICameraSchema(const Alembic::AbcGeom::v12::ICameraSchema&)’
   98 |     ICameraSchema(const ICameraSchema& iCopy)
      |     ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

For the issue on macOS, I cannot build this now since there is something wrong with our machine. So I cannot investigate this issue now.

@NancyLi1013 Three people gave you more than enough help to solve this. Please refer to the ticket on the Alembic tracker re. compiler versions.
If you can't solve this yourself still maybe ask @JonLiu1993 to assign someone else to this issue?

@virtualritz
Sorry for my above comment. I just tested this issue again yesterday on a clean environment (Ubuntu 18.04.1 with gcc 9.2.1 ) to make sure if this is a bug only for me. I am focus on other work these days and I didn't check the ticket carefully reported on upstream. So I can understand your above comments.

I'm so sorry about this.
After removing -Werror from CMakeLists.txt, I can build this port successfully on my local now.
https://github.com/alembic/alembic/blob/master/CMakeLists.txt#L141

For macOS issue, I have noticed that you remove hdf5from dependency lists and add it as a feature for alembic. I think there is no this problem now. Just mentioned, I have no OSX device to test this issue these days since our OSX devices are all updating .

I will try to submit a PR to update alembic to the latest version to fix this issue.

Since HDF5is an optional dependency of Alembic, it is suitable to remove it from required dependency lists.
But even if we add it as a feature, we also need to make sure it can work fine.

In my opinion, there is no need to add this feature if no user is required.
We can consider to add it back until it can work fine.

After removing -Werror from CMakeLists.txt, I can build this port successfully on my local now.

@NancyLi1013 Removing -werror from the build is not a fix for the issue you are seeing. -werror is a quality measurement. I predict that a PR to Alembic that asks to remove -werror will be rejected. I already suggested this to them for non-testing release builds and they didn't even reply.
You were asked there what compiler are you using.
The author stated he built w/o issues using gcc4.8, gcc6.3, and llvm10 on Linux. I suggest going back to that issue. There is a reason this issue was closed.

I have noticed that you remove hdf5 from dependency lists and add it as a feature for alembic. I think there is no this problem now.

What problem is there with HDF5?

Thanks for your instant reply. I arm also trying to go further investigation about this issue on Linux. I will update my compiler information on upstream.

What problem is there with HDF5?

This is error on macOS I tested before:

 /Users/vcpkg/Nancy/vcpkg/buildtrees/alembic/src/9023d2d801-71fc0d388b.clean/lib/Alembic/AbcCoreHDF5/Tests/TimeSamplingTests.cpp:46:10: fatal error: 'hdf5    .h' file not found
159 #include <hdf5.h>
160          ^~~~~~~~
161 1 error generated.

As I said above, we have no osx device to test any issues now.

This just means the build can't find HDF5. If HDF5 was installed as a dependency you need to make a patch that helps the build script find where vcpkg installed HDF5. That's one of the usual tasks that come with maintaining a port.

As I said above, we have no osx device to test any issues now.
This is 2020. GitHub gives you options to test on an macOS machine in the cloud.

All this is very obvious. From your replies I can't help but think that you are in a bit above your level with this task. You may not notice it but all my last replies are suggesting to you what to do next. You should know this yourself. I don't mean this in any way offensive. But it is ok to say: "This is too difficult for me."

They do their best, but they are learning as they go!
You should read some other posts or issues!
We have had no issues building alembic from source using GCC. (See screenshot above)

Anyway, let' see what the future brings.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oahzuw picture oahzuw  ·  3Comments

cskrisz picture cskrisz  ·  3Comments

ThinkalVB picture ThinkalVB  ·  3Comments

ghost picture ghost  ·  3Comments

jack17529 picture jack17529  ·  3Comments