Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#30577 closed defect (fixed)

apache-ivy not building on OSX Lion clean

Reported by: em.pee.oh@… Owned by: singingwolfboy@…
Priority: Normal Milestone:
Component: ports Version: 2.0.0
Keywords: lion Cc: josephwinston (Joseph Winston), evandrix (Lee Wei Yeong)
Port: apache-ivy

Description

Clean install of Lion. Clean reinstall of port. When one tries sudo port install apache-ivy build fails on the build.xml target 'resolve' mainly because retrieve fails. It seems this is because its looking for stuff in root's homedir, which I guess is equivalent to basedir in this case /var/root/.ivy2/cache/resolved-org.apache.ivy-ivy-2.2.0.xml

rather than in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_apache-ivy/apache-ivy/work/apache-ivy-2.2.0

Where it would, were one running the same ant commands from the project directory.

main.log attached

Attachments (5)

main.log (18.7 KB) - added by em.pee.oh@… 13 years ago.
main.2.log (8.7 KB) - added by twic@… 13 years ago.
main.log on Snow Leopard from twic@…
main.3.log (19.2 KB) - added by anilkumarp@… 13 years ago.
Error log - see file not found exception
main.4.log (7.9 KB) - added by hide104@… 13 years ago.
main.log on Lion 10.7.3 Build 11D50b
apache-ivy-fix.patch (1.8 KB) - added by mail_ben_schmidt@… 13 years ago.

Download all attachments as: .zip

Change History (17)

Changed 13 years ago by em.pee.oh@…

Attachment: main.log added

comment:1 Changed 13 years ago by em.pee.oh@…

Cc: em.pee.oh@… added

Cc Me!

comment:2 Changed 13 years ago by mf2k (Frank Schima)

Cc: singingwolfboy@… em.pee.oh@… removed
Keywords: lion added; Lion removed
Owner: changed from macports-tickets@… to singingwolfboy@…

comment:3 Changed 13 years ago by serverleader@…

verified... I have the exact same issue...

comment:4 Changed 13 years ago by twic@…

Installation fails for me in a similar way on Snow Leopard (10.6.8). Perhaps interestingly, the key lines are:

:info:build BUILD FAILED
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_apache-ivy/apache-ivy/work/apache-ivy-2.2.0/build.xml:184: impossible to resolve dependencies:
:info:build     java.io.FileNotFoundException: /Users/tom/.ivy2/cache/resolved-org.apache.ivy-ivy-2.2.0.xml (No such file or directory)

So, for me, it's not looking in /var/root, it is looking in ~, but it's still not finding the file it wants. I note that ~/.ivy2 doesn't exist at this point. However, if i create that directory by hand and try to install again, the error changes to:

:info:build BUILD FAILED
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_apache-ivy/apache-ivy/work/apache-ivy-2.2.0/build.xml:184: impossible to resolve dependencies:
:info:build     java.io.FileNotFoundException: /Users/tom/.ivy2/cache/resolved-org.apache.ivy-ivy-2.2.0.xml (Permission denied)

!

I will attach a copy of my main.log from a clean run (ie without ~/.ivy2 existing) in case it helps.

Changed 13 years ago by twic@…

Attachment: main.2.log added

main.log on Snow Leopard from twic@…

comment:5 Changed 13 years ago by josephwinston (Joseph Winston)

Cc: josephwinston@… added

Cc Me!

comment:6 Changed 13 years ago by uv@…

This seems to me to be a permission issue. port install apache-ivy should run as root. However, it seems it is doing some 'privilege de-esculation', i.e. running as a non-root user. Such a non-root user does not have write access (or even read access) to the /var/root/.ivy2 directory. Likewise, that user does not have write access to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_apache-ivy/apache-ivy/

Granting temporary write access to all to these two directories allowed the port command to complete.

I have not located the source for the port itself (only the downloaded ivy tarball) so cannot provide a fix for the port.

Upayavira

Changed 13 years ago by anilkumarp@…

Attachment: main.3.log added

Error log - see file not found exception

comment:7 Changed 13 years ago by anilkumarp@…

I too get the same file not found exception when trying to add the port via "sudo port install apache-ivy". See attached main.log file

comment:8 Changed 13 years ago by evandrix (Lee Wei Yeong)

Cc: evandrix@… added

Cc Me!

comment:9 Changed 13 years ago by evandrix (Lee Wei Yeong)

Need this to build cassandra (it's one of the deps)

Changed 13 years ago by hide104@…

Attachment: main.4.log added

main.log on Lion 10.7.3 Build 11D50b

Changed 13 years ago by mail_ben_schmidt@…

Attachment: apache-ivy-fix.patch added

comment:10 Changed 13 years ago by mail_ben_schmidt@…

Attached a patch which fixes this.

Problem: Access denied errors for $HOME/.ivy2/cache when building apache-ivy.

Cause: MacPorts builds as the macports user, who doesn't have access to the real user's home directory.

Solution: Simply use the /localivy target to use .ivy2 in the build directory instead of the user's home directory.

Problem: /localivy has no effect.

Cause: A dependency is missing in the build.xml file so ivy.home is not being set when it should, and is falling back to a hardcoded default of ~/.ivy2.

Solution: Patch build.xml.

I think the patch to build.xml should be submitted upstream. All our Portfile should need to do is include /localivy as a target.

comment:11 Changed 13 years ago by singingwolfboy@…

Resolution: fixed
Status: newclosed

Fixed in r90162. Thanks for tracking this down and for the patch, mail_ben_schmidt@…!

As for submitting the patch upstream: I agree that it's a good idea. Since it's your patch, would you like to do that? (I actually have no connection to the apache-ivy project whatsoever. If there's someone here who does, I would be more than happy to hand over maintainership of this port.)

comment:12 in reply to:  11 Changed 13 years ago by mail_ben_schmidt@…

OK. I have reported this upstream (https://issues.apache.org/jira/browse/IVY-1338). I don't have anything to do with Ivy either, though. I hope I can leave it to you as port maintainer to keep an eye on the issue and update our Portfile when the patch is released upstream.

Note: See TracTickets for help on using tickets.