Skip to content

Commit

Permalink
WSL: store first install bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
htngr committed Oct 22, 2024
1 parent 817005b commit 37dada9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
id: winver
with:
string: '${{ github.ref_name }}'
pattern: '^v(\d+).(\d+).(\d+)-?.*$'
replace-with: '$1.$2.$3.0'
pattern: '^v(\d+).(\d+).(\d+)(\.(\d+))?$'
replace-with: '$1.$2.$3$4'
- name: Insert version ${{ github.ref_name }} / ${{ steps.winver.outputs.replaced }}
env:
VERSION: ${{ github.ref_name }}
Expand Down
31 changes: 17 additions & 14 deletions codchi/src/platform/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::{
};
use anyhow::{bail, Context, Result};
use itertools::Itertools;
use log::Level;
use std::{collections::HashMap, fs, sync::mpsc::channel, thread};

pub trait MachineDriver: Sized {
Expand Down Expand Up @@ -297,20 +298,22 @@ git add flake.*
if status == PlatformStatus::NotInstalled {
set_progress_status(format!("Installing {}...", self.config.name));
self.install().inspect_err(|_err| {
log::error!(
"Removing leftovers of machine files for {}...",
self.config.name
);
log::trace!(
"Deleting config data for {}: {:?}",
self.config.name,
fs::remove_dir_all(host::DIR_CONFIG.join_machine(&self.config.name))
);
log::trace!(
"Deleting data for {}: {:?}",
self.config.name,
fs::remove_dir_all(host::DIR_DATA.join_machine(&self.config.name))
);
if !log::log_enabled!(Level::Debug) {
log::error!(
"Removing leftovers of machine files for {}...",
self.config.name
);
log::trace!(
"Deleting config data for {}: {:?}",
self.config.name,
fs::remove_dir_all(host::DIR_CONFIG.join_machine(&self.config.name))
);
log::trace!(
"Deleting data for {}: {:?}",
self.config.name,
fs::remove_dir_all(host::DIR_DATA.join_machine(&self.config.name))
);
}
})?;
} else {
if status == PlatformStatus::Stopped {
Expand Down
14 changes: 10 additions & 4 deletions nix/container/store/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,16 @@ in
# NIX_DAEMON_PID=$!
# export NIX_REMOTE="daemon"
if [ ! -f "${consts.store.DIR_CONFIG_STORE}/flake.nix" ]; then
logE "Stores' flake.nix missing!"
exit 1
fi
for i in $(seq 1 10); do
if [ -f "${consts.store.DIR_CONFIG_STORE}/flake.nix" ]; then
break
elif [ $i -ge 10 ]; then
logE "Stores' flake.nix missing!"
exit 1
fi
logE "Stores' flake.nix still missing, waiting a bit..."
sleep 1
done
if ! command -v git &> /dev/null; then
mkdir -p "${consts.store.DIR_CONFIG_STORE}"
Expand Down

0 comments on commit 37dada9

Please sign in to comment.