mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 07:18:27 +01:00
daemon: fix daemon when running in binary mode
When running from binary, we need to fixup environment variables before launching new processes. We also need to detach from the parent tty, because otherwise it causes problems for PyInstaller. Plus, when binary is built as --onefile it still creates pop-up terminal on windows, so we need to switch to --onedir. Fixes #1446 Fixes #1444 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+14
-2
@@ -13,6 +13,7 @@ fi
|
||||
|
||||
BUILD_DIR=build
|
||||
BIN_DIR=$BUILD_DIR/$INSTALL_DIR/bin
|
||||
LIB_DIR=$BUILD_DIR/$INSTALL_DIR/lib
|
||||
|
||||
print_error()
|
||||
{
|
||||
@@ -40,7 +41,7 @@ fpm_build()
|
||||
{
|
||||
print_info "Building $1..."
|
||||
VERSION=$(python -c "import dvc; from dvc import VERSION; print(str(VERSION))")
|
||||
fpm -s dir -f -t $1 $FPM_FLAGS -n dvc -v $VERSION -C $BUILD_DIR $INSTALL_DIR
|
||||
fpm -s dir -f -t $1 $FPM_FLAGS -n dvc -v $VERSION -C $BUILD_DIR usr
|
||||
}
|
||||
|
||||
cleanup()
|
||||
@@ -78,7 +79,18 @@ install_dependencies()
|
||||
build_dvc()
|
||||
{
|
||||
print_info "Building dvc binary..."
|
||||
pyinstaller --onefile --additional-hooks-dir $(pwd)/scripts/hooks dvc/__main__.py --name dvc --distpath $BIN_DIR --specpath $BUILD_DIR
|
||||
pyinstaller \
|
||||
--additional-hooks-dir $(pwd)/scripts/hooks dvc/__main__.py \
|
||||
--name dvc \
|
||||
--distpath $LIB_DIR \
|
||||
--specpath $BUILD_DIR
|
||||
|
||||
$LIB_DIR/dvc/dvc --help
|
||||
|
||||
mkdir -p $BIN_DIR
|
||||
pushd $BIN_DIR
|
||||
ln -s ../lib/dvc/dvc dvc
|
||||
popd
|
||||
|
||||
$BIN_DIR/dvc --help
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ call pip install -r requirements.txt || goto :error
|
||||
call pip install pyinstaller || goto :error
|
||||
|
||||
echo ====== Building dvc binary... ======
|
||||
call pyinstaller --onefile --additional-hooks-dir scripts\hooks dvc/__main__.py --name dvc --specpath build
|
||||
call pyinstaller --additional-hooks-dir scripts\hooks dvc/__main__.py --name dvc --specpath build
|
||||
|
||||
echo ====== Copying additional files... ======
|
||||
copy scripts\innosetup\addSymLinkPermissions.ps1 dist\ || goto :error
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define MyAppVersion ReadIni(".\scripts\innosetup\config.ini", "Version", "version", "unknown")
|
||||
#define MyAppPublisher "Dmitry Petrov"
|
||||
#define MyAppURL "https://dataversioncontrol.com/"
|
||||
#define MyAppDir "..\..\dist"
|
||||
#define MyAppDir "..\..\dist\dvc"
|
||||
|
||||
[Setup]
|
||||
AppId={{8258CE8A-110E-4E0D-AE60-FEE00B15F041}
|
||||
|
||||
Reference in New Issue
Block a user