Mercurial extensions not working in Windows 7 x64? - windows-7

We are test driving Mercurial at work. We don't want to have to enter our user/pass each time we interact with a repository, so we set up the mercurial_keyring extension. We:
Installed Python 2.6.5 (32 or 64 bit, depending on the system)
Installed setuptools (for easy_install.exe)
easy_install keyring
easy_install mercurial_keyring
And then made the appropriate changes to %userprofile%/mercurial.ini in the [auth] section. It works fine on my colleague's computer (32bit xp sp3), but it does not work on my machine (Windows 7 Ultimate x64). Also noteworthy, the setuptools had to be built from source on Win 7 x64 (python setup.py bdist_wininst, then run the resulting setuptools-0.6c11.win-amd64.exe).
Using just hg.exe from the Mercurial 1.5 binary installation (the .msi), I get this error when I run hg.exe:
*** failed to import extension mercurial_keyring: No module named
mercurial_keyring
I tried to change my mercurial.ini, to specify the path to the mercurial_keyring.py file, instead of having mercurial find it (since it's in the PYTHONPATH).
Old:
[extensions]
mercurial_keyring =
New:
[extensions] mercurial_keyring =
c:/mercurial/extensions/mercurial_keyring.py
The error changes to:
abort: could not import module
keyring!
So while providing the path to the mercurial_keyring extension works, the dependent keyring module still cannot be found.
After further investigation, it appears that NO extensions work. They all produce the error:
*** failed to import extension [extension name]: No module named
[module name]
It appears that when running hg.exe, it is not aware of PYTHONPATH. I have tried:
Python 2.6.5 32 bit
Python 2.6.5 64 bit
Building Mercurial 1.5 from source with MinGW
Building Mercurial 1.5 from source with MSVC9
Using hg.exe from the 1.5 binary dist (.msi)
Using the hg.py in c:\python26\scripts when building from source
Various configurations in %userprofile%/mercurial.ini
Using setuptools (easy_install.exe) to install keyring and mercurial_keyring
Building keyring and mercurial_keyring from source (python setup.py bdist_wininst)
Nothing works. The closest I've got is using hg.py when building from source. It at least doesn't give me errors, and actually creates %userprofile%/wincrypto_pass.cfg when I enter my credentials. But on subsequent requests, it doesn't enter the credentials automatically. It prompts me for them again.
Interestingly, TortoiseHG is using the keyring. I just can't get it to work on the command line. I think something is going on with Win 7 x64 that is preventing mercurial (hg.exe) from seeing the PYTHONPATH, so it can't find any of the installed modules.
Does anyone have extensions working in Win 7 x64? Specifically with the binary installation of mercurial (not hg.py)?
UPDATE
I've found a suitable work around for now. Since TortoiseHG does work with mercurial_keyring, I've simply changed my PATH setup to include the tortoiseHG folder, but not c:\mercurial. Now when I type "hg" at the command line, it's using the hg.exe in the tortoiseHG folder, which works fine. Just the same, this is still a problem with mercurial extensions on Win 7 x64. Answers welcome.

Answering my own question with my previous update, since there are no other takers yet.
Suitable workaround: Since TortoiseHG does work with mercurial_keyring, I've simply changed my PATH to include the tortoiseHG folder, and exclude c:\mercurial. Now when I type "hg" at the command line, it's using the hg.exe in the tortoiseHG folder, which works fine with the keyring.

I'm using:
on Windows Server 2008 SP2 x86:
Python 2.6.5 x86
Mercurial 1.5.1 x86
TortoiseHg 1.0.1 x86
on Windows Server 2008 R2:
Python 2.6.5 x86
Mercurial 1.5.1 x86
TortoiseHg 1.0.1 x64
On both setups, all configured extensions are loaded without errors.
All tools are installed using the installers provided on their sites. Mercurial appears before TortoiseHg in PATH. I'm using a common configuration file ~/.hgrc for both tools, and a Mercurial.ini file in TortoiseHg installation folder that is loading just the mercurial_keyring extension.
On the command line I have to input the password every time it's needed, but in TortoiseHg the keyring extensions it's fully working.
From the Keyring Extension page on the Mercurial wiki:
If you are on Windows, we recommend you use TortoiseHg. THG ships with Windows specific keyring backends, without which the mercurial-keyring extension cannot function properly on Windows.
UPDATE http://asimilatorul.com/adapter/post/using-mercurial_keyring-extension-with-mercurial-on-windows/
You can copy the required files from TortoiseHg's library.zip into Mercurial's library.zip:
hgext\mercurial_keyring.pyo
keyring__init__.pyo
keyring\backend.pyo
keyring\core.pyo
win32_crypto.pyd

The extension page states that TortoiseHG has some additional components to make it work on Windows and that it doesn't work properly without them. It sounds like the workaround of referencing the TortoiseHG version may be the easiest way to get it working on Windows.

Related

How to install GnuPlot on windows?

A Unix (mac/Linux) user who has been forced to work on a windows machine here :)
I have scripted loads of work in GnuPlot and don't want to switch to other programs at this moment. I would appreciate it if you could help me know how to install GnuPlot On windows (more specifically windows 10). questions:
I know there are two options according to this page, Cygwin and MinGW. which one is better?
I have MinGW installed and I know I need to install one of the options from this page but I don't know which one(s)! and how.
I have searched the internet but it seems most of the search results are for compiling. I don't want to go through compiling and all the hassle.
I tried installing the binary from this link, and when I try to run the program this is the error I get:
Unable to execute file:
C:\Program Files\gnuplot\bin\wgnuplot.exe
CreatProcess failed; Code267.
The directory name is invalid.
I would appreciate it if you could give me a very simple stepwise installation (1 2 3 ...), preferably with visuals, and instructions.
P.S. A nice way to install Free, Libre, and Open Source Software (FLOSS) on Windows and keep them updated, is to use package managers like Chocolatey. There are GnuPlot chocolatey packages here. Just install choco as instructed here. Then use choco install Gnuplot to have the software installed.
You don't have to install MinGW or Cygwin. Actually packages compiled in MinGW are compatible with Windows. Just download the binary of gnuplot from Their repo and you are good to go.
Additional points:
When installing, check which terminals you want to set up; also
check if you want the installer to add the PATH variable to your
system. Also, create a desktop shortcut.
After installation, you should see the desktop shortcut. Clicking on it should open a terminal-based gnuplot (which hopefully you are familiar with).
Please note that I have used the x11 terminal (you can get this working by installing xming). There are other options such as windows and qt terminals, but I am not an expert on using these.
You should have Administrator rights on this machine.
Right click on MinGW, Run as Administrator, install - should be OK.
Good luck!
BR, Alex
You can try
$~ scoop install gnuplot
Installing 'Gnuplot' (5.4.5) [64bit] from main bucket
gp545-win64-mingw.7z (37.7 MB) [=======================================] 100%
Checking hash of gp545-win64-mingw.7z ... ok.
Extracting gp545-win64-mingw.7z ... done.
Linking ~\scoop\apps\Gnuplot\current => ~\scoop\apps\Gnuplot\5.4.5
Creating shim for 'gnuplot'.
Creating shortcut for GNUPlot (wgnuplot.exe)
'Gnuplot' (5.4.5) was installed successfully!

Where is the source code for gcc-g++ stored on windows when installing through Cygwin?

I installed gcc-g++ through Cygwin on Windows 10. If you've ever used Cygwin on Windows, just before installing, it provides a huge list of different applications that can be used with it. Most of them, in addition to checking their install box, you can also check the source code box. I assumed this meant that it stores the source code of the application so that we can review it in order to understand how it's working.
I checked the box for gcc-g++, and I checked their source code box. However, when looking through the Cygwin installation folder, I can't seem to find where the source code is for the gcc-g++ application.
I was hoping that someone out there knew what folder their source code is stored in when installing through Cygwin to a Windows machine.
Thank you.
all cygwin source packages should be installing under /usr/src.

Multiple parallel MSys/MingW installations on Windows

when installing MSysgit, also MSys (as the name suggests) is installed on my machine.
When I additionally install DevKit for Ruby, yet another copy of MSys is installed on my computer. When installing the Haskell Platform for Windows, again another copy of MSys is installed on my machine. Is there any way of installing MSys/mingw once and tell all other software to do a lookup in the Path?
The version of msys that is included in the Git for Windows package is modified and if you attempt to replace it with a stock msys package you will run into problems. I can't comment on the other packages but basically - it is not worth worrying about. Disk space is significantly cheaper than the time you spend trying to make a number of independent packages share a common msys platform.
However, there are in fact people working on trying to sort that out. msys now has a package management system and I know of at least one project attempting to get the Git for Windows build environment working withing that system mingwGitDevEnv.

Command-line svn for Windows?

Is there a command-line based version of svn for Windows? I know I can get TortoiseSVN, but that just doesn't work for me.
TortoiseSVN contains a console svn client, but by default the corresponding option is not enabled during installation.
The svn.exe executable is not standalone and it depends on some other files1 in the distribution but this should not be a problem in most cases.
Once installed you might need to add the folder containing svn.exe to the system PATH as described here so that it is available in your console. To check if it was already added by the installer open a new console and type echo %PATH%. Use set on its own to see all environmental variables.
1 for the svn* executables in TortoiseSVN 1.14.1, the following files are required on the PATH:
intl3_tsvn.dll
libaprutil_tsvn.dll
libapr_tsvn.dll
libsasl.dll
libsvn_tsvn.dll
The subversion client itself is available on Windows. See here for certified binaries from CollabNet.
CollabNet Subversion Command-Line Client v1.6.9 (for Windows)
This installer only includes the command-line client and an auto-update component.
Even though I can't understand it's possible not to love Tortoise! :)
Note:
The above link is for newer products - you can find version 1.11.1 through 1.7.19 at Older Subversion Releases
I've used sliksvn and it works great for me
cygwin is another option. It has a port of svn.
You can get SVN command-line tools with TortoiseSVN 1.7 or later or get a 6.5mb standalone package from VisualSVN.
Starting with TortoiseSVN 1.7, its installer provides you with an option to install the command-line tools.
It also makes sense to check the Apache Subversion "Binary Packages" page. xD
VisualSVN for Windows has a command-line-only executable (as well Visual Studio plugins).
See https://www.visualsvn.com/downloads/
It is completely portable, so no installation is necessary.
As Damian noted here Command line subversion client for Windows Vista 64bits TortoiseSVN has command line tools that are unchecked by default during installation.
You can use Apache Subversion. It is owner of subversion . You can download from here . After install it, you have to restart pc to use svn from command line.
If you have Windows 10 you can use Bash on Ubuntu on Windows to install subversion.
Install MSYS2, it has svn in its repository (besides lots of other Unix goodies). MSYS2 installs without Windows Admin rights.
$ pacman -S svn
The tools can be used from cmd, too:
C:\>C:\msys64\usr\bin\svn.exe co http://somehost/somerepo/

How do I manually install an old cygwin package?

A project I am working on requires an old version of SLAPD (the LDAP
server) and must run on Windows, hence I am using cygwin packages:
I've found a binary package of slapd version I need 2.2.x here:
http://www.mirrorservice.org/sites/sourceware.org/pub/cygwin/release/...
How do I manually install it in cygwin? It does not seem to be a package-manager file format (like an RPM or a Deb), but is there a tool to install it for me?
FYI, I'm operating behind a corporate firewall that prevents me from viewing the main cygwin site (including the documentation), so please nobody tell me to RTFM - I wish I could!
Thanks
If you need an older version, the Cygwin time machine might help. To use it, I had to invoke setup.exe from the command line, giving it the --no-verify/-X option and it still wouldn't let me downgrade the "cygwin" package itself but at least it is, albeit very slowly, allowing me to install the version I wanted to test as a parallel installation.
If you are using the cygwin package installer to install this package, usually if you select to view the full info and scroll to the package you need you will see some info about the version.
Now if you click on the version number you will see that it changes from the oldest in the repository to the current. If your repository has the version you need then just finish the wizard.
Some cygwin mirrors keep old package files, for example, http://mirror.isoc.org.il/pub/cygwin/
You can use Sonatype nexus to mirror an existing cygwin repository, but provide your own setup.ini .
Copy the already downloaded repo content to c:\progs\nexus\sonatype-work\nexus\storage\mirror.isoc.org.il-pub-cygwin\
Put your own setup.ini and setup.bz2 there.
Start setup.exe with --no-verify
Paste
http://localhost:8081/nexus/content/repositories/mirror.isoc.org.il-pub-cygwin/
into the mirror selection box and click "Add"

Resources