asmuth / clip

Create charts from the command line
https://clip-lang.org
Apache License 2.0
5.15k stars 387 forks source link

Build Failure with Apple Clang 10 #270

Closed ankane closed 4 years ago

ankane commented 4 years ago

Hi, I'm hoping to add clip to Homebrew for Mac, but clip fails to build on High Sierra (Apple Clang 10). Relevant logs:

In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/api.cc:15:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/environment.h:18:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_description.h:19:
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:40:8: error: no template named 'optional' in namespace 'std'
  std::optional<uint32_t> zindex;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:42:8: error: no template named 'optional' in namespace 'std'
  std::optional<mat3> transform;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:48:8: error: no template named 'optional' in namespace 'std'
  std::optional<Color> fill_color;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:49:8: error: no template named 'optional' in namespace 'std'
  std::optional<uint32_t> zindex;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:51:8: error: no template named 'optional' in namespace 'std'
  std::optional<AntialiasingMode> antialiasing_mode;
  ~~~~~^
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/api.cc:15:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/environment.h:18:
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_description.h:41:8: error: no template named 'optional' in namespace 'std'
  std::optional<uint32_t> zindex;
  ~~~~~^
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/api.cc:15:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/environment.h:23:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element_factory.h:18:
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.h:44:20: error: no template named 'optional' in namespace 'std'
        const std::optional<double> max_width,
              ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.h:45:20: error: no template named 'optional' in namespace 'std'
        const std::optional<double> max_height,
              ~~~~~^
[  8%] Building CXX object CMakeFiles/clip.dir/core/element.cc.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++   -I/usr/local/include/cairo -I/usr/local/include/freetype2 -I/usr/local/Cellar/harfbuzz/2.6.5_1/include/harfbuzz -I/usr/include} -I/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core -I/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/utils -I/tmp/clip-20200512-2952-1jfy49v/clip-0.5  -DNDEBUG -fPIC   -std=gnu++17 -o CMakeFiles/clip.dir/core/element.cc.o -c /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.cc
8 errors generated.
make[2]: *** [CMakeFiles/clip.dir/core/api.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.cc:14:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.h:19:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_description.h:19:
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:40:8: error: no template named 'optional' in namespace 'std'
  std::optional<uint32_t> zindex;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:42:8: error: no template named 'optional' in namespace 'std'
  std::optional<mat3> transform;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:48:8: error: no template named 'optional' in namespace 'std'
  std::optional<Color> fill_color;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:49:8: error: no template named 'optional' in namespace 'std'
  std::optional<uint32_t> zindex;
  ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_elements.h:51:8: error: no template named 'optional' in namespace 'std'
  std::optional<AntialiasingMode> antialiasing_mode;
  ~~~~~^
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.cc:14:
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.h:19:
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/graphics/page_description.h:41:8: error: no template named 'optional' in namespace 'std'
  std::optional<uint32_t> zindex;
  ~~~~~^
In file included from /tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.cc:14:
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.h:44:20: error: no template named 'optional' in namespace 'std'
        const std::optional<double> max_width,
              ~~~~~^
/tmp/clip-20200512-2952-1jfy49v/clip-0.5/core/element.h:45:20: error: no template named 'optional' in namespace 'std'
        const std::optional<double> max_height,
              ~~~~~^
8 errors generated.
make[2]: *** [CMakeFiles/clip.dir/core/element.cc.o] Error 1
make[1]: *** [CMakeFiles/clip.dir/all] Error 2
make: *** [all] Error 2

Full logs: https://github.com/Homebrew/homebrew-core/pull/54612/checks?check_run_id=665937993 Reference: https://github.com/Homebrew/homebrew-core/pull/54612

asmuth commented 4 years ago

Thanks for reaching about about this and sorry that it took me so long to reply. It would be brilliant to have a homebrew recipe for clip!

The macOS 10.13 build should be fixed in clip v0.7 (tagged). With any luck this will also fix the homebrew build: https://travis-ci.org/github/asmuth/clip/builds/686998011

Still, at this point, clip is not completely stable just yet, which is why I have been a bit hesitant to put a proper release up. I just hope nobody will be disappointed in case there are more minor but breaking changes. Although the 0.x version number probably implies that is a possibility.

At any rate, the interface to the plotting parts should not change much anymore, at least not in backwards incompatible ways, and I'm currently working on fixing up and extending the documentation, so hopefully the usability will improve quickly.

ankane commented 4 years ago

Thanks @asmuth, looks like that fixed it!

fwiw, I think most developers expect some breaking changes before 1.0. I typically use minor releases for breaking changes before 1.0 and patch releases for non-breaking.

ankane commented 4 years ago

clip is now on Homebrew 🎉 Mac users can do:

brew install clip

To install clip and all of its dependencies.