Mk/Uses/cargo.mk: Encode more crate build dependencies
ClosedPublic

Authored by tobik on May 17 2018, 2:44 PM.

Details

Summary
  • Add a DEV_WARNING when using libc versions < 0.2.40 to prevent ino64 related issues on 12.0-CURRENT.

Adding @pizzamig for textproc/bat related changes

CC @jbeich because of rP468993

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tobik created this revision.May 17 2018, 2:44 PM
tobik updated this revision to Diff 42663.May 17 2018, 3:00 PM
  • Also sort cargo-crates-licenses output
pizzamig added inline comments.May 17 2018, 3:22 PM
Mk/Uses/cargo.mk
145 ↗(On Diff #42662)

I've looked at the onig crate code, and I guess

CARGO_ENV+= RUSTONIG_DYNAMIC_LIBONIG=1

should be more appropriate, but I can be wrong.

textproc/bat/Makefile
119 ↗(On Diff #42662)

bat has no features defined
This line generates a warning, because git2 is a required dependency.
Please remove it.

tobik updated this revision to Diff 42665.May 17 2018, 3:34 PM
  • Remove git2 "feature" from bat. Not really sure why I added this.
tobik marked an inline comment as done.May 17 2018, 3:43 PM
tobik added inline comments.
Mk/Uses/cargo.mk
145 ↗(On Diff #42662)

Hmm, not sure. The onig_sys build script is like this:

https://github.com/rust-onig/rust-onig/blob/v3.2.2/onig_sys/build.rs#L126

So I don't think RUSTONIG_DYNAMIC_LIBONIG would ever be used when it can find oniguruma >= 6.8.0 on the system.

With RUSTONIG_SYSTEM_LIBONIG bat definitely links with libonig.so:

[111amd64-default-job-03] Installing bat-0.3.0_1...
===========================================================================
=>> Checking shared library dependencies
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x0000000000000001 NEEDED               Shared library: [libgcc_s.so.1]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libonig.so.5]
 0x0000000000000001 NEEDED               Shared library: [libthr.so.3]
 0x0000000000000001 NEEDED               Shared library: [libz.so.6]

Maybe both should be defined?

pizzamig added inline comments.May 17 2018, 4:16 PM
Mk/Uses/cargo.mk
145 ↗(On Diff #42662)

IMHO, neither are currently strictly needed, but probably you're right and RUSTONIG_SYSTEM_LIBONIG is the way to go, to be on the safe side.

I've tested onig-sys with zero, one or both variables and the result was always the same, because the system library is preferred, if found, and the static library, that would be the default, is missing from devel/oniguruma, so the dynamic one is used.

pizzamig accepted this revision.May 17 2018, 4:16 PM
tobik updated this revision to Diff 42666.May 17 2018, 4:17 PM
  • Fix libc version range
tobik updated this revision to Diff 42667.May 17 2018, 4:28 PM
tobik marked an inline comment as done.
  • Add comment about RUSTONIG_SYSTEM_LIBONIG
tobik added inline comments.May 17 2018, 4:30 PM
Mk/Uses/cargo.mk
145 ↗(On Diff #42662)

Thanks. I've added a comment to cargo.mk about this.

pizzamig accepted this revision.May 17 2018, 4:34 PM
0mp added a subscriber: 0mp.May 17 2018, 5:22 PM
mat added inline comments.May 18 2018, 1:20 PM
Mk/Uses/cargo.mk
132–134 ↗(On Diff #42667)

Mmm, the two :M are not the same, if there is a libc.0.1.something, it won't show up in the warning.

CC @0mp because libc warning affects games/genact.

Mk/Uses/cargo.mk
133 ↗(On Diff #42667)

"issues" are mainly crashes but if not they'd be hard to detect. libc crate "supports" 64-bit inodes and absolute kevent(2) timeouts since 0.2.38. rP468993 simply standardized on the latest version to facilitate debugging and pick up other FreeBSD fixes.

134 ↗(On Diff #42667)

12.0-CURRENT will be obsolete in half a year and contributor may confuse libc with base system package. See also existing DEV_WARNING style under Mk/. Maybe try:

.if ${CARGO_CRATES:Mlibc-[0-9]*}
# FreeBSD 12.0 changed ABI: r318736 and r320043
# https://github.com/rust-lang/libc/commit/78f93220d70e
# https://github.com/rust-lang/libc/commit/969ad2b73cdc
_libc_VER=	${CARGO_CRATES:Mlibc-[0-9]*:C/.*-//}
. if ${_libc_VER:R:R} == 0 && (${_libc_VER:R:E} < 2 || ${_libc_VER:R:E} == 2 && ${_libc_VER:E} < 38)
DEV_WARNING+=	"CARGO_CRATES=libc-0.2.37 or older maybe unstable on FreeBSD 12.0. Consider updating to the latest version."
. endif
.undef _libc_VER
.endif
mmokhi added a subscriber: mmokhi.May 18 2018, 7:05 PM
tobik updated this revision to Diff 42713.May 18 2018, 7:46 PM
tobik marked 2 inline comments as done.
  • Update libc warning to @jbeich's version
tobik marked 4 inline comments as done.May 18 2018, 7:48 PM
pizzamig accepted this revision.Wed, May 23, 1:16 PM
tobik updated this revision to Diff 43450.Fri, Jun 8, 10:59 AM
  • Add gettext-sys crate
tobik updated this revision to Diff 43462.Fri, Jun 8, 4:04 PM
  • Add thrussh-libsodium crate
tobik updated this revision to Diff 43704.Wed, Jun 13, 12:23 PM
This revision was not accepted when it landed; it landed in state Needs Review.Thu, Jun 14, 9:56 AM
This revision was automatically updated to reflect the committed changes.