Ticket #3 (closed task: fixed)

Opened 2 years ago

Last modified 13 months ago

Merge Win32 branch

Reported by: chris Owned by: chris
Priority: normal Milestone: 0.11
Component: bbackupd Version: trunk
Keywords: windows win32 merge branch Cc:

Description

The changes from the General branch need to be merged into trunk, or rejected.

Merge via the Merge branch for review and testing.

Change History

Changed 2 years ago by martin

  • owner changed from ben to chris
  • type changed from defect to task

Changed 2 years ago by chris

Changed 2 years ago by chris

Changed 2 years ago by chris

Changed 2 years ago by chris

Changed 2 years ago by chris

Changed 2 years ago by chris

Please review [821]

Changed 2 years ago by chris

Please review [825]

Changed 2 years ago by chris

Please review [827]

Changed 2 years ago by chris

Please review [829]

Changed 2 years ago by chris

Please review [831]

Changed 2 years ago by chris

Please review 832

Changed 2 years ago by chris

Please review [833]

Changed 2 years ago by martin

  • owner changed from chris to martin
  • status changed from new to assigned

[817] ok to merge

[814] ok to merge

[798] ok to merge but lines 277 to 283 (catch BoxException?) are redundant because BoxException? is derived from std::exception.

[749] ok to merge

Changed 2 years ago by martin

  • owner changed from martin to chris
  • status changed from assigned to new

Changed 2 years ago by chris

Please review [835]

Changed 2 years ago by chris

Thanks Martin, I've merged 817, 814, 798 (with change) and 749.

Changed 2 years ago by martin

Ok to merge: [821] [825] [827] [829] [831] [832]

Changed 2 years ago by martin

Ok to merge: [833] [835]

Excepting [819] queried on -dev, up to date at this point.

Changed 2 years ago by chris

Thanks again Martin, please review [840].

Changed 2 years ago by chris

All merged to date except [819] and [840].

Changed 2 years ago by chris

Please review [860]

Changed 2 years ago by chris

Please review [861]

Changed 2 years ago by chris

(In [863]) * bin/bbstored/BackupStoreDaemon.h - Reinstate SendMessageToHousekeepingProcess?() on Win32, but make it do

nothing (refs #3)

Changed 2 years ago by chris

Please review [862] and [863]

Changed 2 years ago by chris

(In [864]) * configure.ac

Revert to trunk (refs #3)

Changed 2 years ago by chris

(In [867]) * docs/backup/win32_build_on_linux_using_mingw.txt (refs #3)

Updated documentation for building Win32 native builds on Linux

Changed 2 years ago by chris

(In [869]) * infrastructure/BoxPlatform.pm.in

Determine whether we are building for Windows or not, and export that information

Search for VERSION.txt in a few more places, for example when running Perl scripts like getversion.pl

(refs #3)

Changed 2 years ago by chris

(In [871]) * infrastructure/buildenv-testmain-template.cpp

Record the file and line of first test failure, and print them at the end of the test, useful for debugging when the first failure has scrolled off screen (refs #3)

Changed 2 years ago by chris

(In [873]) * infrastructure/makebuildenv.pl.in

Support multiple implicit dependencies

Add lib/win32 as an implicit dependency on Win32

Make lib/common depend on lib/win32 on Win32

Fix space between test file name platform executable extension, and between executable name and arguments, in test shell scripts

Add support for compiling resource files (.rc) on Win32

Fix dependencies to avoid unnecessary rebuilds when not using BSD make

Code cleanups

Fix typos

(refs #3)

Changed 2 years ago by chris

(In [875]) * lib/backupclient/BackupClientFileAttributes.cpp

Don't call geteuid() on Win32, since it's emulated, always returns 0, and I want to remove it entirely (refs #3)

Changed 2 years ago by chris

(In [877]) * lib/backupclient/BackupStoreFile.cpp

Close file before trying to apply attributes to it. Otherwise, when we close it the timestamp will be updated on Win32 (refs #3)

Changed 2 years ago by chris

(In [879]) * lib/backupclient/BackupStoreObjectDump.cpp

Fix format strings on Win32 (refs #3)

Changed 2 years ago by chris

Please review [881]

Changed 2 years ago by chris

(In [883]) Use DIRECTORY_SEPARATOR instead of assuming that it's a forward slash (refs #3)

Changed 2 years ago by chris

(In [885]) Disable intercept tests on Win32 as well

Define O_BINARY to 0 (zero) if our platform doesn't have it (all except Win32?) which enables us to reduce #ifdefs

(refs #3)

Changed 2 years ago by chris

  • cc chris+boxbackup@… removed

Changed 2 years ago by chris

(In [887]) Make FDGETLINE_BUFFER_SIZE big enough for one unicode character on Win32, otherwise reading from console can fail due to insufficient buffer size. (refs #3)

Changed 2 years ago by chris

(In [889]) Add O_BINARY to default flags, since most files opened this way should be opened in binary mode on Win32 (refs #3)

Changed 2 years ago by chris

(In [892]) Disable all calls to set*id() on Win32 (doesn't work) (refs #3)

Changed 2 years ago by chris

(In [894]) (refs #3)

Don't include headers that we don't have

Open RAID files in binary mode

Changed 2 years ago by chris

(In [896]) (refs #3)

Open files in binary mode (Win32)

Disable the lock failure block when we don't have any locking mechanism

Close and delete files before renaming over them on Win32. This breaks Ben's desired recovery semantics, so it's not done on other platforms, but Win32 requires it.

Changed 2 years ago by martin

Ok to merge: [860] [863] [881]

[861] is ok except for the unnecessary call to Close as mailed.

[862] is ok but now the file is being deleted twice (once inside the try/catch block and once after). Should remove the one outside the try/catch.

Still outstanding: [840]

Changed 2 years ago by chris

(In [898]) (refs #3)

Initialise Windows sockets automatically for all daemons on Win32

Write PID files on Win32

Changed 2 years ago by chris

(In [900]) (refs #3)

64-bit format fixes (Win32)

Changed 2 years ago by chris

(In [902]) (refs #3)

Added an OnIdle? method which can be overridden by subclasses for idle tasks. Used for housekeeping on Win32.

Avoid forking on Win32, and trying to clean up after children.

Changed 2 years ago by chris

Sorry, please review [865] instead of [864]

Changed 2 years ago by chris

(In [904]) (refs #3)

Define a suitable constant for invalid socket handles, for use in SocketStream?.cpp

Changed 2 years ago by chris

Please review [906]

Changed 2 years ago by chris

(In [908]) (refs #3)

Added support for non-blocking sockets on Win32 as well

Changed 2 years ago by chris

(In [910]) (refs #3)

Use strict and warnings for code safety.

Exit with status 2 on invalid usage.

Allow running multiple tests, comma separated.

Exit with status 2 if make fails for any test.

Exit with status 1 if any test fails.

Changed 2 years ago by chris

(In [912]) (refs #3)

Use truncation/sparse files to quickly create files with 200MB of zeroes

Changed 2 years ago by chris

(In [913]) (refs #3)

64-bit format string fixes for Win32

Changed 2 years ago by chris

(In [914]) (refs #3)

Use CopyFile? to copy on Windows, instead of shelling out to cp, which doesn't understand native paths.

Changed 2 years ago by chris

(In [915]) (refs #3)

Close open file handles on Win32

Changed 2 years ago by chris

(In [916]) (refs #3)

Completely disable symlink test on Win32

Changed 2 years ago by chris

(In [917]) (refs #3)

Cosmetic fixes to comments

Changed 2 years ago by chris

(In [918]) (refs #3)

This test takes a long time on Win32 (slow file access? VMware?), so:

  • Disable verbose debug logging, which makes it even slower
  • Print a warning before the slow test starts
  • Increase timeout

Changed 2 years ago by chris

(In [920]) (refs #3)

Close before unlink

Check that unlink succeeds

Changed 2 years ago by chris

(In [921]) (refs #3)

We cannot open multiple connections to the server on Win32, so work around.

Changed 2 years ago by chris

(In [922]) (refs #3)

Use correct directory separator everywhere

Changed 2 years ago by chris

(In [923]) (refs #3)

Disable symlink tests on Win32

Changed 2 years ago by chris

(In [927]) (refs #3)

Convert UNIX paths to native on Win32 (avoids #ifdefs in tests)

Changed 2 years ago by chris

(In [928]) (refs #3)

Disable tests for memory leaks after killing bbstored on Win32, since it dies forcibly without a chance to write the memory leak file.

Initialise Windows sockets on Win32

Add tests for multiply open files on Win32

Changed 2 years ago by chris

(In [930]) (refs #3)

Remove newlines from output to avoid failure to recognise it on Win32

Changed 2 years ago by chris

(In [931]) (refs #3)

Added a RunCommand?() function which converts UNIX paths to native before calling ::system() on Win32.

Changed 2 years ago by chris

(In [932]) (refs #3)

Call RunCommand?() instead of ::system to handle native paths better

Changed 2 years ago by chris

(In [934]) (refs #3)

Initialise Windows sockets on Win32

Changed 2 years ago by chris

(In [935]) (refs #3)

Fix format strings on Win32

Changed 2 years ago by chris

(In [936]) (refs #3)

Cannot signal bbstored to housekeep immediately on Win32, so just wait for it to happen.

Changed 2 years ago by chris

(In [937]) (refs #3)

Don't check for memory leaks on Win32, since the process is force killed and doesn't have a chance to write the log file.

Changed 2 years ago by chris

(In [938]) (refs #3)

Use RunCommand? instead of ::system to convert UNIX paths to native

Changed 2 years ago by chris

(In [940]) (refs #3)

Sleep without nanosleep() on Win32

Changed 2 years ago by chris

(In [941]) (refs #3)

Automatically initialise Windows sockets for all tests

Changed 2 years ago by chris

(In [942]) (refs #3)

Reorganise typedefs for clarity

Changed 2 years ago by chris

(In [943]) (refs #3)

Remove dependency on Box.h and hence on lib/common

Changed 2 years ago by chris

(In [944]) (refs #3)

Add message definitions and resource files

Changed 2 years ago by chris

(In [945]) (refs #3)

Include message resource definitions

Changed 2 years ago by chris

(In [946]) (refs #3)

Add BSD-licensed getopt.h to replace our own version

Changed 2 years ago by chris

(In [947]) (refs #3)

Use our own ConvertUtf?8ToWideString for simplicity

Changed 2 years ago by chris

(In [948]) (refs #3)

Convert UNIX to native paths

Changed 2 years ago by chris

(In [949]) (refs #3)

Return INVALID_HANDLE_VALUE instead of NULL from openfile() on failure

Changed 2 years ago by chris

(In [950]) (refs #3)

Use INVALID_HANDLE_VALUE instead of NULL for invalid handles on Win32

Changed 2 years ago by chris

(In [951]) (refs #3)

Improved handling of UNIX flags to openfile(), allows multiple opens

Changed 2 years ago by chris

(In [952]) (refs #3)

Improved error handling in emu_fstat

Changed 2 years ago by chris

(In [953]) (refs #3)

Always fill in st_uid, st_gid and st_nlink

Return zero size for directories

Improved emulation of Unix file modes (helps when restoring Windows files on Unix)

Changed 2 years ago by chris

(In [954]) (refs #3)

Pass requested open flags to OpenFileByNameUtf?8

Changed 2 years ago by chris

(In [955]) (refs #3)

Request READ_CONTROL when standard open fails, rather than no flags

Changed 2 years ago by chris

(In [956]) (refs #3)

Treat PATH_NOT_FOUND just like FILE_NOT_FOUND in Unix land (errno = ENOENT)

Changed 2 years ago by chris

(In [957]) (refs #3)

Added emulated utimes, chmod, readv and writev

Added useful utility functions ConvertFileTimeToTime?_t and ConvertTime?_tToFileTime

Changed 2 years ago by chris

(In [958]) (refs #3)

Removed last vestiges of old getopt()

Changed 2 years ago by chris

(In [959]) (refs #3)

Improved poll() emulation to handle multiple fds

Changed 2 years ago by chris

(In [960]) (refs #3)

Fixed looking up message source in syslog()

Flush stdout after writing to it

Allow syslog() to log to console even when openlog() has not been called

Changed 2 years ago by chris

(In [961]) (refs #3)

Emulated chdir, mkdir and unlink should handle file names in UTF-8 as well

Changed 2 years ago by chris

(In [962]) (refs #3)

Emulate readdir's d_type field

Changed 2 years ago by chris

(In [963]) (refs #3)

Remove more vestiges of old getopt

Changed 2 years ago by chris

(In [964]) (refs #3)

Added prototypes for new emulated functions emu_utimes, readv and writev

Changed 2 years ago by chris

(In [965]) (refs #3)

Remove inline ConvertFileTimeToTime?_t, add prototypes for new versions in emu.cpp

Changed 2 years ago by chris

(In [966]) (refs #3)

Changed WideSize? from int to size_t

Don't allow space for null terminator that will not be added

Changed 2 years ago by chris

(In [968]) (refs #3)

Fixed typo

Changed 2 years ago by chris

Hi Martin,

Currently outstanding as I understand it:

Changed 2 years ago by martin

[865] ok [867] ok [869] please use $OSNAME (probably need 'use English' too), $O is horrible, go ahead & merge when you've made that change [871] ok, or you could give -l 10000 to xterm :-) (maybe not so easy in mswin) [873] ok [877] ok [879] ok [883] ok [885] ok [887] ok [889] ok [894] ok

Changed 2 years ago by martin

(Just reformatting)

Changed 2 years ago by chris

(In [981]) * Close file before trying to apply attributes to it. Otherwise, when we close it the timestamp will be updated on Win32 (refs #3)

Changed 2 years ago by chris

Thanks Martin! Please ignore [981].

Merged [865] [867] [869] [871] [873] [877] [879] [883] [885] [887] [889] [894] into trunk.

Changed 2 years ago by chris

Merged [861] [863] [881] to trunk.

Changed 2 years ago by martin

Changed 2 years ago by chris

(In [995]) * Added support for non-blocking sockets on Win32 as well (TODO revisit #ifdefs: refs #3)

Changed 2 years ago by chris

Changed 2 years ago by chris

Please review [1013] [1014] [1015] [1016] for merge.

Changed 2 years ago by chris

Please review [1017] for merge.

Changed 2 years ago by chris

(In [1019]) * Comment grammar fix (refs #3)

Changed 2 years ago by chris

Sorry, please ignore [1019].

Changed 2 years ago by chris

(In [1022]) * Use readdir's d_type field to determine type of directory entry without

statting the entry, which allows users to exclude unreadable entries to suppress warnings about them on Win32 (refs #3)

Changed 2 years ago by chris

(In [1026]) * Apply Box coding standards (refs #3)

Changed 2 years ago by chris

(In [1027]) * Replace global daemon object with a pointer, to allow deletion and

clean up reported memory leaks

  • No need to initialise Winsock here, now that lib/server/Daemon does it for us
  • Initialise logging properly (refs #3)

Changed 2 years ago by chris

(In [1029]) * Apply Box coding standards (refs #3, replaces [1026])

Changed 2 years ago by chris

(In [1030]) * Catch invalid output from sync allow script and tell the user what it

was, to help them debug the problem (refs #3)

Changed 2 years ago by chris

(In [1031]) * Replace global daemon object with a pointer, to allow deletion and

clean up reported memory leaks (refs #3, combine with [1027])

Changed 2 years ago by chris

(In [1032]) * Operator precedence fix (refs #3)

Changed 2 years ago by chris

(In [1035]) * Fix compile error caused by conflicting MSVC macros (refs #3)

Changed 2 years ago by chris

(In [1036]) * Add option to bbackupquery list command to show times in UTC or local time

(refs #3)

Changed 2 years ago by chris

(In [1037]) Use BoxPlatform? to see if we are building on Windows (refs #3)

Changed 2 years ago by chris

(In [1049]) Allow getting an object with a path, not just from the current directory (refs #3)

Changed 2 years ago by chris

(In [1050]) Convert command-line arguments from the system locale/character set to the console character set (code page), so they they can be converted from console to UTF-8 (yuck).

Don't try to read from stdin or change its code page when it's not open (invalid file handle) (refs #3)

Changed 2 years ago by chris

(In [1051]) Convert command-line arguments from the system locale/character set to the console character set. (refs #3, combine with [1050])