diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65c4efb3..8ec8af5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,16 +129,28 @@ jobs: build_for_macos: name: macOS 11 runs-on: macos-11 - env: - install_name: "sfizz-${{ github.ref_name }}-macos" steps: + - name: Update bash + run: brew install bash + - name: Set install_name + run: | + ghref=${{ github.ref_name }} + echo "install_name=sfizz-${ghref//'/'/'-'}-macos" >> "$GITHUB_ENV" + - name: Show summary + run: | + echo "install_name: ${{ env.install_name }}" + echo "BASH_VERSION: $BASH_VERSION" + system_profiler SPSoftwareDataType + cmake --version + gcc -v + xcodebuild -version + - name: Install dependencies + if: ${{ github.ref_type == 'branch' }} + run: brew install abseil - name: Checkout uses: actions/checkout@v3 with: submodules: recursive - - name: Install dependencies - if: ${{ github.ref_type == 'branch' }} - run: brew install abseil - name: Configure CMake run: | options=( @@ -188,10 +200,10 @@ jobs: sudo killall -9 AudioComponentRegistrar auval -v aumu samp Sfzt - name: Package bundles - if: ${{ github.ref_type == 'tag' }} + if: github.ref_type == 'tag' || github.event_name == 'pull_request' run: ./scripts/package-osx-bundles.sh - name: Create installer - if: ${{ github.ref_type == 'tag' }} + if: github.ref_type == 'tag' || github.event_name == 'pull_request' working-directory: ${{ github.workspace }}/build run: | options=( @@ -203,7 +215,7 @@ jobs: ) productbuild "${options[@]}" - name: Upload - if: ${{ github.ref_type == 'tag' }} + if: github.ref_type == 'tag' || github.event_name == 'pull_request' uses: actions/upload-artifact@v3 with: name: macOS package @@ -223,9 +235,14 @@ jobs: pkg_platform: Win64 release_arch: x64 bits: 64 - env: - install_name: sfizz-${{ github.ref_name }}-win${{ matrix.bits }} steps: + - name: Set install name + run: | + $stripped_name="${{ github.ref_name }}".replace('/', '-') + echo "install_name=sfizz-$stripped_name-win${{ matrix.bits }}" >> "${env:GITHUB_ENV}" + - name: Show summary + run: | + echo "install_name: $env:install_name" - name: Checkout uses: actions/checkout@v3 with: @@ -267,11 +284,11 @@ jobs: working-directory: ${{ github.workspace }}/build run: pluginval --validate-in-process --validate sfizz.vst3 - name: Create installer - if: ${{ github.ref_type == 'tag' }} + if: github.ref_type == 'tag' || github.event_name == 'pull_request' working-directory: ${{ github.workspace }}/build run: iscc /O"." /F"${{ env.install_name }}" /dARCH="${{ matrix.platform }}" innosetup.iss - name: Upload - if: ${{ github.ref_type == 'tag' }} + if: github.ref_type == 'tag' || github.event_name == 'pull_request' uses: actions/upload-artifact@v3 with: name: ${{ matrix.pkg_platform }} installer diff --git a/plugins/common/plugin/FileTrie.cpp b/plugins/common/plugin/FileTrie.cpp index 014ad626..31c77a04 100644 --- a/plugins/common/plugin/FileTrie.cpp +++ b/plugins/common/plugin/FileTrie.cpp @@ -97,6 +97,10 @@ size_t FileTrieBuilder::ensureDirectory(const fs::path& dirPath) fs::path parentPath = dirPath.parent_path(); if (parentPath != dirPath) ent.parent = ensureDirectory(parentPath); + else + // On Windows, (--dirPath.end()) would be `\\` but `parent_path` and `dirPath` + // would both be `C:\\` so we update the name to match. + ent.name = dirPath.u8string(); } size_t dirIndex = trie.entries_.size(); diff --git a/plugins/common/plugin/SfizzFileScan.cpp b/plugins/common/plugin/SfizzFileScan.cpp index 66fbe723..aa3d773f 100644 --- a/plugins/common/plugin/SfizzFileScan.cpp +++ b/plugins/common/plugin/SfizzFileScan.cpp @@ -34,7 +34,18 @@ bool SfzFileScan::locateRealFile(const fs::path& pathOrig, fs::path& pathFound) std::unique_lock lock { mutex }; refreshScan(); - auto it = file_index_.find(keyOf(pathOrig.filename())); + const auto key = [&] { + auto path = pathOrig.string(); + if (path.size() > 3 && path[1] == ':' && path[2] == '\\') { + // Assume an absolute windows path and switch anti-slashes to slashes + std::replace(path.begin(), path.end(), '\\', '/'); + return keyOf(fs::path(path).filename()); + } + + return keyOf(pathOrig.filename()); + }(); + + auto it = file_index_.find(key); if (it == file_index_.end()) return false;