Skip to content

Commit

Permalink
25704171 Ship the meson build system with Solaris
Browse files Browse the repository at this point in the history
PSARC/2019/079 Meson build system
  • Loading branch information
alanc authored and vlmarek committed Sep 21, 2019
1 parent 8986816 commit d9d8dfb
Show file tree
Hide file tree
Showing 24 changed files with 1,814 additions and 4 deletions.
Expand Up @@ -20,7 +20,7 @@
#

#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
#

set name=pkg.fmri \
Expand All @@ -41,6 +41,7 @@ depend type=group fmri=developer/build/automake
depend type=group fmri=developer/build/gnu-make
depend type=group fmri=developer/build/libtool
depend type=group fmri=developer/build/make
depend type=group fmri=developer/build/meson
depend type=group fmri=developer/build/pkg-config
depend type=group fmri=developer/debug/gdb
depend type=group fmri=developer/gcc
Expand Down
80 changes: 80 additions & 0 deletions components/python/meson/Makefile
@@ -0,0 +1,80 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
#

BUILD_BITS= 64
COMPILER= gcc

include ../../../make-rules/shared-macros.mk

COMPONENT_NAME= meson
COMPONENT_VERSION= 0.51.2
COMPONENT_PROJECT_URL= http://mesonbuild.com/
COMPONENT_ARCHIVE_HASH= \
sha256:23688f0fc90be623d98e80e1defeea92bbb7103bf9336a5f5b9865d36e892d76
COMPONENT_ARCHIVE_URL= https://github.com/mesonbuild/meson/releases/download/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
COMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).asc

COMPONENT_BUGDB= utility/meson
COMPONENT_ANITYA_ID= 6472

TPNO= 53918

# As of 0.51.0, meson requires Python 3.5 or newer, and we only need
# to build for a single version, not all of them.
PYTHON_VERSIONS= $(PYTHON_VERSION)

BUILD_STYLE= setup.py
include $(WS_MAKE_RULES)/common.mk

# Assumes GNU msgfmt is first in PATH
PYTHON_ENV += PATH="$(GCC_ROOT)/bin:$(GNUBIN):$(USRBINDIR64):$(USRBINDIR):$(SPRO_VROOT)/bin"

COMPONENT_PRE_INSTALL_ACTION += \
$(RM) -r $(PROTOUSRSHAREDIR) ;

COMPONENT_POST_INSTALL_ACTION += \
$(MV) $(PROTO_DIR)$(PYTHON_DATA)/share $(PROTOUSRSHAREDIR) ;

COMPONENT_TEST_DIR= $(COMPONENT_SRC)
COMPONENT_TEST_CMD= ./run_tests.py
COMPONENT_TEST_ARGS=
COMPONENT_TEST_MASTER= $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master

# Test transforms retain only reproducible summaries of results output.
COMPONENT_TEST_TRANSFORMS += \
'-n ' \
'-e "/Total .* time/d" ' \
'-e "s/[0-9][0-9\.]* s//" ' \
'-e "/Total/p" ' \
'-e "/^test/p" ' \
'-e "/PASS/p" ' \
'-e "/FAIL/p" ' \
'-e "/ERROR/p" '

PKG_MACROS += PYVER=$(PYTHON_VERSION)

# Ninja is needed at runtime, including when running tests, but not to build
REQUIRED_PACKAGES += developer/build/ninja

83 changes: 83 additions & 0 deletions components/python/meson/TESTING
@@ -0,0 +1,83 @@
'gmake test' runs the full test suite.

To run individual unit test cases:
python3.7 meson-0.51.2/run_unittests.py -k <test>

For example, to run the test_flock unit test:
python3.7 meson-0.51.2/run_unittests.py -k test_flock

For other test cases, cd to the test case directory and run:
env PKG_CONFIG_PATH=/usr/lib/64/pkgconfig python3 \
../../../meson.py builddir
cd builddir
ninja
ninja test

Known, unfixed issues:

======================================================================
FAIL: test_flock (__main__.AllPlatformTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "run_unittests.py", line 2825, in test_flock
self.assertTrue(exception_raised, 'Double locking did not raise exception.')
AssertionError: False is not true : Double locking did not raise exception.

-- This appears to be because the test tries to lock the file twice
in the same process, but the fcntl calls underlying Python's fcntl.flock()
only lock out other processes, and allow a single process to get additional
locks on the same file. Perhaps we need to find a way to fork a second
process for this test?

Reported upstream as https://github.com/mesonbuild/meson/issues/5903

======================================================================
FAIL: test_installed_modes (__main__.LinuxlikeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "run_unittests.py", line 4579, in test_installed_modes
self.assertEqual(want_mode, found_mode[1:])
AssertionError: 'rw------T' != 'rw-------'
- rw------T
? ^
+ rw-------
? ^

FAIL: test_installed_modes_extended (__main__.LinuxlikeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "run_unittests.py", line 4654, in test_installed_modes_extended
(fsobj, want_mode, found_mode)))
AssertionError: '-r--r--r-T' != '-r--r--r--'
- -r--r--r-T
? ^
+ -r--r--r--
? ^
: Expected file include/rootdir.h to have mode -r--r--r-T but found -r--r--r-- instead.

-- These appear to be because Solaris chmod(2) has an additional restriction:
If the process is not a privileged process and the file is not a direc-
tory, mode bit 01000 (S_ISVTX, the sticky bit) is cleared.

Reported upstream as https://github.com/mesonbuild/meson/issues/5902

======================================================================
[4/6] Linking target libsample.so.
FAILED: libsample.so
/usr/gcc/9/bin/gcc -o libsample.so 'sample@sha/meson-sample.c.o' -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,libsample.so -m64 -O3 samelibname/libsample.so /usr/lib/amd64/libgobject-2.0.so /usr/lib/amd64/libglib-2.0.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/samelibname'
ld: fatal: recording name conflict: file 'samelibname/libsample.so' and soname option (-h, -soname) provide identical dependency names: libsample.so
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

-- This fails because it attempts to perform the illogical operation of
creating a shared object that depends on a shared object of the same
name, which makes no sense with our dynamic linker.

Reported upstream as https://github.com/mesonbuild/meson/issues/5915


======================================================================
meson.build:19:2: ERROR: Dependency "python3" not found, tried pkgconfig

-- This is due to a python packaging bug in Userland on Solaris:
Bug 30277203 - python3.pc is missing due to incorrect mediation
30 changes: 30 additions & 0 deletions components/python/meson/generate/meson.generate
@@ -0,0 +1,30 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
#

<transform dir file link hardlink -> edit path "/python3.7/" "/python$!(PYVER)/">
<transform dir file link hardlink -> edit path "\$!\((.*)\)" "$(\1)">

<transform dir file link hardlink -> edit path "-py3.7.egg-" "-py$!(PYVER).egg-">
<transform dir file link hardlink -> edit path "\$!\((.*)\)" "$(\1)">

<transform file path=.*/mesonbuild/rewriter.py -> add pkg.depend.bypass-generate ".*">
169 changes: 169 additions & 0 deletions components/python/meson/meson.p5m
@@ -0,0 +1,169 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
#


<transform file path=usr.*/man/.+ -> default mangler.man.stability "pass-through volatile">


set name=pkg.fmri \
value=pkg:/developer/build/meson@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="Meson Build System"
set name=pkg.depend.runpath \
value=/usr/lib/python$(PYVER)/vendor-packages/mesonbuild:$PKGDEPEND_RUNPATH
set name=com.oracle.info.description \
value="Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible."
set name=com.oracle.info.tpno value=$(TPNO)
set name=info.classification \
value="org.opensolaris.category.2008:Development/Distribution Tools"
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=org.opensolaris.arc-caseid value=PSARC/2019/079
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)


file path=usr/bin/meson
file path=usr/lib/python$(PYVER)/vendor-packages/meson-$(COMPONENT_VERSION)-py$(PYVER).egg-info/PKG-INFO
file path=usr/lib/python$(PYVER)/vendor-packages/meson-$(COMPONENT_VERSION)-py$(PYVER).egg-info/SOURCES.txt
file path=usr/lib/python$(PYVER)/vendor-packages/meson-$(COMPONENT_VERSION)-py$(PYVER).egg-info/dependency_links.txt
file path=usr/lib/python$(PYVER)/vendor-packages/meson-$(COMPONENT_VERSION)-py$(PYVER).egg-info/entry_points.txt
file path=usr/lib/python$(PYVER)/vendor-packages/meson-$(COMPONENT_VERSION)-py$(PYVER).egg-info/top_level.txt
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/ast/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/ast/interpreter.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/ast/introspection.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/ast/postprocess.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/ast/printer.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/ast/visitor.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/backends.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/ninjabackend.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/vs2010backend.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/vs2015backend.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/vs2017backend.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/vs2019backend.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/backend/xcodebackend.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/build.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/cmake/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/cmake/client.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/cmake/common.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/cmake/interpreter.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/c.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/c_function_attributes.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/clike.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/compilers.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/cpp.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/cs.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/cuda.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/d.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/fortran.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/java.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/objc.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/objcpp.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/rust.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/swift.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/compilers/vala.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/coredata.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/base.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/boost.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/data/CMakeLists.txt
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/data/CMakeListsLLVM.txt
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/data/CMakePathInfo.txt
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/dev.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/misc.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/platform.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/dependencies/ui.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/envconfig.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/environment.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/interpreter.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/interpreterbase.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/linkers.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/mconf.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/mesonlib.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/mesonmain.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/minit.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/minstall.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/mintro.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/mlog.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/cmake.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/dlang.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/gnome.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/hotdoc.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/i18n.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/modtest.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/pkgconfig.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/python.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/python3.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/qt.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/qt4.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/qt5.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/rpm.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/sourceset.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/unstable_cuda.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/unstable_icestorm.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/unstable_kconfig.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/unstable_simd.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/modules/windows.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/mparser.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/msetup.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/msubprojects.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/mtest.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/munstable_coredata.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/optinterpreter.py
# .* bypass-generate needed due to issue with __main__.
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/rewriter.py \
pkg.depend.bypass-generate=.*
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/clangformat.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/cleantrees.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/commandrunner.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/coverage.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/delwithsuffix.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/depfixer.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/dirchanger.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/dist.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/gettext.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/gtkdochelper.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/hotdochelper.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/meson_exe.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/msgfmthelper.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/regen_checker.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/scanbuild.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/symbolextractor.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/uninstall.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/vcstagger.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/scripts/yelphelper.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/wrap/__init__.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/wrap/wrap.py
file path=usr/lib/python$(PYVER)/vendor-packages/mesonbuild/wrap/wraptool.py
file path=usr/share/man/man1/meson.1
file path=usr/share/polkit-1/actions/com.mesonbuild.install.policy


license COPYING license=Apache
# Meson generates ninja files and then runs ninja to do the actual build
depend type=require fmri=pkg:/developer/build/ninja

0 comments on commit d9d8dfb

Please sign in to comment.