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

0.9.0 fails to build on NetBSD #105

Closed
0323pin opened this issue Aug 23, 2022 · 10 comments
Closed

0.9.0 fails to build on NetBSD #105

0323pin opened this issue Aug 23, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@0323pin
Copy link

0323pin commented Aug 23, 2022

Hi,
I've just downgraded git-cliff on NetBSD to 0.8.1, given that 0.9.0 fails to build with the following error,
http://www.ki.nu/pkgsrc/reports/current/NetBSD-9.0/20220819.2338/git-cliff-0.9.0/build.log

The log link is from a NetBSD-9.0 x86_64 build server using rust-1.60 but, I can reproduce it on my own machine running NetBSD-9.99.99 (development branch) x86_64 using rust-1.62.1

Now, this is not really a git-cliff issue, most probably a libgit2 issue. Are you aware of what could be the cause of it? Any pointers?
Thanks.

@0323pin 0323pin added the bug Something isn't working label Aug 23, 2022
@0323pin
Copy link
Author

0323pin commented Sep 8, 2022

Something is weird with this. I can build libgit2-sys-0.14.0+1.5.0 just fine as a dependency of nushell-0.68.0 but not as dependency of git-cliff 😮

@orhun
Copy link
Owner

orhun commented Sep 8, 2022

Hey, thanks for reporting this!

Now, this is not really a git-cliff issue, most probably a libgit2 issue.

Yeah, looks like it.

Something is weird with this. I can build libgit2-sys-0.14.0+1.5.0 just fine as a dependency of nushell-0.68.0 but not as dependency of git-cliff

Weird. Is there a way that you can provide for reproducing this?

@0323pin
Copy link
Author

0323pin commented Sep 8, 2022

@orhun Hmm ... I don't know of any way to reproduce it, other than building these inside pkgsrc. That said, pkgsrc can be bootstrapped on Linux.

Did you change any calls going from v0.8.1 to v0.9.0?
Maybe it's trying to build libgit2 instead of linking against the existing system lib? Static vs dynamic linking?

@0323pin
Copy link
Author

0323pin commented Sep 11, 2022

I don't get it anymore. Installed libgit2, added it as a dependency to package build.
Told the compiler where to find it with

RUSTFLAGS+=	-C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.libgit2}/lib
RUSTFLAGS+=	-C link-arg=-L${BUILDLINK_PREFIX.libgit2}/lib

But, I still get

warning: In file included from libgit2/src/util/hash/builtin.h:13,
warning:                  from libgit2/src/util/hash/sha.h:37,
warning:                  from libgit2/src/util/hash.h:13,
warning:                  from libgit2/src/util/futils.h:17,
warning:                  from libgit2/src/libgit2/apply.c:17:
warning: libgit2/src/util/hash/rfc6234/sha.h:304:12: error: conflicting types for 'hmac'
warning:   304 | extern int hmac(SHAversion whichSha, /* which SHA algorithm to use */
warning:       |            ^~~~
warning: In file included from /usr/pkgsrc/wip/git-cliff/work/.buildlink/include/git2/common.h:11,
warning:                  from /usr/pkgsrc/wip/git-cliff/work/.buildlink/include/git2/apply.h:10,
warning:                  from libgit2/src/libgit2/apply.c:8:
warning: /usr/include/stdlib.h:315:10: note: previous declaration of 'hmac' was here
warning:   315 | ssize_t  hmac(const char *, const void *, size_t, const void *, size_t, void *,
warning:       |          ^~~~
warning: In file included from libgit2/src/util/hash/builtin.h:13,
warning:                  from libgit2/src/util/hash/sha.h:37,
warning:                  from libgit2/src/util/hash.h:13,
warning:                  from libgit2/src/util/futils.h:17,
warning:                  from libgit2/src/libgit2/attr_file.h:17,
warning:                  from libgit2/src/libgit2/attr.h:12,
warning:                  from libgit2/src/libgit2/attr.c:8:
warning: libgit2/src/util/hash/rfc6234/sha.h:304:12: error: conflicting types for 'hmac'
warning:   304 | extern int hmac(SHAversion whichSha, /* which SHA algorithm to use */
warning:       |            ^~~~
warning: In file included from /usr/pkgsrc/wip/git-cliff/work/.buildlink/include/git2/common.h:11,
warning:                  from libgit2/src/util/git2_util.h:14,
warning:                  from libgit2/src/libgit2/common.h:10,
warning:                  from libgit2/src/libgit2/attr.h:10,
warning:                  from libgit2/src/libgit2/attr.c:8:
warning: /usr/include/stdlib.h:315:10: note: previous declaration of 'hmac' was here
warning:   315 | ssize_t  hmac(const char *, const void *, size_t, const void *, size_t, void *,
warning:       |          ^~~~

error: failed to run custom build command for `libgit2-sys v0.14.0+1.5.0`

Caused by:
  process didn't exit successfully: `/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-b48180aea4195b1e/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBGIT2_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=LIBGIT2_STATIC
  cargo:rerun-if-env-changed=LIBGIT2_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rustc-cfg=libgit2_vendored
  libgit2/include/git2/annotated_commit.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/annotated_commit.h
  libgit2/include/git2/apply.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/apply.h
  libgit2/include/git2/attr.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/attr.h
  libgit2/include/git2/blame.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/blame.h
  libgit2/include/git2/blob.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/blob.h
  libgit2/include/git2/branch.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/branch.h
  libgit2/include/git2/buffer.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/buffer.h
  libgit2/include/git2/cert.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/cert.h
  libgit2/include/git2/checkout.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/checkout.h
  libgit2/include/git2/cherrypick.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/cherrypick.h
  libgit2/include/git2/clone.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/clone.h
  libgit2/include/git2/commit.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/commit.h
  libgit2/include/git2/common.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/common.h
  libgit2/include/git2/config.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/config.h
  libgit2/include/git2/cred_helpers.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/cred_helpers.h
  libgit2/include/git2/credential.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/credential.h
  libgit2/include/git2/credential_helpers.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/credential_helpers.h
  libgit2/include/git2/deprecated.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/deprecated.h
  libgit2/include/git2/describe.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/describe.h
  libgit2/include/git2/diff.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/diff.h
  libgit2/include/git2/email.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/email.h
  libgit2/include/git2/errors.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/errors.h
  libgit2/include/git2/filter.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/filter.h
  libgit2/include/git2/global.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/global.h
  libgit2/include/git2/graph.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/graph.h
  libgit2/include/git2/ignore.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/ignore.h
  libgit2/include/git2/index.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/index.h
  libgit2/include/git2/indexer.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/indexer.h
  libgit2/include/git2/mailmap.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/mailmap.h
  libgit2/include/git2/merge.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/merge.h
  libgit2/include/git2/message.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/message.h
  libgit2/include/git2/net.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/net.h
  libgit2/include/git2/notes.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/notes.h
  libgit2/include/git2/object.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/object.h
  libgit2/include/git2/odb.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/odb.h
  libgit2/include/git2/odb_backend.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/odb_backend.h
  libgit2/include/git2/oid.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/oid.h
  libgit2/include/git2/oidarray.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/oidarray.h
  libgit2/include/git2/pack.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/pack.h
  libgit2/include/git2/patch.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/patch.h
  libgit2/include/git2/pathspec.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/pathspec.h
  libgit2/include/git2/proxy.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/proxy.h
  libgit2/include/git2/rebase.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/rebase.h
  libgit2/include/git2/refdb.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/refdb.h
  libgit2/include/git2/reflog.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/reflog.h
  libgit2/include/git2/refs.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/refs.h
  libgit2/include/git2/refspec.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/refspec.h
  libgit2/include/git2/remote.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/remote.h
  libgit2/include/git2/repository.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/repository.h
  libgit2/include/git2/reset.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/reset.h
  libgit2/include/git2/revert.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/revert.h
  libgit2/include/git2/stash.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/stash.h
  libgit2/include/git2/revparse.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/revparse.h
  libgit2/include/git2/revwalk.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/revwalk.h
  libgit2/include/git2/signature.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/signature.h
  libgit2/include/git2/status.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/status.h
  libgit2/include/git2/stdint.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/stdint.h
  libgit2/include/git2/strarray.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/strarray.h
  libgit2/include/git2/submodule.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/submodule.h
  libgit2/include/git2/sys/alloc.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/alloc.h
  libgit2/include/git2/sys/commit.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/commit.h
  libgit2/include/git2/sys/commit_graph.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/commit_graph.h
  libgit2/include/git2/sys/config.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/config.h
  libgit2/include/git2/sys/cred.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/cred.h
  libgit2/include/git2/sys/credential.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/credential.h
  libgit2/include/git2/sys/diff.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/diff.h
  libgit2/include/git2/sys/email.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/email.h
  libgit2/include/git2/sys/filter.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/filter.h
  libgit2/include/git2/sys/hashsig.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/hashsig.h
  libgit2/include/git2/sys/index.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/index.h
  libgit2/include/git2/sys/mempack.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/mempack.h
  libgit2/include/git2/sys/merge.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/merge.h
  libgit2/include/git2/sys/midx.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/midx.h
  libgit2/include/git2/sys/odb_backend.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/odb_backend.h
  libgit2/include/git2/sys/openssl.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/openssl.h
  libgit2/include/git2/sys/path.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/path.h
  libgit2/include/git2/sys/refdb_backend.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/refdb_backend.h
  libgit2/include/git2/sys/reflog.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/reflog.h
  libgit2/include/git2/sys/refs.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/refs.h
  libgit2/include/git2/sys/remote.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/remote.h
  libgit2/include/git2/sys/repository.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/repository.h
  libgit2/include/git2/sys/stream.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/stream.h
  libgit2/include/git2/sys/transport.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/sys/transport.h
  libgit2/include/git2/tag.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/tag.h
  libgit2/include/git2/trace.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/trace.h
  libgit2/include/git2/transaction.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/transaction.h
  libgit2/include/git2/transport.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/transport.h
  libgit2/include/git2/tree.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/tree.h
  libgit2/include/git2/types.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/types.h
  libgit2/include/git2/version.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/version.h
  libgit2/include/git2/worktree.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2/worktree.h
  libgit2/include/git2.h => /usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include/git2.h
  TARGET = Some("x86_64-unknown-netbsd")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-netbsd")
  CC_x86_64-unknown-netbsd = None
  CC_x86_64_unknown_netbsd = None
  HOST_CC = None
  CC = Some("cc")
  CFLAGS_x86_64-unknown-netbsd = None
  CFLAGS_x86_64_unknown_netbsd = None
  HOST_CFLAGS = None
  CFLAGS = Some("-pipe -O2 -fPIC -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/include")
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-pipe" "-O2" "-fPIC" "-D_FORTIFY_SOURCE=2" "-I/usr/pkg/include" "-I/usr/include" "-I" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include" "-I" "libgit2/src/libgit2" "-I" "libgit2/src/util" "-I" "libgit2/deps/http-parser" "-I" "libgit2/deps/pcre" "-fvisibility=hidden" "-DGIT_REGEX_BUILTIN=1" "-DHAVE_STDINT_H=1" "-DHAVE_MEMMOVE=1" "-DNO_RECURSE=1" "-DNEWLINE=10" "-DPOSIX_MALLOC_THRESHOLD=10" "-DLINK_SIZE=2" "-DPARENS_NEST_LIMIT=250" "-DMATCH_LIMIT=10000000" "-DMATCH_LIMIT_RECURSION=MATCH_LIMIT" "-DMAX_NAME_SIZE=32" "-DMAX_NAME_COUNT=10000" "-DSHA1DC_NO_STANDARD_INCLUDES=1" "-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\"" "-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\"" "-o" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/build/libgit2/src/libgit2/annotated_commit.o" "-c" "libgit2/src/libgit2/annotated_commit.c"
  exit status: 0
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-pipe" "-O2" "-fPIC" "-D_FORTIFY_SOURCE=2" "-I/usr/pkg/include" "-I/usr/include" "-I" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include" "-I" "libgit2/src/libgit2" "-I" "libgit2/src/util" "-I" "libgit2/deps/http-parser" "-I" "libgit2/deps/pcre" "-fvisibility=hidden" "-DGIT_REGEX_BUILTIN=1" "-DHAVE_STDINT_H=1" "-DHAVE_MEMMOVE=1" "-DNO_RECURSE=1" "-DNEWLINE=10" "-DPOSIX_MALLOC_THRESHOLD=10" "-DLINK_SIZE=2" "-DPARENS_NEST_LIMIT=250" "-DMATCH_LIMIT=10000000" "-DMATCH_LIMIT_RECURSION=MATCH_LIMIT" "-DMAX_NAME_SIZE=32" "-DMAX_NAME_COUNT=10000" "-DSHA1DC_NO_STANDARD_INCLUDES=1" "-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\"" "-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\"" "-o" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/build/libgit2/src/libgit2/apply.o" "-c" "libgit2/src/libgit2/apply.c"
  cargo:warning=In file included from libgit2/src/util/hash/builtin.h:13,
  cargo:warning=                 from libgit2/src/util/hash/sha.h:37,
  cargo:warning=                 from libgit2/src/util/hash.h:13,
  cargo:warning=                 from libgit2/src/util/futils.h:17,
  cargo:warning=                 from libgit2/src/libgit2/apply.c:17:
  cargo:warning=libgit2/src/util/hash/rfc6234/sha.h:304:12: error: conflicting types for 'hmac'
  cargo:warning=  304 | extern int hmac(SHAversion whichSha, /* which SHA algorithm to use */
  cargo:warning=      |            ^~~~
  cargo:warning=In file included from /usr/pkgsrc/wip/git-cliff/work/.buildlink/include/git2/common.h:11,
  cargo:warning=                 from /usr/pkgsrc/wip/git-cliff/work/.buildlink/include/git2/apply.h:10,
  cargo:warning=                 from libgit2/src/libgit2/apply.c:8:
  cargo:warning=/usr/include/stdlib.h:315:10: note: previous declaration of 'hmac' was here
  cargo:warning=  315 | ssize_t  hmac(const char *, const void *, size_t, const void *, size_t, void *,
  cargo:warning=      |          ^~~~
  exit status: 1
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-pipe" "-O2" "-fPIC" "-D_FORTIFY_SOURCE=2" "-I/usr/pkg/include" "-I/usr/include" "-I" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include" "-I" "libgit2/src/libgit2" "-I" "libgit2/src/util" "-I" "libgit2/deps/http-parser" "-I" "libgit2/deps/pcre" "-fvisibility=hidden" "-DGIT_REGEX_BUILTIN=1" "-DHAVE_STDINT_H=1" "-DHAVE_MEMMOVE=1" "-DNO_RECURSE=1" "-DNEWLINE=10" "-DPOSIX_MALLOC_THRESHOLD=10" "-DLINK_SIZE=2" "-DPARENS_NEST_LIMIT=250" "-DMATCH_LIMIT=10000000" "-DMATCH_LIMIT_RECURSION=MATCH_LIMIT" "-DMAX_NAME_SIZE=32" "-DMAX_NAME_COUNT=10000" "-DSHA1DC_NO_STANDARD_INCLUDES=1" "-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\"" "-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\"" "-o" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/build/libgit2/src/libgit2/attr.o" "-c" "libgit2/src/libgit2/attr.c"
  cargo:warning=In file included from libgit2/src/util/hash/builtin.h:13,
  cargo:warning=                 from libgit2/src/util/hash/sha.h:37,
  cargo:warning=                 from libgit2/src/util/hash.h:13,
  cargo:warning=                 from libgit2/src/util/futils.h:17,
  cargo:warning=                 from libgit2/src/libgit2/attr_file.h:17,
  cargo:warning=                 from libgit2/src/libgit2/attr.h:12,
  cargo:warning=                 from libgit2/src/libgit2/attr.c:8:
  cargo:warning=libgit2/src/util/hash/rfc6234/sha.h:304:12: error: conflicting types for 'hmac'
  cargo:warning=  304 | extern int hmac(SHAversion whichSha, /* which SHA algorithm to use */
  cargo:warning=      |            ^~~~
  cargo:warning=In file included from /usr/pkgsrc/wip/git-cliff/work/.buildlink/include/git2/common.h:11,
  cargo:warning=                 from libgit2/src/util/git2_util.h:14,
  cargo:warning=                 from libgit2/src/libgit2/common.h:10,
  cargo:warning=                 from libgit2/src/libgit2/attr.h:10,
  cargo:warning=                 from libgit2/src/libgit2/attr.c:8:
  cargo:warning=/usr/include/stdlib.h:315:10: note: previous declaration of 'hmac' was here
  cargo:warning=  315 | ssize_t  hmac(const char *, const void *, size_t, const void *, size_t, void *,
  cargo:warning=      |          ^~~~
  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-pipe" "-O2" "-fPIC" "-D_FORTIFY_SOURCE=2" "-I/usr/pkg/include" "-I/usr/include" "-I" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/include" "-I" "libgit2/src/libgit2" "-I" "libgit2/src/util" "-I" "libgit2/deps/http-parser" "-I" "libgit2/deps/pcre" "-fvisibility=hidden" "-DGIT_REGEX_BUILTIN=1" "-DHAVE_STDINT_H=1" "-DHAVE_MEMMOVE=1" "-DNO_RECURSE=1" "-DNEWLINE=10" "-DPOSIX_MALLOC_THRESHOLD=10" "-DLINK_SIZE=2" "-DPARENS_NEST_LIMIT=250" "-DMATCH_LIMIT=10000000" "-DMATCH_LIMIT_RECURSION=MATCH_LIMIT" "-DMAX_NAME_SIZE=32" "-DMAX_NAME_COUNT=10000" "-DSHA1DC_NO_STANDARD_INCLUDES=1" "-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\"" "-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\"" "-o" "/usr/pkgsrc/wip/git-cliff/work/git-cliff-0.9.0/target/release/build/libgit2-sys-de2a738d5e1a3bb3/out/build/libgit2/src/libgit2/apply.o" "-c" "libgit2/src/libgit2/apply.c" with args "cc" did not execute successfully (status code exit status: 1).

Why is it still trying to build the built-in libgit2?

@0323pin
Copy link
Author

0323pin commented Sep 12, 2022

Added the following compiler flags,

RUSTFLAGS+=	-C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.libgit2}/include
RUSTFLAGS+=	-C link-arg=-L${BUILDLINK_PREFIX.libgit2}/include

Still the same :(

@0323pin
Copy link
Author

0323pin commented Sep 13, 2022

@orhun I've just built libgit2-sys inside pkgsrc as a standlone package, it builds just fine

===> Installing dependencies for git2-rs-libgit2-sys-0.14.0+1.5.0
==========================================================================
The following variables will affect the build process of this package,
git2-rs-libgit2-sys-0.14.0+1.5.0.  Their current value is shown below:

        * SSLBASE = /usr
        * SSLCERTBUNDLE (not defined)
        * SSLCERTS = /etc/openssl/certs
        * SSLDIR = /etc/openssl
        * SSLKEYS = /etc/openssl/private

You may want to abort the process now with CTRL-C and change the value
of variables in the first group before continuing.  Be sure to run
`/usr/pkg/bin/bmake clean' after the changes.
==========================================================================
=> Tool dependency mktools-[0-9]*: found mktools-20220614
=> Tool dependency pkgconf-[0-9]*: found pkgconf-1.8.0
=> Tool dependency cwrappers>=20150314: found cwrappers-20220403
=> Tool dependency checkperms>=1.1: found checkperms-1.12
=> Build dependency cmake-[0-9]*: found cmake-3.23.2nb1
=> Build dependency rust>=1.60.0nb1: found rust-1.63.0
=> Full dependency libgit2>=1.5: found libgit2-1.5.0
===> Skipping vulnerability checks.
WARNING: No /usr/pkg/pkgdb/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities'.
===> Overriding tools for git2-rs-libgit2-sys-0.14.0+1.5.0
===> Extracting for git2-rs-libgit2-sys-0.14.0+1.5.0
=> Extracting local cargo crates
===> Patching for git2-rs-libgit2-sys-0.14.0+1.5.0
===> Creating toolchain wrappers for git2-rs-libgit2-sys-0.14.0+1.5.0
===> Configuring for git2-rs-libgit2-sys-0.14.0+1.5.0
=> Checking for portability problems in extracted files
===> Building for git2-rs-libgit2-sys-0.14.0+1.5.0
   Compiling libc v0.2.132
   Compiling pkg-config v0.3.25
   Compiling autocfg v1.1.0
   Compiling tinyvec_macros v0.1.0
   Compiling log v0.4.17
   Compiling percent-encoding v2.2.0
   Compiling unicode-bidi v0.3.8
   Compiling cfg-if v1.0.0
   Compiling openssl-probe v0.1.5
   Compiling bitflags v1.3.2
   Compiling tinyvec v1.6.0
   Compiling form_urlencoded v1.1.0
   Compiling jobserver v0.1.24
   Compiling cc v1.0.73
   Compiling unicode-normalization v0.1.21
   Compiling idna v0.3.0
   Compiling openssl-sys v0.9.75
   Compiling libz-sys v1.1.8
   Compiling libssh2-sys v0.2.23
   Compiling libgit2-sys v0.14.0+1.5.0 (/usr/pkgsrc/wip/libgit2-sys/work/git2-rs-libgit2-sys-0.14.0-1.5.0/libgit2-sys)
   Compiling url v2.3.1
   Compiling git2 v0.15.0 (/usr/pkgsrc/wip/libgit2-sys/work/git2-rs-libgit2-sys-0.14.0-1.5.0)
    Finished release [optimized] target(s) in 43.17s

git-cliff still fails :(

Any clues on this, error: conflicting types for 'hmac'?

Looks like the something is reusing "hmac" as the function name in conflict with what the NetBSD base system has in its headers.

@orhun
Copy link
Owner

orhun commented Sep 13, 2022

It looks like a git2-rs issue more than a git-cliff issue. I'm not directly using hmac or anything else so I suggest reporting this issue to git2-rs.

@0323pin
Copy link
Author

0323pin commented Sep 13, 2022

@orhun Done! Still feels a bit fishy.

@0323pin
Copy link
Author

0323pin commented Sep 17, 2022

@orhun All good, issue solved. It turns out, it need linking against openssl.

@he32
Copy link

he32 commented Jan 24, 2023

Any clues on this, error: conflicting types for 'hmac'?

The hmac() function declaration is in NetBSD's <stdlib.h> under the _NETBSD_SOURCE conditional.

The <sys/featuretst.h> header (included from <stdlib.h>) defines _NETBSD_SOURCE unless either of _ANSI_SOURCE, _POSIX_C_SOURCE (or _POSIX_SOURCE) or _XOPEN_SOURCE are defined, so pretty much _NETBSD_SOURCE is the default.

The problem with the hmac name is that it's far too tempting to use by other software for their own purposes, as is evident in this case, where another package defines it as a function with a different calling signature, which leads to this error. Evidently Linux doesn't have hmac() in it's <stdlib.h>, otherwise this problem would be fixed already...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants