Opened 3 years ago

Closed 2 years ago

#63384 closed defect (fixed)

espeak-ng @1.50: phsource/intonation': No such file or directory.

Reported by: Git-Christopher (Kit Christopher) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: espeak-ng

Description (last modified by ryandesign (Ryan Carsten Schmidt))

after following the directions on https://ports.macports.org/port/espeak-ng/, i receive build errors when running the command sudo port install espeak-ng in the terminal. attaching log file for reference. thank you.

(base) christopher-mauldins-computer:~ Kit$ sudo port install espeak-ng
--->  Computing dependencies for espeak-ng
--->  Fetching archive for espeak-ng
--->  Attempting to fetch espeak-ng-1.50_0.darwin_19.x86_64.tbz2 from https://packages.macports.org/espeak-ng
--->  Attempting to fetch espeak-ng-1.50_0.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/espeak-ng
--->  Attempting to fetch espeak-ng-1.50_0.darwin_19.x86_64.tbz2 from https://mse.uk.packages.macports.org/espeak-ng
--->  Building espeak-ng
Error: Failed to build espeak-ng: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_espeak-ng/espeak-ng/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port espeak-ng failed

Attachments (1)

main.log (190.0 KB) - added by Git-Christopher (Kit Christopher) 3 years ago.
log file

Download all attachments as: .zip

Change History (8)

Changed 3 years ago by Git-Christopher (Kit Christopher)

Attachment: main.log added

log file

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Summary: sudo port install espeak-ng (version 1.5.0) failed to build on macos catalina 10.15.7espeak-ng @1.50: phsource/intonation': No such file or directory.

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

The interesting part of the error is that it says:

espeak-ng-1.50//../phsource/intonation': No such file or directory.

There is supposed to be "espeak-ng-data" between those two slashes. Need to figure out why that's missing.

We did not encounter this error when our build system built this port for Yosemite-Catalina in September 2020, for Big Sur on arm64 in March 2021, and for Big Sur on x86_64 today. I do not encounter the error building on High Sierra today. This suggests there's something different about your computer.

comment:3 Changed 3 years ago by kencu (Ken)

there are a great many variables that are hard to anticipate on all the computers and installations of MacPorts out there. Sometimes having just one port installed can make a build break. We try to find/guess/watch out for all these, but we can't catch them all.

one useful thing to do is a "trace" build which blocks many unexpected errors:

sudo port -v -t install espeak-ng

does this, and might prove revealing.

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

In this case, I don't believe that helps.

This build system finishes by running the compiled espeak-ng program:

:info:build ESPEAK_DATA_PATH=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_espeak-ng/espeak-ng/work/espeak-ng-1.50 src/espeak-ng --compile-intonations && \
:info:build             ESPEAK_DATA_PATH=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_espeak-ng/espeak-ng/work/espeak-ng-1.50 src/espeak-ng --compile-phonemes && \
:info:build             touch phsource/phonemes.stamp

It needs to know where its data is. At build time, it has not been installed yet, so the path to the data is within the build directory; it sets the ESPEAK_DATA_PATH environment variable to this value. The length of that path is pretty long in a standard MacPorts install: "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_espeak-ng/espeak-ng/work/espeak-ng-1.50" per this user's log is 158 characters, but if a user uses a different MacPorts mirror it would be even longer. espeak-ng uses a fixed-size character array to store the path that it gets from this environment variable, concatenated with the further 15 characters "/espeak-ng-data". The fixed size of the character array is 160 bytes (the #define is N_PATH_HOME), so in a standard MacPorts install, the path length exceeds the size of the array. The program is smart enough to detect that a memory overflow would occur and does not attempt to put the value into the variable, but it is evidently not smart enough to abort with an error explaining what the problem is.

So in fact there is nothing unusual about the user's system that makes this fail; rather, there is something unusual about my system and the buildbot systems that makes it succeed there, namely that they use shorter build paths because they use ports trees in non-standard locations. On my system, the path to the source directory is only 129 characters and on the buildbot it is only 122 characters.

It's unclear why N_PATH_HOME is set to 160. The size has already been increased twice over the years; it was previously 150, and 120 before that. And there is already a conditional that sets it much higher on Windows. It seems like the fix is just to increase this variable's size considerably. Conferring with upstream is probably a good idea. Alternately, a fix could be to set ESPEAK_DATA_PATH to a relative path.

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 in reply to:  2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

And I can confirm the error on another computer that uses a standard MacPorts rsync-based ports tree.

comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

comment:7 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 7df8bf6ec43f5a99f66e93415d7ddcb9c44768d5/macports-ports (master):

espeak-ng: Fix build failure with long build paths

Closes: #63384

Note: See TracTickets for help on using tickets.