Skip to content

Conversation

@amon-ra
Copy link

@amon-ra amon-ra commented Apr 26, 2014

I have added some patches to support windows backups.
I tried to backup local and to remote linux server and it is working ok.

@amon-ra
Copy link
Author

amon-ra commented Apr 26, 2014

To compile I have used Python 3.3, Visual Studio Express 2010 and Openssl package.
The host is a virtualbox machine with Windows XP (32 bit).
Sorry I do not think it can work on 64 bit for now

@jborg
Copy link
Owner

jborg commented Apr 29, 2014

Windows support has never been a planned feature for Attic, but you've showed that it is possible.
But I'm a bit worried about the amount of platform specific code required.

Before I can start to merge any windows specific changes I need to get myself a windows development environment so I can test this myself. Hopefully the win8 VM I have on my laptop will do the job.
Could you outline the steps needed to build your branch?

Btw, does the testsuite pass?

python -m attic.testsuite.run -v

@amon-ra
Copy link
Author

amon-ra commented May 5, 2014

To compile I use a Windows 7 virtual machine.

           set DISTUTILS_USE_SDK=1
           setenv /x64 /release (if you are building to x64)
           perl Configure VC-WIN64A --prefix=C:\OpenSSL-Win64
           ms\do_win64a
           nmake -f ms\nt.mak
           nmake -f ms\nt.mak install           
  • copy scripts/attic to attic.py in source root.
  • cd to attic dir and generate instalable:
           python setupwin.py build
           python setupwin.py bdist_msi
  • msi is in dist folder.

Hope it helps, Test are not ported I will paste the log in another post

@mappu
Copy link

mappu commented Oct 14, 2014

Python 3.4 is supported as of cx_freeze 4.3.2, released 2013-10-23.

You may find it easier to build the native windows binary using MSYS2's mingw toolchain instead of Visual Studio. It's a much easier way of sourcing runtime + buildtime dependencies. This has a slightly different platform triple and some more linux-like defines so some of the platform-specific modifications are probably no longer necessary.

Building attic with MSYS2:

  1. pacman -Syu
  2. pacman -S mingw-w64-i686-python3 mingw-w64-i686-python3-pip
  3. pip3 install cython (or might be easier to pacman -S mingw-w64-i686-cython)
  4. pip3 install cx_freeze
  5. pip3 install msgpack-python
  6. pip3 install psutil
  7. Changes to setupwin.py
    • 32: libraries array, REPLACE 'libeay32','ssleay32', WITH 'ssl', 'ws2_32', 'gdi32', 'crypt32', 'crypto' as per output of pkg-config --libs openssl
    • 37: Use "mingw" string instead of sys.platform
    • 101: Add , '/msys32/mingw32/' to possible_openssl_prefixes in setupwin.py:101
  8. Changes to attic/_hashindex.c
    • 32-35: Comment out int typedefs as stdint.h is now present
  9. python3 setupwin.py build

@zapu
Copy link

zapu commented Nov 28, 2014

Are there any plans on integrating Windows support into the "official" codebase? I've already had some success in compiling on Windows thanks to @amon-ra guide, but AFAIR I had to comment out locking to get it to actually process files.

@anarcat
Copy link

anarcat commented Dec 16, 2014

i guess until issues such as commenting out code are resolved, chances would be pretty dim. even the CI environment (travis-ci) doesn't build on windows...

Now builds with python 3.4 and Visual Studio 2010.
Added compat layer to mmap, added castings to supress VS errors.
Fixed some bugs and now is running all operations with local type.
Must test with ssh.
Tests are broken in windows. Sorry.
Patched select funcition and using ssh from cygwin, now remote backup
working to linux host
We use select only on liinux but import must be
Sorry fixed setup in linux, added missing files and declarations
Added another setup file to generate exe
Fixed some silly bugs
add parameter to set ssh command
include ssh in contrib folder
Fixed compilation on Windows 7 64. Steps:
To compile I use a Windows 7 virtual machine.
- Installed python 3.3 (Python 3.4 is broken with cx_freeze)
- Install pywin32, cython, msgpack and cx_freeze from
http://www.lfd.uci.edu/~gohlke/pythonlibs/
- Install activeperl (I used ActivePerl-5.16.3.1604-MSWin32-x64-298023)
- Download openssl source 1.0.1g.
- Install Windows 7 SDK (python is compiled with these):
http://www.microsoft.com/en-us/download/details.aspx?id=8279
- Open SDK Console window and execute (extracted from cython page):
```
set DISTUTILS_USE_SDK=1
setenv /x64 /release (if you are building to x64)
```
- Install openssl
(http://developer.covenanteyes.com/building-openssl-for-visual-studio/),
in openssl dir do:
```
perl Configure VC-WIN64A --prefix=C:\OpenSSL-Win64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
```
- copy scripts/attic to attic.py in source root.
- cd to attic dir and generate instalable:
```
python setupwin.py build
python setupwin.py bdist_msi
```
- msi is in dist folder.
Fixed:
- Regular expresions.
- Async read/writes.

Transfer is broken in windows shares. hashindex_open is not closing fd?
Fixed list command with rsh parameter.
Add portable locking mode. Now portalonking and win32 are dependencies.
Now builds with python 3.4 and Visual Studio 2010.
Added compat layer to mmap, added castings to supress VS errors.
Fixed some bugs and now is running all operations with local type.
Must test with ssh.
Tests are broken in windows. Sorry.
Patched select funcition and using ssh from cygwin, now remote backup
working to linux host
We use select only on liinux but import must be
Sorry fixed setup in linux, added missing files and declarations
Added another setup file to generate exe
Fixed some silly bugs
add parameter to set ssh command
include ssh in contrib folder
Fixed compilation on Windows 7 64. Steps:
To compile I use a Windows 7 virtual machine.
- Installed python 3.3 (Python 3.4 is broken with cx_freeze)
- Install pywin32, cython, msgpack and cx_freeze from
http://www.lfd.uci.edu/~gohlke/pythonlibs/
- Install activeperl (I used ActivePerl-5.16.3.1604-MSWin32-x64-298023)
- Download openssl source 1.0.1g.
- Install Windows 7 SDK (python is compiled with these):
http://www.microsoft.com/en-us/download/details.aspx?id=8279
- Open SDK Console window and execute (extracted from cython page):
```
set DISTUTILS_USE_SDK=1
setenv /x64 /release (if you are building to x64)
```
- Install openssl
(http://developer.covenanteyes.com/building-openssl-for-visual-studio/),
in openssl dir do:
```
perl Configure VC-WIN64A --prefix=C:\OpenSSL-Win64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
```
- copy scripts/attic to attic.py in source root.
- cd to attic dir and generate instalable:
```
python setupwin.py build
python setupwin.py bdist_msi
```
- msi is in dist folder.
Fixed:
- Regular expresions.
- Async read/writes.

Transfer is broken in windows shares. hashindex_open is not closing fd?
Fixed list command with rsh parameter.
Add portable locking mode. Now portalonking and win32 are dependencies.
Now builds with python 3.4 and Visual Studio 2010.
Added compat layer to mmap, added castings to supress VS errors.
Fixed some bugs and now is running all operations with local type.
Must test with ssh.
Tests are broken in windows. Sorry.
Patched select funcition and using ssh from cygwin, now remote backup
working to linux host
We use select only on liinux but import must be
Sorry fixed setup in linux, added missing files and declarations
Added another setup file to generate exe
Fixed some silly bugs
add parameter to set ssh command
include ssh in contrib folder
Fixed compilation on Windows 7 64. Steps:
To compile I use a Windows 7 virtual machine.
- Installed python 3.3 (Python 3.4 is broken with cx_freeze)
- Install pywin32, cython, msgpack and cx_freeze from
http://www.lfd.uci.edu/~gohlke/pythonlibs/
- Install activeperl (I used ActivePerl-5.16.3.1604-MSWin32-x64-298023)
- Download openssl source 1.0.1g.
- Install Windows 7 SDK (python is compiled with these):
http://www.microsoft.com/en-us/download/details.aspx?id=8279
- Open SDK Console window and execute (extracted from cython page):
```
set DISTUTILS_USE_SDK=1
setenv /x64 /release (if you are building to x64)
```
- Install openssl
(http://developer.covenanteyes.com/building-openssl-for-visual-studio/),
in openssl dir do:
```
perl Configure VC-WIN64A --prefix=C:\OpenSSL-Win64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
```
- copy scripts/attic to attic.py in source root.
- cd to attic dir and generate instalable:
```
python setupwin.py build
python setupwin.py bdist_msi
```
- msi is in dist folder.
Fixed:
- Regular expresions.
- Async read/writes.

Transfer is broken in windows shares. hashindex_open is not closing fd?
This rolls back to commit f342621.
@rpodgorny
Copy link

where is the repo/branch for this? i'd like to give it a try...

@anarcat
Copy link

anarcat commented Feb 4, 2015

i am not sure exactly, this pull request is a little confusing as it says it comes from an "unknown repo", but you can see the patch here:

https://github.com/jborg/attic/pull/68.patch

@rpodgorny
Copy link

@anarcat thanks! but the patch is somewhat weird. it seems to apply and the unapply a lot of changes, resulting in a two line (mostly formatting) final diff. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants