Giter Site home page Giter Site logo

Cannot use mercurial about termux-app HOT 14 CLOSED

termux avatar termux commented on May 18, 2024
Cannot use mercurial

from termux-app.

Comments (14)

fornwall avatar fornwall commented on May 18, 2024

The root cause is that the python2 package is compiled without os.link support, since hard links are not supported on Android (starting in Android version 6). This causes the line oslink = os.link to fail with the above exception.

  • Adding back os.link (as a method which would would not work on Android 6) would unfortunately cause pip to break, see termux/termux-packages#29.
  • If mercurial was changed to work without os.link (at least on Android) that would be great, but probably not very likely to be accepted by the mercurial project.

Does changing the line oslink = os.link to something like oslink = os.symlink in $PREFIX/lib/python2.7/site-packages/mercurial/posix.py cause mercurial to run (with basic functionality such as cloning and pushing working)?

from termux-app.

yajo avatar yajo commented on May 18, 2024

I think symlinks are more error-prone than just copying (that's what AFAIK mercurial does in Windows), so I added:

[...]
import shutil
[...]
oslink = shutil.copy2
[...]

And it works like a charm!

from termux-app.

yajo avatar yajo commented on May 18, 2024

Reported upstream: https://bz.mercurial-scm.org/show_bug.cgi?id=4974

from termux-app.

yajo avatar yajo commented on May 18, 2024

If you could package this, you could add a patch, but maybe I'm asking for too much work...

from termux-app.

fornwall avatar fornwall commented on May 18, 2024

Great work reporting it to mercurial! I'll look into how much work it would be to package mercurial with this patch (otherwise I'll add a note about the manual patching steps needed when installing from pip in an upcoming collection of help pages)!

from termux-app.

fornwall avatar fornwall commented on May 18, 2024

A reference for the removed hard link support in Android 6 is https://code.google.com/p/android-developer-preview/issues/detail?id=3150

from termux-app.

durin42 avatar durin42 commented on May 18, 2024

Please DO NOT package mercurial with symlinks replacing hardlinks. Copies are fine, that's what we'll fall back to anyway.

FWIW, I've mailed a fix for this to our list, and it should get reviewed in the next few days, at which point I'd really appreciate someone testing it (I'm not sure how to test it myself.)

from termux-app.

fornwall avatar fornwall commented on May 18, 2024

@durin42 Yes, let's forget I ever mentioned symlinks as fallbacks :).

Great, let us know here if you want us to help testing a patch (and perhaps write down instructions/steps for anything special to be tested)!

If you want to test anything yourself, install the Termux app, and then install required packages by executing

apt install python2-dev gcc

You should now be able to install mercurial with

pip2 install mercurial

from termux-app.

durin42 avatar durin42 commented on May 18, 2024

Alrighty, if someone could test http://selenic.com/hg (if a zip is easier: https://selenic.com/hg/archive/42aa0e570eaa.zip) and let me know if it works, I'd greatly appreciate it.

Thanks!

from termux-app.

fornwall avatar fornwall commented on May 18, 2024

@durin42 Nice work! I built mercurial with make local and verified that basic cloning, pushing, committing, pulling and pushing works.

Do you have an estimate for which version this would be available in mercurial (and when)?

from termux-app.

durin42 avatar durin42 commented on May 18, 2024

The patch is on our default branch for our next major release, which will be on February 1, 2016. The patch should apply to the stable branch, so if you want you can point people at a custom zip that has that applied for now.

(https://www.mercurial-scm.org/wiki/TimeBasedReleasePlan if you're curious)

On Dec 11, 2015, at 18:48, Fredrik Fornwall [email protected] wrote:

@durin42 https://github.com/durin42 Nice work! I built mercurial with make local and verified that basic cloning, pushing, committing, pulling and pushing works.

Do you have an estimate for which version this would be available in mercurial (and when)?


Reply to this email directly or view it on GitHub #22 (comment).

from termux-app.

fornwall avatar fornwall commented on May 18, 2024

Ok, interested people can apply https://selenic.com/repo/hg/rev/b0d90fef16b6 to $PREFIX/python2.7/site-packages/mercurial/posix.py after installing mercurial through pip in the meantime.

Thanks for the help!

from termux-app.

yajo avatar yajo commented on May 18, 2024

Works perfectly. Anybody interested can run pip2 install https://selenic.com/hg/archive/42aa0e570eaa.zip (add --upgrade if you had a previous version).

from termux-app.

fornwall avatar fornwall commented on May 18, 2024

@yajo That's great! Didn't know that you could point pip to the zip file directly.

from termux-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.