Bug 267265 - www/onlyoffice-documentserver cannot build. AttributeError: module 'build' has no attribute 'make'
Summary: www/onlyoffice-documentserver cannot build. AttributeError: module 'build' ha...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Mikael Urankar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-22 03:05 UTC by Jon Theil Nielsen
Modified: 2023-03-28 16:53 UTC (History)
2 users (show)

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


Attachments
build_fail.txt (506.82 KB, text/plain)
2022-10-22 23:34 UTC, Jon Theil Nielsen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Theil Nielsen 2022-10-22 03:05:17 UTC
I cannot build onlyoffice-documentserver from ports.

I get this error:

----
[2933/2933] STAMP obj/gn_all.stamp
Traceback (most recent call last):
  File "/usr/ports/www/onlyoffice-documentserver/work/DocumentServer-7.1.1/build_tools/./make.py", line 89, in <module>
    build.make()
AttributeError: module 'build' has no attribute 'make'
Error (./make.py): 1
*** Error code 1

Stop.
make: stopped in /usr/ports/www/onlyoffice-documentserver
----

This is true for version 7.1.1.23_1 but also for the previous two or three versions.
Comment 1 Mikael Urankar freebsd_committer freebsd_triage 2022-10-22 16:39:51 UTC
Do you have a full build log?
Comment 2 Jon Theil Nielsen 2022-10-22 23:34:05 UTC
Created attachment 237545 [details]
build_fail.txt

This should be the complete build log.

#cd /usr/ports/www/onlyoffice-documentserver
#make build
Comment 3 Mikael Urankar freebsd_committer freebsd_triage 2022-10-23 11:34:40 UTC
What's your FreeBSD version and python version? Do you have something special in your env, onlyoffice builds fine in a clean environment.
Comment 4 Jon Theil Nielsen 2022-10-23 19:48:10 UTC
The version is 13.1-RELEASE-p2 FreeBSD 13.1-RELEASE-p2 GENERIC amd64
My python version is python39-3.9.15

I have installed some python libraries by using (as root) by

#pip install --user python-library-name

I don't use py-virtualenv

I know it is not recommended to install python libraries as root. But it has worked well for me like that for quite a long time. Maybe the problems started after upgrading python system-wide.

If this problem is related to my python installations and environment, I would appreciate some advice on how to fix it
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2022-10-24 06:57:49 UTC
(In reply to Jon Theil Nielsen from comment #4)
It'll be hard to debug this issue without access to your computer and I don't know how to troubleshoot this python error.
You can try to follow this doc https://bobbyhadz.com/blog/python-attributeerror-module-has-no-attribute
Comment 6 andros.ua 2023-03-23 18:52:17 UTC
I've got the same error.
Triple checked on physical machine and on two fresh VM's. One VM is a ready to go image from FreeBSD (https://download.freebsd.org/releases/VM-IMAGES/13.1-RELEASE/amd64/Latest/FreeBSD-13.1-RELEASE-amd64.vhd.xz) and the second is a UEFI VM with manual installation (https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-disc1.iso)

Error from log:
"Traceback (most recent call last):
  File "/usr/ports/www/onlyoffice-documentserver/work/DocumentServer-7.2.2/build_tools/./make.py", line 95, in <module>
    build.make()
AttributeError: module 'build' has no attribute 'make'
Error (./make.py): 1
*** Error code 1"

Ports that were installed during the installation:

alsa-lib-1.2.2_1               ALSA compatibility library
autoconf-2.71                  Generate configure scripts and related files
autoconf-switch-20220527       Wrapper script to switch between autoconf versions
automake-1.16.5                GNU Standards-compliant Makefile generator
avahi-app-0.8_1                Service discovery on a local network
bash-5.2.15                    GNU Project's Bourne Again SHell
bash-completion-2.11_2,2       Programmable completion library for Bash
bdftopcf-1.1_2                 Convert X font from BDF to PCF
binutils-2.40_2,1              GNU binary tools
bison-3.8.2,1                  Parser generator from FSF, (mostly) compatible with Yacc
boost-jam-1.81.0               Build tool from the boost.org
boost-libs-1.81.0              Free portable C++ libraries (without Boost.Python)
bootstrap-openjdk11-11.0.5.10.1 Java Development Kit 11
brotli-1.0.9,1                 Generic-purpose lossless compression algorithm
c-ares-1.19.0                  Asynchronous DNS resolver library
ca_root_nss-3.88.1             Root certificate bundle from the Mozilla Project
cairo-1.17.4_2,3               Vector graphics library with cross-device output support
cmake-core-3.25.1              Cross-platform Makefile generator
cups-2.4.2                     Common UNIX Printing System
curl-7.88.1                    Command line tool and library for transferring data with URLs
cyrus-sasl-2.1.28              RFC 2222 SASL (Simple Authentication and Security Layer)
dbus-1.14.6,1                  Message bus system for inter-application communication
dbus-glib-0.112                GLib bindings for the D-BUS messaging system
dejavu-2.37_1                  Bitstream Vera Fonts clone with a wider range of characters
dialog4ports-0.1.6_1           Console Interface to configure ports
docbook-1.5                    Meta-port for the different versions of the DocBook DTD
docbook-sgml-4.5_1             DocBook SGML DTD
docbook-xml-5.0_3              DocBook XML DTD
docbook-xsl-1.79.1_1,1         XSL DocBook stylesheets
docbook2mdoc-1.1.0_1           Convert DocBook refentry to mdoc
encodings-1.0.5,1              X.Org Encoding fonts
expat-2.5.0                    XML 1.0 parser written in C
fakeroot-1.23                  Simulate the root user behaviour
font-bh-ttf-1.0.3_4            X.Org Bigelow & Holmes TTF font
font-misc-ethiopic-1.0.4       X.Org miscellaneous Ethiopic font
font-misc-meltho-1.0.3_4       X.Org miscellaneous Meltho font
font-util-1.3.2                Create an index of X font files in a directory
fontconfig-2.14.2,1            XML-based font configuration API for X Windows
freetype2-2.12.1_2             Free and portable TrueType font rendering engine
gdbm-1.23                      GNU database manager
gettext-runtime-0.21.1         GNU gettext runtime libraries and programs
gettext-tools-0.21.1           GNU gettext development and translation tools
giflib-5.2.1                   Tools and library routines for working with GIF images
glib-2.76.1,2                  Some useful routines of C programming (current stable version)
gmake-4.3_2                    GNU version of 'make' utility
gmp-6.2.1                      Free library for arbitrary precision arithmetic
gn-2072                        Gn meta build framework - standalone version
gnome_subr-1.0                 Common startup and shutdown subroutines used by GNOME scripts
gnutls-3.7.9                   GNU Transport Layer Security library
gobject-introspection-1.74.0,1 Generate interface introspection data for GObject libraries
gperf-3.1                      Generates perfect hash functions for sets of keywords
graphite2-1.3.14               Rendering capabilities for complex non-Roman writing systems
groff-1.22.4_4                 Software typesetting package
gsed-4.9                       GNU stream editor
gsfonts-8.11_8                 Standard Fonts for Ghostscript
gtk-doc-1.33.2_2               Code documentation system, originally for GTK+
harfbuzz-7.1.0                 OpenType text shaping engine
help2man-1.49.3                Automatically generating simple manual pages from program output
hidapi-0.13.1                  Library to access USB HID-class devices
html2text-1.3.2a,1             Converts HTML documents into plain text
icu-72.1,1                     International Components for Unicode (from IBM)
indexinfo-0.3.1                Utility to regenerate the GNU info page index
intltool-0.51.0_1              Tools to internationalize various kinds of data files
iso8879-1986_3                 Character entity sets from ISO 8879:1986 (SGML)
itstool-2.0.7                  Make XML documents translatable through po files
javavmwrapper-2.7.9            Wrapper script for various Java Virtual Machines
jbigkit-2.1_1                  Lossless compression for bi-level images such as scanned pages, faxes
jpeg-turbo-2.1.5.1             SIMD-accelerated JPEG codec which replaces libjpeg
jsoncpp-1.9.5                  JSON reader and writer library for C++
lcms2-2.13.1                   Accurate, fast, and small-footprint color management engine
libICE-1.1.0_1,1               Inter Client Exchange library for X11
libSM-1.2.3,1                  Session Management library for X11
libX11-1.7.2,1                 X11 library
libXau-1.0.9                   Authentication Protocol library for X11
libXdmcp-1.1.3                 X Display Manager Control Protocol library
libXext-1.3.4,1                X11 Extension library
libXfixes-6.0.0                X Fixes extension library
libXi-1.8,1                    X Input extension library
libXrandr-1.5.2                X Resize and Rotate extension library
libXrender-0.9.10_2            X Render extension library
libXt-1.2.1,1                  X Toolkit library
libXtst-1.2.3_2                X Test extension
libcbor-0.10.2                 CBOR protocol implementation for C and others
libcjson-1.7.15_1              Ultralightweight JSON parser in ANSI C
libdaemon-0.14_1               Lightweight C library that eases the writing of UNIX daemons
libdeflate-1.17                Fast, whole-buffer DEFLATE-based compression library
libedit-3.1.20221030,1         Command line editor library
libevent-2.1.12                API for executing callback functions on events or timeouts
libffi-3.4.4                   Foreign Function Interface
libfido2-1.13.0                Provides library functionality for FIDO 2.0
libfontenc-1.1.4               The fontenc Library
libgcrypt-1.9.4_1              General purpose cryptographic library based on the code from GnuPG
libglvnd-1.6.0                 GL Vendor-Neutral Dispatch library
libgpg-error-1.46              Common error values for all GnuPG components
libiconv-1.17                  Character set conversion library
libidn2-2.3.4                  Implementation of IDNA2008 internationalized domain names
liblz4-1.9.4,1                 LZ4 compression library, lossless and very fast
libnghttp2-1.52.0              HTTP/2.0 C Library
libpaper-1.1.28                Library providing routines for paper size management
libpsl-0.21.2_2                C library to handle the Public Suffix List
libssh2-1.10.0_1,3             Library implementing the SSH2 protocol
libtasn1-4.19.0                ASN.1 structure parser library
libtextstyle-0.21.1            Text styling library
libtool-2.4.7_1                Generic shared library support script
libunistring-1.1               Unicode string library
libunwind-20211201_1           Generic stack unwinding library
libuv-1.44.2                   Multi-platform support library with a focus on asynchronous I/O
libxcb-1.15_1                  The X protocol C-language Binding (XCB) library
libxml2-2.10.3_1               XML parser library for GNOME
libxslt-1.1.37                 XML stylesheet transformation library
llvm12-12.0.1_10               LLVM and Clang
lua53-5.3.6                    Powerful, efficient, lightweight, embeddable scripting language
lua54-5.4.4                    Powerful, efficient, lightweight, embeddable scripting language
m4-1.4.19,1                    GNU M4
meson-1.0.1                    High performance build system
minixmlto-0.0.7                Minimalistic alternative to xmlto
mkfontscale-1.2.1              Creates an index of scalable font files for X
mpdecimal-2.5.1                C/C++ arbitrary precision decimal floating point libraries
mpfr-4.2.0,1                   Library for multiple-precision floating-point computations
mysql80-client-8.0.32          Multithreaded SQL database (client)
nasm-2.16.01,2                 General-purpose multi-platform x86 and amd64 assembler
nettle-3.8.1                   Low-level cryptographic library
ninja-1.11.1,2                 Small build system closest in spirit to Make
node16-16.19.1                 V8 JavaScript for client and server
npm-node16-9.5.0               Node package manager
openjdk11-11.0.18+10.1         Java Development Kit 11
openldap26-client-2.6.4        Open source LDAP client implementation
p11-kit-0.24.1_2               Library for loading and enumerating of PKCS#11 modules
p5-Locale-gettext-1.07         Message handling functions
p5-Locale-libintl-1.33         Internationalization library for Perl
p5-Text-Unidecode-1.30         US-ASCII transliterations of Unicode text
p5-Unicode-EastAsianWidth-12.0 East Asian Width properties
p5-XML-Parser-2.46             Perl extension interface to James Clark's XML parser, expat
pcre-8.45_3                    Perl Compatible Regular Expressions library
pcre2-10.42                    Perl Compatible Regular Expressions library, version 2
perl5-5.32.1_3                 Practical Extraction and Report Language
pixman-0.42.2                  Low-level pixel manipulation library
pkg-1.19.1_1                   Package manager
pkgconf-1.8.1,1                Utility to help to configure compiler and linker flags
png-1.6.39                     Library for manipulating PNG images
portmaster-3.22                Manage your ports without external databases or languages
protobuf-3.21.12,1             Data interchange format library
psutils-1.17_5                 Utilities for manipulating PostScript documents
public_suffix_list-20230228    Public Suffix List by Mozilla
py39-Babel-2.12.1              Collection of tools for internationalizing Python applications
py39-CommonMark-0.9.1          Python parser for the CommonMark Markdown spec
py39-Jinja2-3.1.2              Fast and easy to use stand-alone template engine
py39-alabaster-0.7.13          Modified Kr Sphinx theme
py39-build-0.10.0_1            PEP517 package builder
py39-certifi-2022.12.7         Mozilla SSL certificates
py39-cffi-1.15.1               Foreign Function Interface for Python calling C code
py39-charset-normalizer-3.0.1  Real First Universal Charset Detector
py39-cryptography-3.4.8_1,1    Cryptographic recipes and primitives for Python developers
py39-cython-0.29.33            Compiler for Writing C Extensions for the Python Language
py39-docutils-0.19,1           Python Documentation Utilities
py39-flit-3.8.0_1              Simple packaging tool for simple packages
py39-flit-core-3.8.0_1         Distribution-building parts of Flit
py39-future-0.18.3             Clean single-source support for Python 3 and 2
py39-idna-3.4                  Internationalized Domain Names in Applications (IDNA)
py39-imagesize-1.4.1           Get image size from png/jpeg/jpeg2000/gif file
py39-importlib-metadata-6.0.0_1 Read metadata from Python packages
py39-installer-0.6.0_1         Library for installing Python wheels
py39-libxml2-2.10.3            Python interface for XML parser library for GNOME
py39-lxml-4.9.2                Pythonic binding for the libxml2 and libxslt libraries
py39-markupsafe-2.1.2          Implements XML/HTML/XHTML Markup safe string for Python
py39-openssl-20.0.1,1          Python interface to the OpenSSL library
py39-packaging-23.0_1          Core utilities for Python packages
py39-pycparser-2.21            C parser in Python
py39-pygments-2.14.0           Syntax highlighter written in Python
py39-pyproject_hooks-1.0.0_1   Wrappers to call pyproject.toml-based build backend hooks
py39-pysocks-1.7.1             Python SOCKS module
py39-pystemmer-2.0.1           Snowball Stemming Algorithms for Information Retrieval
py39-pytz-2022.7,1             World Timezone Definitions for Python
py39-recommonmark-0.5.0_2      CommonMark bridge for docutils and Sphinx
py39-requests-2.28.2           Python HTTP for Humans
py39-setuptools-63.1.0         Python packages installer
py39-setuptools_scm-6.4.2      Setuptools plugin to manage your versions by scm tags
py39-six-1.16.0                Python 2 and 3 compatibility utilities
py39-snowballstemmer-2.2.0     Snowball stemming library collection for Python
py39-sphinx-5.3.0,1            Python documentation generator
py39-sphinxcontrib-applehelp-1.0.2 Extension which outputs Apple help books
py39-sphinxcontrib-devhelp-1.0.2 Sphinx extension which outputs Devhelp document
py39-sphinxcontrib-htmlhelp-2.0.0 Sphinx extension which renders HTML help files
py39-sphinxcontrib-jsmath-1.0.1 Sphinx extension which renders display math in HTML via JavaScript
py39-sphinxcontrib-qthelp-1.0.3 Sphinx extension which outputs QtHelp document
py39-sphinxcontrib-serializinghtml-1.1.5 Sphinx extension which outputs serialized HTML files (json and pickle)
py39-toml-0.10.2               Python library for parsing and creating TOML
py39-tomli-2.0.1_1             Lil' TOML parser
py39-tomli-w-1.0.0_1           Lil' TOML writer
py39-urllib3-1.26.14,1         HTTP library with thread-safe connection pooling, file post, and more
py39-wheel-0.38.4              Built-package format for Python
py39-zipp-3.4.0                Backport of pathlib-compatible object wrapper for zip files
python39-3.9.16_2              Interpreted object-oriented programming language
qt5-qmake-5.15.8p157           Qt Makefile generator (KDE patched)
readline-8.2.0                 Library for editing command lines as they are typed
rhash-1.4.3                    Utility and library for computing and checking of file hashes
sdocbook-xml-1.1_2,2           "Simplified" DocBook XML DTD
swig-4.0.2                     Generate wrappers for calling C/C++ code from other languages
texinfo-6.8_3,1                Typeset documentation system with multiple format output
tiff-4.4.0_1                   Tools and library routines for working with TIFF images
uchardet-0.0.8                 Universal charset detection library
xcb-proto-1.15.2               The X protocol C-language Binding (XCB) protocol
xmlcatmgr-2.2_3                SGML and XML catalog manager
xmlcharent-0.3_2               XML character entities
xorg-fonts-truetype-7.7_1      X.Org TrueType fonts
xorg-macros-1.19.3             X.Org development aclocal macros
xorgproto-2022.1               X Window System unified protocol definitions
xtrans-1.4.0                   Abstract network code for X
yelp-tools-42.0                Utilities to help manage documentation for Yelp and the web
yelp-xsl-42.0                  DocBook XSLT stylesheets for yelp
zip-3.0_1                      Create/update ZIP files compatible with PKZIP
zstd-1.5.4                     Fast real-time compression algorithm
Comment 7 freebsd.org 2023-03-26 18:22:16 UTC
I ran into the same problem.

The problem is, that the file `/usr/ports/www/onlyoffice-documentserver/work/DocumentServer-7.1.1/build_tools/./make.py` tries to import `./scripts/build.py`, but does this not properly and instead imports the module `build` from the package `py39-build-0.10.0_1`, which is installed as a dependency.

Changing the following line in `/usr/ports/www/onlyoffice-documentserver/work/DocumentServer-7.1.1/build_tools/./make.py` fixed this problem for me:

```
import build
```
to
```
from scripts import build
```
Comment 8 freebsd.org 2023-03-26 18:24:00 UTC
Can we get this bug re-opened, @Mikael Urankar?
Comment 9 Mikael Urankar freebsd_committer freebsd_triage 2023-03-26 19:11:55 UTC
reopen
Comment 10 Mikael Urankar freebsd_committer freebsd_triage 2023-03-26 19:12:52 UTC
(In reply to freebsd.org from comment #7)
Thanks for the investigation, I will try to commit a fix next week.
Comment 11 commit-hook freebsd_committer freebsd_triage 2023-03-28 16:25:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dab5a380703f6468d73de046d7204055d9180436

commit dab5a380703f6468d73de046d7204055d9180436
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2023-03-27 16:22:07 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2023-03-28 16:24:56 +0000

    www/onlyoffice-documentserver: Fix build conflict with devel/py-build

    The script "build_tools/make.py" tries to import "scripts/build.py"
    but does this not properly and instead imports the module "build"
    from devel/py-build

    PR:             267265
    Submitted by:   freebsd.org@vollkorn.cryptobitch.de

 .../files/patch-build__tools_make.py (new)                    | 11 +++++++++++
 1 file changed, 11 insertions(+)