8000 macOS build failure: no `endian.h` found · Issue #4299 · varnishcache/varnish-cache · GitHub
[go: up one dir, main page]

Skip to content
macOS build failure: no endian.h found #4299
@botantony

Description

@botantony

Expected Behavior

I expect to compile program

Current Behavior

Build fails with this error:

    CC       libvarnish_la-vsb.lo
    CC       libvarnish_la-vsha256.lo
    CC       libvarnish_la-vss.lo
    CC       libvarnish_la-vsub.lo
  vsha256.c:35:12: fatal error: 'endian.h' file not found
     35 | #  include <endian.h>
        |            ^~~~~~~~~~
  1 error generated.
  make[2]: *** [libvarnish_la-vsha256.lo] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [install-recursive] Error 1
  make: *** [install-recursive] Error 1

Possible Solution

In file vsha256.c you use #ifndef __DARWIN_BYTE_ORDER, which suppose to prevent this error. __DARWIN_BYTE_ORDER is not a defined macro in Xcode Clang. You can try __APPLE__ macro instead

Steps to Reproduce (for bugs)

Build steps (from tarball):

$ ./autogen.sh # I tried w/ and w/o, got same result
$ ./configure --localstatedir=/opt/homebrew/var --disable-debug --disable-dependency-tracking --prefix=/opt/homebrew/Cellar/varnish/7.7.0 --libdir=/opt/homebrew/Cellar/varnish/7.7.0/lib
$ make install CFLAGS=-DVARNISH_VMOD_DIR='"/opt/homebrew/lib/varnish/vmods"' -DVARNISH_VCL_DIR='"/opt/homebrew/etc/varnish:/opt/homebrew/share/varnish/vcl"'

Context

I contibute to Homebrew package manager, the recent update failed CI.
Related PR: Homebrew/homebrew-core#211340

Varnish Cache version

7.7.0

Operating system

macOS Sonoma

Source of binary packages used (if any)

https://varnish-cache.org/_downloads/varnish-7.7.0.tgz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0