import tarfile
import subprocess
import shutil
+import time
def next_build_number():
try:
return configuration
+
def get_target_path(release, arch, debug):
configuration = get_configuration(release, debug)
name = ''.join(configuration.split(' '))
return target_path
-def shell(command):
+def shell(command, dir):
+ print(dir)
print(command)
sys.stdout.flush()
+
+ sub = subprocess.Popen(' '.join(command), cwd=dir,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ universal_newlines=True)
- pipe = os.popen(command, 'r', 1)
-
- for line in pipe:
+ for line in sub.stdout:
print(line.rstrip())
- return pipe.close()
+ sub.wait()
+
+ return sub.returncode
class msbuild_failure(Exception):
os.environ['FILE'] = file
os.environ['EXTRA'] = args
- cwd = os.getcwd()
- bin = os.path.join(cwd, 'msbuild.bat')
-
- print(bin)
- print(dir)
+ bin = os.path.join(os.getcwd(), 'msbuild.bat')
- os.chdir(dir)
- status = shell(bin)
- os.chdir(cwd)
+ status = shell([bin], dir)
- if (status != None):
+ if (status != 0):
raise msbuild_failure(configuration)
+
def build_sln(name, release, arch, debug):
configuration = get_configuration(release, debug)
msbuild(platform, configuration, 'Build', name + '.sln', '', 'proj')
+
def remove_timestamps(path):
try:
os.unlink(path + '.orig')
dst.close()
src.close()
+def sdv_clean(name):
+ path = ['proj', name, 'sdv']
+ print(path)
+
+ shutil.rmtree(os.path.join(*path), True)
+
+ path = ['proj', name, 'sdv.temp']
+ print(path)
+
+ shutil.rmtree(os.path.join(*path), True)
+
+ path = ['proj', name, 'staticdv.job']
+ print(path)
+
+ try:
+ os.unlink(os.path.join(*path))
+ except OSError:
+ pass
+
+
def run_sdv(name, dir):
configuration = get_configuration('Windows 8', False)
platform = 'x64'
msbuild(platform, configuration, 'Build', name + '.vcxproj',
'', os.path.join('proj', name))
- msbuild(platform, configuration, 'sdv', name + '.vcxproj',
- '/p:Inputs="/clean"', os.path.join('proj', name))
+
+ sdv_clean(name)
+
msbuild(platform, configuration, 'sdv', name + '.vcxproj',
'/p:Inputs="/check:default.sdv"', os.path.join('proj', name))
path = ['proj', name, name + '.DVL.XML']
shutil.copy(os.path.join(*path), dir)
+
def symstore_del(name, age):
symstore_path = [os.environ['KIT'], 'Debuggers']
if os.environ['PROCESSOR_ARCHITECTURE'] == 'x86':
command.append('/s')
command.append(os.environ['SYMBOL_SERVER'])
- shell(' '.join(command))
+ shell(command, None)
+
def symstore_add(name, release, arch, debug):
- cwd = os.getcwd()
target_path = get_target_path(release, arch, debug)
symstore_path = [os.environ['KIT'], 'Debuggers']
os.environ['MICRO_VERSION'],
os.environ['BUILD_NUMBER']])
- os.chdir(target_path)
command=['"' + symstore + '"']
command.append('add')
command.append('/s')
command.append('/v')
command.append(version)
- shell(' '.join(command))
-
- os.chdir(cwd)
+ shell(command, target_path)
-def callfnout(cmd):
- print(cmd)
+def manifest():
+ cmd = ['git', 'ls-tree', '-r', '--name-only', 'HEAD']
sub = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output = sub.communicate()[0]
if __name__ == '__main__':
debug = { 'checked': True, 'free': False }
+ sdv = { 'nosdv': False, None: True }
driver = 'xennet'
os.environ['MAJOR_VERSION'] = '7'
symstore_add(driver, release, 'x86', debug[sys.argv[1]])
symstore_add(driver, release, 'x64', debug[sys.argv[1]])
- if len(sys.argv) <= 2 or sys.argv[2] != 'nosdv':
- run_sdv(driver, driver)
+ if len(sys.argv) <= 2 or sdv[sys.argv[2]]:
+ run_sdv('xennet', driver)
- listfile = callfnout(['git','ls-tree', '-r', '--name-only', 'HEAD'])
- archive(driver + '\\source.tgz', listfile.splitlines(), tgz=True)
+ archive(driver + '\\source.tgz', manifest().splitlines(), tgz=True)
archive(driver + '.tar', [driver,'revision'])
* SUCH DAMAGE.
*/
-#ifndef _XENVIF_ASSERT_H
-#define _XENVIF_ASSERT_H
+#ifndef _XENNET_ASSERT_H
+#define _XENNET_ASSERT_H
#include <ntddk.h>
#else // DBG
-#define ASSERT(_EXP)
-#define ASSERT3U(_X, _OP, _Y)
-#define ASSERT3S(_X, _OP, _Y)
-#define ASSERT3P(_X, _OP, _Y)
+#pragma warning(disable:4100)
+
+#define ASSERT(_EXP) \
+ do { \
+ __analysis_assume(_EXP); \
+ } while (FALSE)
+
+#define ASSERT3U(_X, _OP, _Y) \
+ ASSERT(_X _OP _Y)
+
+#define ASSERT3S(_X, _OP, _Y) \
+ ASSERT(_X _OP _Y)
+
+#define ASSERT3P(_X, _OP, _Y) \
+ ASSERT(_X _OP _Y)
#endif // DBG
#define IMPLY(_X, _Y) (!(_X) || (_Y))
#define EQUIV(_X, _Y) (IMPLY((_X), (_Y)) && IMPLY((_Y), (_X)))
-#endif // _XENVIF_ASSERT_H
+#endif // _XENNET_ASSERT_H