Bug 247100 - archivers/zstd: Use meson, fix "make test" and other minor fixes
Summary: archivers/zstd: Use meson, fix "make test" and other minor fixes
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-08 22:56 UTC by Daniel Engberg
Modified: 2020-08-19 16:29 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
Patch for zstd (3.43 KB, patch)
2020-06-08 22:56 UTC, Daniel Engberg
no flags Details | Diff
Patch for zstd v2 (3.99 KB, patch)
2020-07-31 07:34 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2020-06-08 22:56:09 UTC
Created attachment 215381 [details]
Patch for zstd

Convert to using meson build system
Add toggle to select optimization instead of hardcoding -O3 (see note #1)
Now defaults to optimization set by ports framework (see note #2)
Fix tests, (see note #3)

Note #1:
O2 actually is slightly faster (~1-2%) on my amd64 and aarch64 systems, tested using fullbench in tests builddir)
Note #2:
Valgrind only works on i386 and amd64, it fails instantly on amd64 -HEAD so I'm assuming it's broken. As far as I can tell the old test target didn't it use either so I don't think we're missing out on anything compared to earlier
Note #3:
On slow hardware a few tests might trigger timeout with default upstream settings.
Test #1 and #8 does on my aarch64 SBC RockPro64 (RK3399)

Tested on: 
FreeBSD 13.0-CURRENT r361421 amd64 (make test and fullbench)
FreeBSD 13.0-CURRENT r361660 aarch64 (make test and fullbench)
Poudriere testport OK 12.1-RELEASE (amd64)
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2020-06-20 10:39:08 UTC
Friendly ping,

I made a small typo in first section slightly too, it should be #1, #1, #2,.

Best regards,
Daniel
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2020-07-17 09:01:33 UTC
@sunpoet

Can you have a look at this?
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-07-30 11:20:39 UTC
Hmm, I don't know what's the benefit of using meson over make.
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2020-07-31 07:34:17 UTC
Created attachment 216901 [details]
Patch for zstd v2

Use release archive
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2020-07-31 07:36:05 UTC
Hi,

A few things I think is worth mentioning is that integrates "better" with the ports framework, it's more clear about what it actually does and compiles quite a bit faster at least on my box.

(g)make:
==> building with threading support
==> building zstd with .gz compression support
==> building zstd with .xz/.lzma compression support
==> building zstd with .lz4 compression support

meson:
The Meson build system
Version: 0.54.3
Source dir: /usr/ports/archivers/zstd/work/zstd-1.4.5/build/meson
Build dir: /usr/ports/archivers/zstd/work/zstd-1.4.5/build/meson/_build
Build type: native build
Project name: zstd
Project version: DUMMY
Using 'CC' from environment with value: 'cc'
Using 'CFLAGS' from environment with value: '-O2 -pipe -march=ivybridge  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing '
Using 'LDFLAGS' from environment with value: ' -fstack-protector-strong -L/usr/local/lib '
Using 'CPPFLAGS' from environment with value: '-isystem /usr/local/include'
Using 'CXX' from environment with value: 'c++'
Using 'CXXFLAGS' from environment with value: '-O2 -pipe -march=ivybridge -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include '
Using 'LDFLAGS' from environment with value: ' -fstack-protector-strong -L/usr/local/lib '
Using 'CPPFLAGS' from environment with value: '-isystem /usr/local/include'
Using 'CC' from environment with value: 'cc'
Using 'CFLAGS' from environment with value: '-O2 -pipe -march=ivybridge  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing '
Using 'LDFLAGS' from environment with value: ' -fstack-protector-strong -L/usr/local/lib '
Using 'CPPFLAGS' from environment with value: '-isystem /usr/local/include'
C compiler for the host machine: cc (clang 10.0.1 "FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-rc1-0-gf79cd71e145)")
C linker for the host machine: cc ld.lld 10.0.1
Using 'CXX' from environment with value: 'c++'
Using 'CXXFLAGS' from environment with value: '-O2 -pipe -march=ivybridge -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include '
Using 'LDFLAGS' from environment with value: ' -fstack-protector-strong -L/usr/local/lib '
Using 'CPPFLAGS' from environment with value: '-isystem /usr/local/include'
C++ compiler for the host machine: c++ (clang 10.0.1 "FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-rc1-0-gf79cd71e145)")
C++ linker for the host machine: c++ ld.lld 10.0.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/usr/local/bin/python3.7)
Message: Project version is now: 1.4.5
Library m found: YES
Run-time dependency threads found: YES
Using 'PKG_CONFIG' from environment with value: 'pkgconf'
Found pkg-config: /usr/local/bin/pkgconf (1.7.3)
Run-time dependency zlib found: YES 1.2.11
Run-time dependency liblzma found: YES 5.2.5
Run-time dependency liblz4 found: YES 1.9.2
Compiler for C supports arguments -Wextra: YES
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wcast-align: YES
Compiler for C supports arguments -Wcast-qual: YES
Compiler for C supports arguments -Wconversion: YES
Compiler for C supports arguments -Wno-sign-conversion: YES
Compiler for C supports arguments -Wdocumentation: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C++ supports arguments -Wextra: YES
Compiler for C++ supports arguments -Wundef: YES
Compiler for C++ supports arguments -Wshadow: YES
Compiler for C++ supports arguments -Wcast-align: YES
Compiler for C++ supports arguments -Wcast-qual: YES
Compiler for C++ supports arguments -Wconversion: YES
Compiler for C++ supports arguments -Wno-sign-conversion: YES
Compiler for C++ supports arguments -Wdocumentation: YES
meson.build:118: WARNING: Consider using the built-in warning_level option instead of using "-Wextra".
meson.build:119: WARNING: Consider using the built-in warning_level option instead of using "-Wextra".
Message: Enable legacy support back to version 0.5
Message: Enable multi-threading support
Program ../InstallSymlink.py found: YES (/usr/local/bin/python3.7 /usr/ports/archivers/zstd/work/zstd-1.4.5/build/meson/programs/../InstallSymlink.py)
Build targets in project: 4

(make)

(g)make:
        1m43.99s real           1m44.49s user           1.05s sys
meson:
	16.30s real             56.62s user             1.29s sys

Best regards,
Daniel
Comment 6 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-08-19 16:28:02 UTC
Committed. Thanks!
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-08-19 16:29:01 UTC
A commit references this bug:

Author: sunpoet
Date: Wed Aug 19 16:26:39 UTC 2020
New revision: 545439
URL: https://svnweb.freebsd.org/changeset/ports/545439

Log:
  Change build system from gmake to meson

  - Use upstream release tarball
  - Add OPTIMIZED_CFLAGS and TEST options
  - Remove valgrind test
  - Bump PORTREVISION for package change

  PR:		247100
  Submitted by:	Daniel Engberg <daniel.engberg.lists@pyret.net>

Changes:
  head/archivers/zstd/Makefile
  head/archivers/zstd/distinfo
  head/archivers/zstd/files/
  head/archivers/zstd/files/patch-tests-meson.build
  head/archivers/zstd/pkg-plist