Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#60053 closed defect (worksforme)

grass7 build failure utf-8 error with nviz.py

Reported by: bal-agates Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: grass7

Description

While building grass7 @7.8.2_1 I get the error

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 1130796: invalid start byte
make[1]: *** [OBJ.x86_64-apple-darwin17.7.0/nviz.py] Error 1

I tried uninstalling and cleaning all existing ports and rebuilding but I get the same error. I also get the same error if I

$ cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_gis_grass7/grass7/work/grass-7.8.2/lib/python/ctypes
$ sudo make

It is not clear to me what file has the bad utf-8 character.

In ./OBJ.x86_64-apple-darwin17.7.0/ I do not see nviz.py, but I see many others *.py, and assume it is trying to create that from something.

MacPorts 2.6.2 (selfupdate done today), macOS 10.13.6

Attachments (2)

3a-command.txt (1.3 KB) - added by bal-agates 5 years ago.
Likely make command run by Python subprocess that generates error
3b-make in ctypes.txt (2.6 MB) - added by bal-agates 5 years ago.
Output from 3a-command.txt that shows errors.

Change History (9)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Keywords: grass7 utf-8 nviz removed

Please attach the complete main.log.

Changed 5 years ago by bal-agates

Attachment: 3a-command.txt added

Likely make command run by Python subprocess that generates error

Changed 5 years ago by bal-agates

Attachment: 3b-make in ctypes.txt added

Output from 3a-command.txt that shows errors.

comment:2 Changed 5 years ago by bal-agates

Sorry, I didn't capture the main.log. I think the error message I originally included was deceiving. I suspect poor error handling in the build process obfuscated the problem. I mainly studied the make in ../ctypes. It appears to build a command, run that command in a Python subprocess, and capture the output. I modified the source to see what command was issued when the error appears. The command is in <3a-command.txt> and the manually captured output is in <3b-make in ctypes.txt>. The output shows 3 errors. Search for 'error:'. All appear related to unknown architecture. I suspect that when compile errors occur the compiler is injecting some control characters, possible a return code, in the output stream that causes problems with the subprocess output capture.

When I tried building grass7 (7.8.2_1) yesterday I had an existing MacPorts tree with many projects built over the last year or two. I may have even attempted to build grass7 before. Thinking the grass7 build problem was file corruption or incompatibility I uninstalled and cleaned all MacPort projects and started from scratch. I got the same build error. I ended up 1) Rebuilding all other projects. No problems. Thinking the problem was with compiler defines I tried 2) using 'port select' to set clang=mp-clang-9.0, gcc=mp-gcc9 and llvm=mp-llvm-9.0 and 3) I rebooted my computer. After doing 1-3 grass7 (7.8.2_1) did successfully build. I am not certain exactly what fixed the problem. My orginal clang was /usr/bin/clang (10.0.0) which was part of Xcode. That seems newer than MacPorts clang (9.0.1). Is there a compiler dependency?

comment:3 Changed 5 years ago by mf2k (Frank Schima)

It is automatically captured. You can find it with this command:

port logfile grass7

Please attach it to this ticket.

comment:4 Changed 5 years ago by bal-agates

I am not sure how this is suppose to work but what I see now

$ port installed grass7
The following ports are currently installed:
  grass7 @7.8.2_1+postgresql12+python38 (active)
$ port logfile grass7
Error: Log file for port grass7 not found

On a successful build does the logfile get deleted? I have not done anything special to delete the logfile.

See prior message where I changed some things and got it to build. If I get inspired I will try recreate the problem by uninstalling all of my MacPorts and undoing "port select" selections and rebuilding grass7. That will take some time. I cannot do now.

comment:5 Changed 5 years ago by mf2k (Frank Schima)

Yes, it gets deleted once it is installed. I am assuming that your issue is resolved now.

comment:6 Changed 5 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: newclosed

comment:7 Changed 5 years ago by nilason (Nicklas Larsson)

For reference: this was indeed a GRASS+Mac bug, addressed with https://github.com/OSGeo/grass/pull/385 and backported to 7.8.3.

Note: See TracTickets for help on using tickets.