From cd95234be2a3012c38fe7ede5a12fe38b17dfb6a Mon Sep 17 00:00:00 2001 From: coderofstuff <114628839+coderofstuff@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:18:17 -0700 Subject: [PATCH 1/4] Re-enable ci on all OS --- .github/workflows/ci.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43e21e237..5bfdd3286 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,12 +34,11 @@ jobs: test: name: Test Suite - # runs-on: ${{ matrix.os }} - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false - # matrix: - # os: [ ubuntu-latest, macos-latest, windows-latest ] + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] steps: # Clean unnecessary files to save disk space - name: clean unnecessary files to save space From 95eaa08729a721907026e4d52723d0f597dcb3f4 Mon Sep 17 00:00:00 2001 From: coderofstuff <114628839+coderofstuff@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:38:18 -0700 Subject: [PATCH 2/4] Update conditions --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5bfdd3286..5074bd59e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,6 +42,7 @@ jobs: steps: # Clean unnecessary files to save disk space - name: clean unnecessary files to save space + if: runner.os == 'ubuntu-latest' run: | docker rmi `docker images -q` sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d @@ -82,7 +83,7 @@ jobs: uses: actions/checkout@v4 - name: Fix CRLF on Windows - if: runner.os == 'Windows' + if: runner.os == 'windows-latest' run: git config --global core.autocrlf false - name: Install Protoc From 43f15300a51679d3397ffb60d6d9ab1d4899f343 Mon Sep 17 00:00:00 2001 From: coderofstuff <114628839+coderofstuff@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:45:17 -0700 Subject: [PATCH 3/4] More conditionals --- .github/workflows/ci.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5074bd59e..6bfc31371 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: steps: # Clean unnecessary files to save disk space - name: clean unnecessary files to save space - if: runner.os == 'ubuntu-latest' + if: runner.os == 'Linux' run: | docker rmi `docker images -q` sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d @@ -67,6 +67,7 @@ jobs: # Free up disk space on Ubuntu - name: Free Disk Space (Ubuntu) + if: runner.os == 'Linux' uses: jlumbroso/free-disk-space@main with: # This might remove tools that are actually needed, if set to "true" but frees about 6 GB @@ -83,7 +84,7 @@ jobs: uses: actions/checkout@v4 - name: Fix CRLF on Windows - if: runner.os == 'windows-latest' + if: runner.os == 'Windows' run: git config --global core.autocrlf false - name: Install Protoc From cd870ab6d13b4d51856e28b019aab0785197226c Mon Sep 17 00:00:00 2001 From: coderofstuff <114628839+coderofstuff@users.noreply.github.com> Date: Sat, 9 Dec 2023 10:40:36 -0700 Subject: [PATCH 4/4] Try windows path fix --- kaspad/src/daemon.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kaspad/src/daemon.rs b/kaspad/src/daemon.rs index 0950ad8fa..8d3906bfc 100644 --- a/kaspad/src/daemon.rs +++ b/kaspad/src/daemon.rs @@ -132,11 +132,14 @@ pub struct Runtime { /// This function can be used to identify the location of /// the application folder that contains kaspad logs and the database. pub fn get_app_dir_from_args(args: &Args) -> PathBuf { - let app_dir = args - .appdir - .clone() - .unwrap_or_else(|| get_app_dir().as_path().to_str().unwrap().to_string()) - .replace('~', get_home_dir().as_path().to_str().unwrap()); + let mut app_dir = args.appdir.clone().unwrap_or_else(|| get_app_dir().as_path().to_str().unwrap().to_string()); + + // TODO: temporary patch. Why do we do this replace for every OS in the first place? + #[cfg(any(target_os = "macos", target_os = "linux"))] + { + app_dir = app_dir.replace('~', get_home_dir().as_path().to_str().unwrap()); + } + if app_dir.is_empty() { get_app_dir() } else {