Opened 4 years ago

Last modified 3 years ago

#42428 new defect

Aquaterm fails to build due to StripNIB failures

Reported by: mfuhrer@… Owned by: g5pw (Aljaž Srebrnič)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: mojca (Mojca Miklavec), cooljeanius (Eric Gallager)
Port: aquaterm

Description

Aquaterm consistently fails to build. Inspecting the log file reveals failures during the StripNIB build phases. Strangely, when I try to manually run the StripNIB command, I don't encounter any problems:

[mfuhrer@eve.lan: /Users/mfuhrer]                                                                                                 
[36] sudo /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --strip /Volumes/UNIX/opt/local/var/macports/build/_Volumes_UNIX_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_aquaterm/aquaterm/work/AquaTerm-1.1.1/aquaterm/build/Default/AquaTerm.app/Contents/Resources/English.lproj/Preferences.nib --output-format human-readable-text /Volumes/UNIX/opt/local/var/macports/build/_Volumes_UNIX_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_aquaterm/aquaterm/work/AquaTerm-1.1.1/aquaterm/English.lproj/Preferences.nib
                                                                                                                                  
[mfuhrer@eve.lan: /Users/mfuhrer]                                                                                                 
[37] echo $?
0

I have configured MacPorts to build and install in a separate disk partition under /Volumes/UNIX/opt/local, and have attached /Volumes/UNIX/opt/local/etc/macports/macports.conf as well, in case this is playing a role in the problem

Attachments (4)

main.log (100.3 KB) - added by mfuhrer@… 4 years ago.
macports.conf (8.2 KB) - added by mfuhrer@… 4 years ago.
patch-portsandbox.tcl.diff (943 bytes) - added by ajdudman@… 3 years ago.
This patch allows Yosemite/Xcode to write files under "/opt/.TemporaryItems/".
patch-v2-portsandbox.tcl.diff (621 bytes) - added by ajdudman@… 3 years ago.
Improved patch that uses /bin/df to calculate the temporary items location

Download all attachments as: .zip

Change History (17)

Changed 4 years ago by mfuhrer@…

Changed 4 years ago by mfuhrer@…

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

  • Cc mojca@… added
  • Owner changed from macports-tickets@… to g5pw@…
  • Port aquaterm added

In the future, please fill in the Port field and Cc the port maintainers (port info --maintainers aquaterm).

comment:2 Changed 4 years ago by g5pw (Aljaž Srebrnič)

Hello! The actual error is

error: ibtool could not strip "ColorInspector.nib" because it could not write to the pa
th "/Volumes/UNIX/opt/local/var/macports/build/_Volumes_UNIX_opt_local_var_macports_sources_rsync.macport
s.org_release_tarballs_ports_aqua_aquaterm/aquaterm/work/AquaTerm-1.1.1/aquaterm/build/Default/AquaTerm.a
pp/Contents/Resources/ColorInspector.nib"

so I guess there's an error with permissions. Can you check the permissions for that file?

Last edited 4 years ago by g5pw (Aljaž Srebrnič) (previous) (diff)

comment:3 Changed 4 years ago by trudelle@…

I'm seeing the same thing building MenuMeters:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_MenuMeters/MenuMeters/work/MenuMeters-1.5/PrefPane/Italian.lproj/MenuMetersPref.nib: error: ibtool could not strip "MenuMetersPref.nib" because it could not write to the path "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_MenuMeters/MenuMeters/work/MenuMeters-1.5/build/Release/MenuMeters.prefPane/Contents/Resources/Italian.lproj/MenuMetersPref.nib".

The leaf of that path does not exist, though I haven't changed any permissions in the parent dir: drwxr-xr-x 3 macports admin 102 Oct 30 13:19 Italian.lproj

comment:4 Changed 4 years ago by cooljeanius (Eric Gallager)

  • Cc egall@… added

Cc Me!

comment:5 Changed 4 years ago by mojca (Mojca Miklavec)

Is there any chance that case-sensitivity of the external partition plays a role here? (Not likely, I'm just speculating.) How is your volume formatted? Do you have any other path with a similar name (but different case)?

comment:6 Changed 4 years ago by g5pw (Aljaž Srebrnič)

Also, which version of OS X are you installing Aquaterm on?

Last edited 4 years ago by g5pw (Aljaž Srebrnič) (previous) (diff)

comment:7 Changed 4 years ago by hasso.tepper@…

I see the same and I also have macports installed on different volume - /Volumes/BigDisk/MacPorts/... . There is no similar paths in different case and I'm using uptodate 10.9.4.

comment:8 Changed 3 years ago by ajdudman@…

I too see this with port aquaterm and other ports using Xcode to build them. I am on OS X 10.10.1 system with Xcode 6.1. The build log message from ibtool is confusing and poorly done. This is a bug in Xcode, specifically /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool does not respect the environment's TMPDIR setting, instead in my case, it wants to write to files under "/opt/.TemporaryItems/". I mount a separate disk for Macports at mountpoint "/opt/". Look at Console.app's log. I have five messages like this one:

11/27/14 9:49:16.838 PM sandboxd[19157]: ([19155]) ibtoold(19155) deny file-write-create /opt/.TemporaryItems/folders.509/TemporaryItems/(A Document Being Saved By ibtool)

509 is user macports uid number. The workaround is to either disable sandbox with 'set portsandbox_profile ""' in pre-build and pre-destroot procedures, or better yet expand the sandbox for Yosemite/Xcode. I chose the latter. See the attached patch. After patching macports source, be sure to reinstall, so that the change takes effect. Just after your failed port aquaterm build, be sure to look at sandbox message. You might need a different location.

Last edited 3 years ago by ajdudman@… (previous) (diff)

Changed 3 years ago by ajdudman@…

This patch allows Yosemite/Xcode to write files under "/opt/.TemporaryItems/".

comment:9 Changed 3 years ago by ajdudman@…

It is interesting to note that a sandbox allow file-write* regex for /opt/.TemporaryItems/folders.509/ will not work, while one for /opt/.TemporaryItems/ does. Please use my latest patch from today.

comment:10 Changed 3 years ago by mojca (Mojca Miklavec)

Can you please write an email and start the discussion on the macports-dev mailing list explaining the details and asking for feedback? Or maybe open a new ticket?

The issue exceeds the scope of "AquaTerm" and I'm not familiar enough with the code you patched.

comment:11 Changed 3 years ago by neverpanic (Clemens Lang)

The problem with this patch is that it hardcodes /opt/.TemporaryItems. This might work for your case, but it certainly won't for people who mount a separate disk at /opt/local, or people who install their MacPorts in /some/other/path and have a mountpoint somewhere along the way.

I'm assuming that ibtool will always use the disk where its products will go as a temporary storage location so the final operation isn't a copy but a move one. Since all our products while building go into ${workpath} what we really need is a code that figures out the mount point belonging to that, append .TemporaryItems and add that to the sandbox.

comment:12 Changed 3 years ago by neverpanic (Clemens Lang)

GNU stat seems to support mountpoint lookup using stat --format='%m' $file (source: http://unix.stackexchange.com/questions/72223/check-if-folder-is-a-mounted-remote-filesystem). So maybe looking at their code to find out how they do it would help.

comment:13 Changed 3 years ago by ajdudman@…

I started a short discussion on macports-dev mailing list. There I was asked to file a bug report with Apple and have done so.

I did some Google-ing and man page reading and I found tcl lacking mountpoint lookup support. OS X has /bin/df so something like this might get us there:

file join [lindex [exec /bin/df $workpath] end] ".TemporaryItems"

I have improved my patch which I will attach.

Changed 3 years ago by ajdudman@…

Improved patch that uses /bin/df to calculate the temporary items location

Note: See TracTickets for help on using tickets.