#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)
Change History (17)
Changed 13 years ago by em.pee.oh@…
comment:1 Changed 13 years ago by em.pee.oh@…
Cc: | em.pee.oh@… added |
---|
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: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.
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: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 follow-up: 12 Changed 13 years ago by singingwolfboy@…
Resolution: | → fixed |
---|---|
Status: | new → closed |
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 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.
Cc Me!