##// END OF EJS Templates
packaging: stage files and dynamically generate WiX installer...
packaging: stage files and dynamically generate WiX installer Like we did for Inno, we want to make the WiX installer "dumb" and simply consume source files from a directory tree rather than have to define every single file in installer files. This will greatly decrease the amount of effort required to maintain the WiX installer since we don't have to think that much about keeping files in sync. This commit changes the WiX packager to populate a staging directory as part of packaging. After it does so, it scans that directory and dynamically generates WiX XML defining the content within. The IDs and GUIDs being generated are deterministic. So, upgrades should work as expected in Windows Installer land. (WiX has a "heat" tool that can generate XML by walking the filesystem but it doesn't have this deterministic property, sadly.) As part of this change, GUIDs are now effectively reset. So the next upgrade should be a complete wipe and replace. This could potentially cause issues. But in my local testing, I was able to upgrade an existing 5.1.2 install without issue. Compared to the previous commit, the installed files differ in the following: * A ReleaseNotes.txt file is now included * A hgrc.d/editor.rc file is now generated (mercurial.rc has been updated to reflect this logical change to the content source) * All files are marked as read-only. Previously, only a subset of files were. This should help prevent unwanted tampering. Although we may want to consider use cases like modifying template files... This change also means that Inno and WiX are now using very similar code for managing the install layout. This means that on disk both packages are nearly identical. The differences in install layout are as follows: * Inno has a Copying.txt vs a COPYING.rtf for WiX. (The WiX installer wants to use RTF.) * Inno has a Mercurial.url file that is an internet shortcut to www.mercurial-scm.org. (This could potentially be removed.) * Inno includes msvc[mpr]90.dll files and WiX does not. (WiX installs the MSVC runtime via merge modules.) * Inno includes unins000.{dat,exe} files. (WiX's state is managed by Windows Installer, which places things elsewhere.) Because file lists are dynamically generated now, the test ensuring things remain in sync has been deleted. Good riddance. While this is a huge step towards unifying the Windows installers, there's still some improvements that can be made. But I think it is worth celebrating the milestone of getting both Inno and WiX to essentially share core packaging code and workflows. That should make it much easier to change the installers going forward. This will aid support of Python 3. Differential Revision: https://phab.mercurial-scm.org/D7173

File last commit:

r40157:73fef626 default
r44022:94eac340 default
Show More
pool.h
84 lines | 2.5 KiB | text/x-c | CLexer
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 /*
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 * All rights reserved.
*
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 * This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 */
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 #ifndef POOL_H
#define POOL_H
#if defined (__cplusplus)
extern "C" {
#endif
#include <stddef.h> /* size_t */
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_customMem */
#include "zstd.h"
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895
typedef struct POOL_ctx_s POOL_ctx;
/*! POOL_create() :
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 * Create a thread pool with at most `numThreads` threads.
* `numThreads` must be at least 1.
* The maximum number of queued jobs before blocking is `queueSize`.
* @return : POOL_ctx pointer on success, else NULL.
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895 */
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 POOL_ctx* POOL_create(size_t numThreads, size_t queueSize);
Gregory Szorc
zstandard: vendor python-zstandard 0.10.1...
r40157 POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize,
ZSTD_customMem customMem);
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895
/*! POOL_free() :
Gregory Szorc
zstandard: vendor python-zstandard 0.10.1...
r40157 * Free a thread pool returned by POOL_create().
*/
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 void POOL_free(POOL_ctx* ctx);
Gregory Szorc
zstandard: vendor python-zstandard 0.10.1...
r40157 /*! POOL_resize() :
* Expands or shrinks pool's number of threads.
* This is more efficient than releasing + creating a new context,
* since it tries to preserve and re-use existing threads.
* `numThreads` must be at least 1.
* @return : 0 when resize was successful,
* !0 (typically 1) if there is an error.
* note : only numThreads can be resized, queueSize remains unchanged.
*/
int POOL_resize(POOL_ctx* ctx, size_t numThreads);
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 /*! POOL_sizeof() :
Gregory Szorc
zstandard: vendor python-zstandard 0.10.1...
r40157 * @return threadpool memory usage
* note : compatible with NULL (returns 0 in this case)
*/
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 size_t POOL_sizeof(POOL_ctx* ctx);
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895
/*! POOL_function :
Gregory Szorc
zstandard: vendor python-zstandard 0.10.1...
r40157 * The function type that can be added to a thread pool.
*/
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 typedef void (*POOL_function)(void*);
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895
/*! POOL_add() :
Gregory Szorc
zstandard: vendor python-zstandard 0.10.1...
r40157 * Add the job `function(opaque)` to the thread pool. `ctx` must be valid.
* Possibly blocks until there is room in the queue.
* Note : The function may be executed asynchronously,
* therefore, `opaque` must live until function has been completed.
*/
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque);
/*! POOL_tryAdd() :
Gregory Szorc
zstandard: vendor python-zstandard 0.10.1...
r40157 * Add the job `function(opaque)` to thread pool _if_ a worker is available.
* Returns immediately even if not (does not block).
* @return : 1 if successful, 0 if not.
*/
Gregory Szorc
zstandard: vendor python-zstandard 0.9.0...
r37513 int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque);
Gregory Szorc
zstd: vendor python-zstandard 0.7.0...
r30895
#if defined (__cplusplus)
}
#endif
#endif