From 7ef8f0b2d6016957ca7cab90224b964e1c26e217 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 18:08:49 +0000 Subject: [PATCH 01/25] Bump senzing-factory/github-action-install-senzing-sdk from 2 to 3 Bumps [senzing-factory/github-action-install-senzing-sdk](https://github.com/senzing-factory/github-action-install-senzing-sdk) from 2 to 3. - [Release notes](https://github.com/senzing-factory/github-action-install-senzing-sdk/releases) - [Changelog](https://github.com/senzing-factory/github-action-install-senzing-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/senzing-factory/github-action-install-senzing-sdk/compare/v2...v3) --- updated-dependencies: - dependency-name: senzing-factory/github-action-install-senzing-sdk dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/csharp-darwin-snippets.yaml | 2 +- .github/workflows/csharp-linux-snippets.yaml | 2 +- .github/workflows/csharp-windows-snippets.yaml | 2 +- .github/workflows/java-darwin-snippets.yaml | 2 +- .github/workflows/java-linux-snippets.yaml | 2 +- .github/workflows/java-windows-snippets.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/csharp-darwin-snippets.yaml b/.github/workflows/csharp-darwin-snippets.yaml index 6696aab..b60c133 100644 --- a/.github/workflows/csharp-darwin-snippets.yaml +++ b/.github/workflows/csharp-darwin-snippets.yaml @@ -25,7 +25,7 @@ jobs: dotnet-version: ${{ matrix.dotnet-version }} - name: install Senzing SDK - uses: senzing-factory/github-action-install-senzing-sdk@v2 + uses: senzing-factory/github-action-install-senzing-sdk@v3 with: senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }} diff --git a/.github/workflows/csharp-linux-snippets.yaml b/.github/workflows/csharp-linux-snippets.yaml index 0c5dfd1..2cd6209 100644 --- a/.github/workflows/csharp-linux-snippets.yaml +++ b/.github/workflows/csharp-linux-snippets.yaml @@ -29,7 +29,7 @@ jobs: dotnet-version: ${{ matrix.dotnet-version }} - name: install Senzing runtime - uses: senzing-factory/github-action-install-senzing-sdk@v2 + uses: senzing-factory/github-action-install-senzing-sdk@v3 with: packages-to-install: "senzingsdk-runtime senzingsdk-setup" senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }} diff --git a/.github/workflows/csharp-windows-snippets.yaml b/.github/workflows/csharp-windows-snippets.yaml index 0a04f17..bed1a39 100644 --- a/.github/workflows/csharp-windows-snippets.yaml +++ b/.github/workflows/csharp-windows-snippets.yaml @@ -25,7 +25,7 @@ jobs: dotnet-version: ${{ matrix.dotnet-version }} - name: install Senzing SDK - uses: senzing-factory/github-action-install-senzing-sdk@v2 + uses: senzing-factory/github-action-install-senzing-sdk@v3 with: senzingsdk-repository-path: ${{ secrets.SENZING_WIN_BETA_REPOSITORY }} diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index d946e8e..fbb75cb 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -27,7 +27,7 @@ jobs: java-version: ${{ matrix.java-version }} - name: install Senzing SDK - uses: senzing-factory/github-action-install-senzing-sdk@v2 + uses: senzing-factory/github-action-install-senzing-sdk@v3 with: senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }} diff --git a/.github/workflows/java-linux-snippets.yaml b/.github/workflows/java-linux-snippets.yaml index 07136da..a25cd50 100644 --- a/.github/workflows/java-linux-snippets.yaml +++ b/.github/workflows/java-linux-snippets.yaml @@ -31,7 +31,7 @@ jobs: distribution: ${{ matrix.java-distribution }} - name: install Senzing runtime - uses: senzing-factory/github-action-install-senzing-sdk@v2 + uses: senzing-factory/github-action-install-senzing-sdk@v3 with: packages-to-install: "senzingsdk-runtime senzingsdk-setup" senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }} diff --git a/.github/workflows/java-windows-snippets.yaml b/.github/workflows/java-windows-snippets.yaml index cef76ab..399caa0 100644 --- a/.github/workflows/java-windows-snippets.yaml +++ b/.github/workflows/java-windows-snippets.yaml @@ -27,7 +27,7 @@ jobs: distribution: ${{ matrix.java-distribution }} - name: install Senzing SDK - uses: senzing-factory/github-action-install-senzing-sdk@v2 + uses: senzing-factory/github-action-install-senzing-sdk@v3 with: senzingsdk-repository-path: ${{ secrets.SENZING_WIN_BETA_REPOSITORY }} From 1e27ff79a5526e7fa602580f9eadaca68d6effd4 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:31:59 -0800 Subject: [PATCH 02/25] update install paths --- .github/workflows/csharp-darwin-snippets.yaml | 11 +++++------ .github/workflows/csharp-windows-snippets.yaml | 6 +++--- .github/workflows/java-darwin-snippets.yaml | 6 ++---- .github/workflows/java-windows-snippets.yaml | 5 ++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/csharp-darwin-snippets.yaml b/.github/workflows/csharp-darwin-snippets.yaml index b60c133..443ba49 100644 --- a/.github/workflows/csharp-darwin-snippets.yaml +++ b/.github/workflows/csharp-darwin-snippets.yaml @@ -31,17 +31,16 @@ jobs: - name: configure local nuget repo run: | - find /opt/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename - sdk_package=$(find /opt/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename) + find "${HOME}"/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename + sdk_package=$(find "${HOME}"/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename) mkdir -p ~/dev/nuget/packages dotnet nuget add source ~/dev/nuget/packages -n dev - dotnet nuget push /opt/senzing/er/sdk/dotnet/"${sdk_package}" --source dev + dotnet nuget push "${HOME}"/senzing/er/sdk/dotnet/"${sdk_package}" --source dev - name: run csharp snippets - env: - DYLD_LIBRARY_PATH: "/opt/senzing/er/lib" - SENZING_DATA_DIR: "/opt/senzing/er/data" run: | + DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib" + SENZING_DATA_DIR="${HOME}/senzing/er/data" cd "${GITHUB_WORKSPACE}"/csharp/runner dotnet add SnippetRunner package Senzing.Sdk --version 4.0.0-beta dotnet run --project SnippetRunner all diff --git a/.github/workflows/csharp-windows-snippets.yaml b/.github/workflows/csharp-windows-snippets.yaml index bed1a39..1e3cfff 100644 --- a/.github/workflows/csharp-windows-snippets.yaml +++ b/.github/workflows/csharp-windows-snippets.yaml @@ -31,17 +31,17 @@ jobs: - name: configure local nuget repo run: | - $Env:sdk_package = Get-ChildItem -Path "C:\Program Files\Senzing\er\sdk\dotnet\" -Recurse | Where-Object {$_.Name -match "^Senzing.SDK*"} | Select-Object -ExpandProperty Name + $Env:sdk_package = Get-ChildItem -Path "$Env:USERPROFILE\Senzing\er\sdk\dotnet\" -Recurse | Where-Object {$_.Name -match "^Senzing.SDK*"} | Select-Object -ExpandProperty Name mkdir $Env:USERPROFILE\dev\nuget\packages cd $Env:USERPROFILE\dev\nuget\packages dir dotnet nuget add source $Env:USERPROFILE\dev\nuget\packages -n senzing - dotnet nuget push "C:\Program Files\Senzing\er\sdk\dotnet\${Env:sdk_package}" --source senzing + dotnet nuget push "$Env:USERPROFILE\Senzing\er\sdk\dotnet\${Env:sdk_package}" --source senzing dotnet nuget list source - name: Add to "Path" environment variable run: | - Add-Content $env:GITHUB_PATH "C:\Program Files\Senzing\er\lib" + Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\Senzing\er\lib" - name: run csharp snippets run: | diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index fbb75cb..9a1e829 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -32,15 +32,13 @@ jobs: senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }} - name: build with Maven - env: - SENZING_DIR: "/opt/senzing/er" run: | + SENZING_DIR="${HOME}/senzing/er" cd "${GITHUB_WORKSPACE}"/java mvn clean install - name: run java snippets - env: - DYLD_LIBRARY_PATH: "/opt/senzing/er/lib" run: | + DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib" cd "${GITHUB_WORKSPACE}"/java java -jar target/sz-sdk-snippets.jar all diff --git a/.github/workflows/java-windows-snippets.yaml b/.github/workflows/java-windows-snippets.yaml index 399caa0..e2ecb18 100644 --- a/.github/workflows/java-windows-snippets.yaml +++ b/.github/workflows/java-windows-snippets.yaml @@ -32,15 +32,14 @@ jobs: senzingsdk-repository-path: ${{ secrets.SENZING_WIN_BETA_REPOSITORY }} - name: build with Maven - env: - SENZING_DIR: 'C:\Program Files\Senzing\er' run: | + $Env:SENZING_DIR = "$Env:USERPROFILE\Senzing\er" cd "${Env:GITHUB_WORKSPACE}/java" mvn clean install - name: Add to "Path" environment variable run: | - Add-Content $env:GITHUB_PATH "C:\Program Files\Senzing\er\lib" + Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\Senzing\er\lib" - name: run java snippets run: | From 7fab39fc3c2938e991ae3ae6ff4d67a92cb44cda Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 25 Feb 2025 14:37:54 -0800 Subject: [PATCH 03/25] linting updates and path fixes --- .github/workflows/csharp-darwin-snippets.yaml | 4 ++++ .github/workflows/csharp-windows-snippets.yaml | 2 +- .github/workflows/java-darwin-snippets.yaml | 3 +++ .github/workflows/java-windows-snippets.yaml | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/csharp-darwin-snippets.yaml b/.github/workflows/csharp-darwin-snippets.yaml index 443ba49..b789ccf 100644 --- a/.github/workflows/csharp-darwin-snippets.yaml +++ b/.github/workflows/csharp-darwin-snippets.yaml @@ -39,8 +39,12 @@ jobs: - name: run csharp snippets run: | + # shellcheck disable=SC2034 DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib" + # shellcheck disable=SC2034 SENZING_DATA_DIR="${HOME}/senzing/er/data" + # shellcheck disable=SC2034 + SENZING_DIR="${HOME}/senzing/er" cd "${GITHUB_WORKSPACE}"/csharp/runner dotnet add SnippetRunner package Senzing.Sdk --version 4.0.0-beta dotnet run --project SnippetRunner all diff --git a/.github/workflows/csharp-windows-snippets.yaml b/.github/workflows/csharp-windows-snippets.yaml index 1e3cfff..496e6fe 100644 --- a/.github/workflows/csharp-windows-snippets.yaml +++ b/.github/workflows/csharp-windows-snippets.yaml @@ -45,6 +45,6 @@ jobs: - name: run csharp snippets run: | - echo $Env:Path + $Env:SENZING_DIR = "$Env:USERPROFILE\Senzing\er" cd ${Env:GITHUB_WORKSPACE}/csharp/runner dotnet run --project SnippetRunner all diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index 9a1e829..91cabfd 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -33,12 +33,15 @@ jobs: - name: build with Maven run: | + # shellcheck disable=SC2034 SENZING_DIR="${HOME}/senzing/er" + echo "[INFO] SENDING_DIR is: $SENZING_DIR" cd "${GITHUB_WORKSPACE}"/java mvn clean install - name: run java snippets run: | + # shellcheck disable=SC2034 DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib" cd "${GITHUB_WORKSPACE}"/java java -jar target/sz-sdk-snippets.jar all diff --git a/.github/workflows/java-windows-snippets.yaml b/.github/workflows/java-windows-snippets.yaml index e2ecb18..c1c7acf 100644 --- a/.github/workflows/java-windows-snippets.yaml +++ b/.github/workflows/java-windows-snippets.yaml @@ -44,4 +44,4 @@ jobs: - name: run java snippets run: | cd "${Env:GITHUB_WORKSPACE}/java" - java -jar target/sz-sdk-snippets.jar all + java -jar -Dsenzing.install.dir="$Env:USERPROFILE\Senzing\er" target/sz-sdk-snippets.jar all From 981b38c3863ae5ed5856bf0597a1b9e4f1159343 Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 25 Feb 2025 14:43:42 -0800 Subject: [PATCH 04/25] test --- .github/workflows/java-darwin-snippets.yaml | 2 +- .github/workflows/java-windows-snippets.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index 91cabfd..349b2d5 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -35,7 +35,7 @@ jobs: run: | # shellcheck disable=SC2034 SENZING_DIR="${HOME}/senzing/er" - echo "[INFO] SENDING_DIR is: $SENZING_DIR" + echo "[INFO] SENZING_DIR is: $SENZING_DIR" cd "${GITHUB_WORKSPACE}"/java mvn clean install diff --git a/.github/workflows/java-windows-snippets.yaml b/.github/workflows/java-windows-snippets.yaml index c1c7acf..2c3c407 100644 --- a/.github/workflows/java-windows-snippets.yaml +++ b/.github/workflows/java-windows-snippets.yaml @@ -44,4 +44,4 @@ jobs: - name: run java snippets run: | cd "${Env:GITHUB_WORKSPACE}/java" - java -jar -Dsenzing.install.dir="$Env:USERPROFILE\Senzing\er" target/sz-sdk-snippets.jar all + java -Dsenzing.install.dir="$Env:USERPROFILE\Senzing\er" -jar target/sz-sdk-snippets.jar all From e620f451ed39aef24d2d8d50eb3ae310b94f639d Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Tue, 25 Feb 2025 16:48:18 -0800 Subject: [PATCH 05/25] Updated finding of default paths --- .../runner/SnippetRunner/InstallLocations.cs | 17 +++- .../com/senzing/runner/InstallLocations.java | 82 ++++++++----------- 2 files changed, 48 insertions(+), 51 deletions(-) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index 9d57348..01c53fa 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -180,6 +180,15 @@ private static bool IsDirectory(string path) /// public static InstallLocations? FindLocations() { + DirectoryInfo homeDir = new DirectoryInfo(Environment.GetFolderPath( + Environment.SpecialFolder.UserProfile)); + DirectoryInfo homeSenzing = new DirectoryInfo( + Path.Combine(homeDir.FullName, "senzing")); + DirectoryInfo homeInstall = new DirectoryInfo( + Path.Combine(homeSenzing.FullName, "er")); + DirectoryInfo homeSupport = new DirectoryInfo( + Path.Combine(homeInstall.FullName, "data")); + DirectoryInfo? installDir = null; DirectoryInfo? configDir = null; DirectoryInfo? resourceDir = null; @@ -193,12 +202,12 @@ private static bool IsDirectory(string path) switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: - defaultInstallPath = "C:\\Program Files\\Senzing\\er"; - defaultSupportPath = "C:\\Program Files\\Senzing\\er\\data"; + defaultInstallPath = homeInstall.FullName; + defaultSupportPath = homeSupport.FullName; break; case PlatformID.MacOSX: - defaultInstallPath = "/opt/senzing/er"; - defaultSupportPath = "/opt/senzing/er/data"; + defaultInstallPath = homeInstall.FullName; + defaultSupportPath = homeSupport.FullName; break; case PlatformID.Unix: defaultInstallPath = "/opt/senzing/er"; diff --git a/java/runner/java/com/senzing/runner/InstallLocations.java b/java/runner/java/com/senzing/runner/InstallLocations.java index efd0cc4..1fa14a5 100644 --- a/java/runner/java/com/senzing/runner/InstallLocations.java +++ b/java/runner/java/com/senzing/runner/InstallLocations.java @@ -133,8 +133,8 @@ public String toString() { * Finds the install directories and returns the {@link InstallLocations} * instance describing those locations. * - * @param senzingDir The optional Senzing installation directory if one has - * been provided, null otherwise. + * @param senzingDir The optional Senzing installation directory if one has been + * provided, null otherwise. * * @return The {@link InstallLocations} instance describing the install * locations. @@ -148,12 +148,14 @@ public static InstallLocations findLocations() { String lowerOSName = osName.toLowerCase().trim(); if (lowerOSName.startsWith("windows")) { windows = true; - } else if (lowerOSName.startsWith("mac") - || lowerOSName.indexOf("darwin") >= 0) - { + } else if (lowerOSName.startsWith("mac") || lowerOSName.indexOf("darwin") >= 0) { macOS = true; } + File homeDir = new File(System.getProperty("user.home")); + File homeSenzing = new File(homeDir, "senzing"); + File homeInstall = new File(homeSenzing, "er"); + File homeSupport = new File(homeInstall, "data"); File installDir = null; File configDir = null; File resourceDir = null; @@ -165,14 +167,14 @@ public static InstallLocations findLocations() { String defaultSupportPath = null; if (windows) { - defaultInstallPath = "C:\\Program Files\\Senzing\\er"; - defaultSupportPath = "C:\\Program Files\\Senzing\\er\\data"; + defaultInstallPath = homeInstall.getCanonicalPath(); + defaultSupportPath = homeSupport.getCanonicalPath(); } else if (macOS) { - defaultInstallPath = "/opt/senzing/er"; - defaultSupportPath = "/opt/senzing/er/data"; + defaultInstallPath = homeInstall.getCanonicalPath(); + defaultSupportPath = homeSupport.getCanonicalPath(); } else { defaultInstallPath = "/opt/senzing/er"; - defaultConfigPath = "/etc/opt/senzing"; + defaultConfigPath = "/etc/opt/senzing"; defaultSupportPath = "/opt/senzing/data"; } @@ -214,12 +216,10 @@ public static InstallLocations findLocations() { System.err.println(" " + installDir); System.err.println(); if (installPath != null) { - System.err.println( - "Check the -Dsenzing.install.dir=[path] command line option."); + System.err.println("Check the -Dsenzing.install.dir=[path] command line option."); } else { - System.err.println( - "Use the -Dsenzing.install.dir=[path] command line option to " - + "specify a path"); + System.err + .println("Use the -Dsenzing.install.dir=[path] command line option to " + "specify a path"); } return null; @@ -227,9 +227,7 @@ public static InstallLocations findLocations() { // normalize the senzing directory String dirName = installDir.getName(); - if (installDir.isDirectory() && !dirName.equalsIgnoreCase("er") - && dirName.equalsIgnoreCase("senzing")) - { + if (installDir.isDirectory() && !dirName.equalsIgnoreCase("er") && dirName.equalsIgnoreCase("senzing")) { // for windows or linux allow the "Senzing" dir as well installDir = new File(installDir, "er"); } @@ -239,12 +237,10 @@ public static InstallLocations findLocations() { System.err.println(" " + installDir); System.err.println(); if (installPath != null) { - System.err.println( - "Check the -Dsenzing.install.dir=[path] command line option."); + System.err.println("Check the -Dsenzing.install.dir=[path] command line option."); } else { - System.err.println( - "Use the -Dsenzing.install.dir=[path] command line option to " - + "specify a path"); + System.err + .println("Use the -Dsenzing.install.dir=[path] command line option to " + "specify a path"); } return null; @@ -260,7 +256,7 @@ public static InstallLocations findLocations() { supportDir = new File(installDir, "data"); } else { // no explicit path, try the default support path - supportDir = new File(defaultSupportPath); + supportDir = new File(defaultSupportPath); } } else { @@ -274,8 +270,8 @@ public static InstallLocations findLocations() { if (supportPath != null) { System.err.println("Check the -Dsenzing.support.dir=[path] command line option."); } else { - System.err.println("Use the -Dsenzing.support.dir=[path] command line option to " - + "specify a path"); + System.err + .println("Use the -Dsenzing.support.dir=[path] command line option to " + "specify a path"); } throw new IllegalStateException("The support directory does not exist: " + supportDir); @@ -287,8 +283,8 @@ public static InstallLocations findLocations() { if (supportPath != null) { System.err.println("Check the -Dsenzing.support.dir=[path] command line option."); } else { - System.err.println("Use the -Dsenzing.support.dir=[path] command line option to " - + "specify a path"); + System.err + .println("Use the -Dsenzing.support.dir=[path] command line option to " + "specify a path"); } throw new IllegalStateException("The support directory is invalid: " + supportDir); @@ -317,24 +313,21 @@ public static InstallLocations findLocations() { configDir = new File(installDir, "etc"); if (!configDir.exists()) { configDir = null; - } + } } if (configPath != null && !configDir.exists()) { - System.err.println( - "The -Dsenzing.config.dir=[path] option specifies a path that does not exist:"); + System.err.println("The -Dsenzing.config.dir=[path] option specifies a path that does not exist:"); System.err.println(" " + configPath); throw new IllegalStateException("Explicit config path does not exist: " + configPath); } if (configDir != null && configDir.exists()) { if (!configDir.isDirectory()) { - System.err.println( - "The -Dsenzing.config.dir=[path] option specifies a file, not a directory:"); + System.err.println("The -Dsenzing.config.dir=[path] option specifies a file, not a directory:"); System.err.println(" " + configPath); - throw new IllegalStateException( - "Explicit config path is not directory: " + configPath); + throw new IllegalStateException("Explicit config path is not directory: " + configPath); } String[] requiredFiles = { "cfgVariant.json" }; @@ -348,13 +341,11 @@ public static InstallLocations findLocations() { } } if (missingFiles.size() > 0 && configPath != null) { - System.err.println( - "The -Dsenzing.config.dir=[path] option specifies an invalid config directory:"); + System.err.println("The -Dsenzing.config.dir=[path] option specifies an invalid config directory:"); for (String missing : missingFiles) { System.err.println(" " + missing + " was not found"); } - throw new IllegalStateException( - "Explicit config path missing required files: " + missingFiles); + throw new IllegalStateException("Explicit config path missing required files: " + missingFiles); } } @@ -372,22 +363,19 @@ public static InstallLocations findLocations() { if (resourcePath != null) { if (!resourceDir.exists()) { - System.err.println( - "The -Dsenzing.resource.dir=[path] option specifies a path that does not exist:"); + System.err + .println("The -Dsenzing.resource.dir=[path] option specifies a path that does not exist:"); System.err.println(" " + resourcePath); - throw new IllegalStateException( - "Explicit resource path does not exist: " + resourcePath); + throw new IllegalStateException("Explicit resource path does not exist: " + resourcePath); } if (!resourceDir.isDirectory() || !templatesDir.exists() || !templatesDir.isDirectory()) { System.err.println( - "The -Dsenzing.resource.dir=[path] option specifies an invalid " - + "resource directory:"); + "The -Dsenzing.resource.dir=[path] option specifies an invalid " + "resource directory:"); System.err.println(" " + resourcePath); - throw new IllegalStateException( - "Explicit resource path is not valid: " + resourcePath); + throw new IllegalStateException("Explicit resource path is not valid: " + resourcePath); } } else if (!resourceDir.exists() || !resourceDir.isDirectory() || !templatesDir.exists() From c064e91a991530e3fe67581db246a1539d3ebddc Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:10:08 -0800 Subject: [PATCH 06/25] debug --- .github/workflows/java-darwin-snippets.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index 349b2d5..468a6bf 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -36,6 +36,7 @@ jobs: # shellcheck disable=SC2034 SENZING_DIR="${HOME}/senzing/er" echo "[INFO] SENZING_DIR is: $SENZING_DIR" + ls -tlc "${SENZING_DIR}"/sdk/java cd "${GITHUB_WORKSPACE}"/java mvn clean install From 02aec29fcb2e9646c3e558978f2bc42f293d5e0e Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 09:40:49 -0800 Subject: [PATCH 07/25] Debug SENZING_DIR since it cannot find the sz-sdk.jar --- .github/workflows/java-darwin-snippets.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index 349b2d5..3e446e6 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -36,6 +36,11 @@ jobs: # shellcheck disable=SC2034 SENZING_DIR="${HOME}/senzing/er" echo "[INFO] SENZING_DIR is: $SENZING_DIR" + ls $SENZING_DIR + echo "-- SDK LISTING" + ls $SENZING_DIR/sdk + echo "-- JAVA LISTING" + ls $SENZING_DIR/sdk/java cd "${GITHUB_WORKSPACE}"/java mvn clean install From e1bf8c7285e67052a02a4259cefaf4837984b614 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 10:04:21 -0800 Subject: [PATCH 08/25] Hard-code SENZING_DIR in pom.xml to check if the problem lies there --- java/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/pom.xml b/java/pom.xml index ada36f7..dd66ff1 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -20,7 +20,7 @@ sz-sdk 4.0.0-beta.2.0 system - ${SENZING_DIR}/sdk/java/sz-sdk.jar + /Users/runner/senzing/er/sdk/java/sz-sdk.jar org.glassfish @@ -88,7 +88,7 @@ false - ${SENZING_DIR}/sdk/java/sz-sdk.jar + /Users/runner/senzing/er/sdk/java/sz-sdk.jar From 3b6d0f1607e74de6b6b2227cbdd6c935806b0429 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 10:11:33 -0800 Subject: [PATCH 09/25] Minor update to darwin java DYLD_LIBRARY_PATH --- .github/workflows/java-darwin-snippets.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index 0a2c25e..9049902 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -47,6 +47,6 @@ jobs: - name: run java snippets run: | # shellcheck disable=SC2034 - DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib" + DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib:${HOME}/senzing/er/lib/macos" cd "${GITHUB_WORKSPACE}"/java java -jar target/sz-sdk-snippets.jar all From 47fd3873897dfa3aa03eec894920fd6398858137 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 10:21:13 -0800 Subject: [PATCH 10/25] Another try -- tired of commit messsages --- .github/workflows/java-darwin-snippets.yaml | 3 ++- java/pom.xml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index 9049902..f03dd10 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -47,6 +47,7 @@ jobs: - name: run java snippets run: | # shellcheck disable=SC2034 - DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib:${HOME}/senzing/er/lib/macos" + SENZING_DIR="${HOME}/senzing/er" + export DYLD_LIBRARY_PATH="${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" cd "${GITHUB_WORKSPACE}"/java java -jar target/sz-sdk-snippets.jar all diff --git a/java/pom.xml b/java/pom.xml index dd66ff1..9c7c5a3 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -20,7 +20,7 @@ sz-sdk 4.0.0-beta.2.0 system - /Users/runner/senzing/er/sdk/java/sz-sdk.jar + ${SENZING_DIR}/sdk/java/sz-sdk.jar org.glassfish @@ -39,6 +39,7 @@ 17 UTF-8 UTF-8 + ${SENZING_DIR} snippets @@ -88,7 +89,7 @@ false - /Users/runner/senzing/er/sdk/java/sz-sdk.jar + ${SENZING_DIR}/sdk/java/sz-sdk.jar From 25b2a4d81569264c3fb78125dc00c2a9be770eb5 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 10:23:22 -0800 Subject: [PATCH 11/25] Another try -- tired of commit messsages --- .github/workflows/java-darwin-snippets.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index f03dd10..f4fb300 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -34,7 +34,7 @@ jobs: - name: build with Maven run: | # shellcheck disable=SC2034 - SENZING_DIR="${HOME}/senzing/er" + export SENZING_DIR="${HOME}/senzing/er" echo "[INFO] SENZING_DIR is: $SENZING_DIR" ls -tlc $SENZING_DIR echo "-- SDK LISTING" @@ -47,7 +47,7 @@ jobs: - name: run java snippets run: | # shellcheck disable=SC2034 - SENZING_DIR="${HOME}/senzing/er" + export SENZING_DIR="${HOME}/senzing/er" export DYLD_LIBRARY_PATH="${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" cd "${GITHUB_WORKSPACE}"/java java -jar target/sz-sdk-snippets.jar all From 44f4d18f7faad40b4f935de55c653f56b8cb18e6 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 10:27:41 -0800 Subject: [PATCH 12/25] Another try -- tired of commit messsages --- .github/workflows/java-darwin-snippets.yaml | 6 ------ .github/workflows/java-windows-snippets.yaml | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index f4fb300..ae999cd 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -35,12 +35,6 @@ jobs: run: | # shellcheck disable=SC2034 export SENZING_DIR="${HOME}/senzing/er" - echo "[INFO] SENZING_DIR is: $SENZING_DIR" - ls -tlc $SENZING_DIR - echo "-- SDK LISTING" - ls -tlc $SENZING_DIR/sdk - echo "-- JAVA LISTING" - ls -tlc $SENZING_DIR/sdk/java cd "${GITHUB_WORKSPACE}"/java mvn clean install diff --git a/.github/workflows/java-windows-snippets.yaml b/.github/workflows/java-windows-snippets.yaml index 2c3c407..20086d5 100644 --- a/.github/workflows/java-windows-snippets.yaml +++ b/.github/workflows/java-windows-snippets.yaml @@ -44,4 +44,4 @@ jobs: - name: run java snippets run: | cd "${Env:GITHUB_WORKSPACE}/java" - java -Dsenzing.install.dir="$Env:USERPROFILE\Senzing\er" -jar target/sz-sdk-snippets.jar all + java "-Dsenzing.install.dir=$Env:USERPROFILE\Senzing\er" -jar target/sz-sdk-snippets.jar all From aeef87b42dae4fd9b5d451a6c711a11dd94db653 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 10:36:48 -0800 Subject: [PATCH 13/25] Added export for environmment variables --- .github/workflows/csharp-darwin-snippets.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/csharp-darwin-snippets.yaml b/.github/workflows/csharp-darwin-snippets.yaml index b789ccf..9000143 100644 --- a/.github/workflows/csharp-darwin-snippets.yaml +++ b/.github/workflows/csharp-darwin-snippets.yaml @@ -40,11 +40,9 @@ jobs: - name: run csharp snippets run: | # shellcheck disable=SC2034 - DYLD_LIBRARY_PATH="${HOME}/senzing/er/lib" + export SENZING_DIR="${HOME}/senzing/er" # shellcheck disable=SC2034 - SENZING_DATA_DIR="${HOME}/senzing/er/data" - # shellcheck disable=SC2034 - SENZING_DIR="${HOME}/senzing/er" + export DYLD_LIBRARY_PATH="${SENZING_DIR}/lib" cd "${GITHUB_WORKSPACE}"/csharp/runner dotnet add SnippetRunner package Senzing.Sdk --version 4.0.0-beta dotnet run --project SnippetRunner all From 70ae96b9bec29c01c47197aa89af3bd7397222af Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:01:18 -0800 Subject: [PATCH 14/25] cleanup environment configuration --- .github/workflows/csharp-darwin-snippets.yaml | 9 +++++---- .github/workflows/java-darwin-snippets.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/csharp-darwin-snippets.yaml b/.github/workflows/csharp-darwin-snippets.yaml index 9000143..2de4f3e 100644 --- a/.github/workflows/csharp-darwin-snippets.yaml +++ b/.github/workflows/csharp-darwin-snippets.yaml @@ -29,6 +29,11 @@ jobs: with: senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }} + - name: configure environment + run: | + echo "SENZING_DIR=${HOME}/senzing/er" >> $GITHUB_ENV + echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib" >> $GITHUB_ENV + - name: configure local nuget repo run: | find "${HOME}"/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename @@ -39,10 +44,6 @@ jobs: - name: run csharp snippets run: | - # shellcheck disable=SC2034 - export SENZING_DIR="${HOME}/senzing/er" - # shellcheck disable=SC2034 - export DYLD_LIBRARY_PATH="${SENZING_DIR}/lib" cd "${GITHUB_WORKSPACE}"/csharp/runner dotnet add SnippetRunner package Senzing.Sdk --version 4.0.0-beta dotnet run --project SnippetRunner all diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index ae999cd..c22c6b2 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -31,17 +31,17 @@ jobs: with: senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }} + - name: configure environment + run: | + echo "SENZING_DIR=${HOME}/senzing/er" >> $GITHUB_ENV + echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" >> $GITHUB_ENV + - name: build with Maven run: | - # shellcheck disable=SC2034 - export SENZING_DIR="${HOME}/senzing/er" cd "${GITHUB_WORKSPACE}"/java mvn clean install - name: run java snippets run: | - # shellcheck disable=SC2034 - export SENZING_DIR="${HOME}/senzing/er" - export DYLD_LIBRARY_PATH="${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" cd "${GITHUB_WORKSPACE}"/java java -jar target/sz-sdk-snippets.jar all From cbc4fa6d88f16e98ab2c3c649b980af64b9d4cae Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:12:31 -0800 Subject: [PATCH 15/25] test --- .github/workflows/csharp-darwin-snippets.yaml | 9 ++++++--- .github/workflows/java-darwin-snippets.yaml | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/csharp-darwin-snippets.yaml b/.github/workflows/csharp-darwin-snippets.yaml index 2de4f3e..8f29695 100644 --- a/.github/workflows/csharp-darwin-snippets.yaml +++ b/.github/workflows/csharp-darwin-snippets.yaml @@ -31,12 +31,15 @@ jobs: - name: configure environment run: | - echo "SENZING_DIR=${HOME}/senzing/er" >> $GITHUB_ENV - echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib" >> $GITHUB_ENV + SENZING_DIR="${HOME}/senzing/er" + { + echo "SENZING_DIR=${SENZING_DIR}" + echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib" + echo "SENZING_DATA_DIR=${SENZING_DIR}/data" + } >> "$GITHUB_ENV" - name: configure local nuget repo run: | - find "${HOME}"/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename sdk_package=$(find "${HOME}"/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename) mkdir -p ~/dev/nuget/packages dotnet nuget add source ~/dev/nuget/packages -n dev diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index c22c6b2..d3f29f1 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -33,8 +33,9 @@ jobs: - name: configure environment run: | - echo "SENZING_DIR=${HOME}/senzing/er" >> $GITHUB_ENV - echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" >> $GITHUB_ENV + SENZING_DIR="${HOME}/senzing/er" + echo "SENZING_DIR=${SENZING_DIR}" >> "$GITHUB_ENV" + echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" >> "$GITHUB_ENV" - name: build with Maven run: | From 4de6cbbc84c5f45e9eb13188717192dbca64d5ef Mon Sep 17 00:00:00 2001 From: Sam <109683132+kernelsam@users.noreply.github.com> Date: Wed, 26 Feb 2025 11:16:42 -0800 Subject: [PATCH 16/25] cleanup --- .github/workflows/java-darwin-snippets.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-darwin-snippets.yaml b/.github/workflows/java-darwin-snippets.yaml index d3f29f1..ea05fd5 100644 --- a/.github/workflows/java-darwin-snippets.yaml +++ b/.github/workflows/java-darwin-snippets.yaml @@ -34,8 +34,10 @@ jobs: - name: configure environment run: | SENZING_DIR="${HOME}/senzing/er" - echo "SENZING_DIR=${SENZING_DIR}" >> "$GITHUB_ENV" - echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" >> "$GITHUB_ENV" + { + echo "SENZING_DIR=${SENZING_DIR}" + echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos" + } >> "$GITHUB_ENV" - name: build with Maven run: | From c80ab54d00466f66fcb7230746fd0c655bf92eda Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 13:06:04 -0800 Subject: [PATCH 17/25] Add debugging to C# InstallLocations.cs to determine why the support path is wrong --- .../runner/SnippetRunner/InstallLocations.cs | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index 01c53fa..f04023f 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -220,6 +220,13 @@ private static bool IsDirectory(string path) + Environment.OSVersion.Platform); } + Console.Error.WriteLine(); + Console.Error.WriteLine("---------------------------------"); + Console.Error.WriteLine("PLATFORM ID: " + PlatformID.MacOSX); + Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); + Console.Error.WriteLine("---------------------------------"); + Console.Error.WriteLine(); + // check for senzing system properties string? installPath = Environment.GetEnvironmentVariable( "SENZING_DIR"); @@ -311,22 +318,6 @@ private static bool IsDirectory(string path) } else { - switch (Environment.OSVersion.Platform) - { - case PlatformID.Win32NT: - defaultSupportPath = Path.Combine(installDir.FullName, "data"); - break; - case PlatformID.MacOSX: - defaultSupportPath = Path.Combine(installDir.FullName, "data"); - break; - case PlatformID.Unix: - break; - default: - throw new NotSupportedException( - "Unsupported Operating System: " - + Environment.OSVersion.Platform); - } - // no explicit path, try the default support path supportDir = new DirectoryInfo(defaultSupportPath); } From 09d1b118902c2526ba32e36bbe71ac70afc05084 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 13:12:10 -0800 Subject: [PATCH 18/25] Add debugging to C# InstallLocations.cs to determine why the support path is wrong --- csharp/runner/SnippetRunner/InstallLocations.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index f04023f..3199732 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -224,6 +224,7 @@ private static bool IsDirectory(string path) Console.Error.WriteLine("---------------------------------"); Console.Error.WriteLine("PLATFORM ID: " + PlatformID.MacOSX); Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); + Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName); Console.Error.WriteLine("---------------------------------"); Console.Error.WriteLine(); From 7ef1927dc2df1617bc1e36ab5c3158b68d98b714 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 13:17:06 -0800 Subject: [PATCH 19/25] Add debugging to C# InstallLocations.cs to determine why the support path is wrong --- csharp/runner/SnippetRunner/InstallLocations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index 3199732..ac8ae76 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -222,7 +222,7 @@ private static bool IsDirectory(string path) Console.Error.WriteLine(); Console.Error.WriteLine("---------------------------------"); - Console.Error.WriteLine("PLATFORM ID: " + PlatformID.MacOSX); + Console.Error.WriteLine("PLATFORM ID: " + Environment.OSVersion.Platform); Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName); Console.Error.WriteLine("---------------------------------"); From e5d98178a8cbd53c4a85a41a2e58d4ff02543705 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 14:01:30 -0800 Subject: [PATCH 20/25] Add debugging to C# InstallLocations.cs to determine why the support path is wrong --- csharp/runner/SnippetRunner/InstallLocations.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index ac8ae76..86382fa 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -201,6 +201,7 @@ private static bool IsDirectory(string path) switch (Environment.OSVersion.Platform) { + case Pl case PlatformID.Win32NT: defaultInstallPath = homeInstall.FullName; defaultSupportPath = homeSupport.FullName; @@ -222,6 +223,7 @@ private static bool IsDirectory(string path) Console.Error.WriteLine(); Console.Error.WriteLine("---------------------------------"); + Console.Error.WriteLine("IS MACOS: " + OperatingSystem.IsMacOS()); Console.Error.WriteLine("PLATFORM ID: " + Environment.OSVersion.Platform); Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName); From e3e080846676b969257c3291692106ffc921dc58 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 14:13:55 -0800 Subject: [PATCH 21/25] Add debugging to C# InstallLocations.cs to determine why the support path is wrong --- csharp/runner/SnippetRunner/InstallLocations.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index 86382fa..b2cac41 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -201,7 +201,6 @@ private static bool IsDirectory(string path) switch (Environment.OSVersion.Platform) { - case Pl case PlatformID.Win32NT: defaultInstallPath = homeInstall.FullName; defaultSupportPath = homeSupport.FullName; From 6fe64f66ac9d9a17d85f0f00fd134aa63561ff00 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 14:20:13 -0800 Subject: [PATCH 22/25] Add debugging to C# InstallLocations.cs to determine why the support path is wrong --- .../runner/SnippetRunner/InstallLocations.cs | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index b2cac41..7814b1b 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -199,31 +199,31 @@ private static bool IsDirectory(string path) string? defaultConfigPath = null; string defaultSupportPath; - switch (Environment.OSVersion.Platform) + if (OperatingSystem.IsWindows()) { - case PlatformID.Win32NT: - defaultInstallPath = homeInstall.FullName; - defaultSupportPath = homeSupport.FullName; - break; - case PlatformID.MacOSX: - defaultInstallPath = homeInstall.FullName; - defaultSupportPath = homeSupport.FullName; - break; - case PlatformID.Unix: - defaultInstallPath = "/opt/senzing/er"; - defaultConfigPath = "/etc/opt/senzing"; - defaultSupportPath = "/opt/senzing/data"; - break; - default: - throw new NotSupportedException( - "Unsupported Operating System: " - + Environment.OSVersion.Platform); + defaultInstallPath = homeInstall.FullName; + defaultSupportPath = homeSupport.FullName; + } + else if (OperatingSystem.IsMacOS()) + { + defaultInstallPath = homeInstall.FullName; + defaultSupportPath = homeSupport.FullName; + } + else if (OperatingSystem.IsLinux()) + { + defaultInstallPath = "/opt/senzing/er"; + defaultConfigPath = "/etc/opt/senzing"; + defaultSupportPath = "/opt/senzing/data"; + } + else + { + throw new NotSupportedException( + "Unsupported Operating System: " + + Environment.OSVersion.Platform); } Console.Error.WriteLine(); Console.Error.WriteLine("---------------------------------"); - Console.Error.WriteLine("IS MACOS: " + OperatingSystem.IsMacOS()); - Console.Error.WriteLine("PLATFORM ID: " + Environment.OSVersion.Platform); Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName); Console.Error.WriteLine("---------------------------------"); From 21d00d822c867c6769f1b752beb3aa6924078df7 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 14:24:16 -0800 Subject: [PATCH 23/25] Removed SENZING_DATA_DIR from github workflow for C# darwin --- .github/workflows/csharp-darwin-snippets.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/csharp-darwin-snippets.yaml b/.github/workflows/csharp-darwin-snippets.yaml index 8f29695..5b0d0d3 100644 --- a/.github/workflows/csharp-darwin-snippets.yaml +++ b/.github/workflows/csharp-darwin-snippets.yaml @@ -35,7 +35,6 @@ jobs: { echo "SENZING_DIR=${SENZING_DIR}" echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib" - echo "SENZING_DATA_DIR=${SENZING_DIR}/data" } >> "$GITHUB_ENV" - name: configure local nuget repo From 9b1277cee22410074ea5880490cdcd47f7d89d79 Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 14:27:09 -0800 Subject: [PATCH 24/25] Removed SENZING_DATA_DIR from github workflow for C# darwin --- csharp/runner/SnippetRunner/InstallLocations.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index 7814b1b..e84de9d 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -222,13 +222,6 @@ private static bool IsDirectory(string path) + Environment.OSVersion.Platform); } - Console.Error.WriteLine(); - Console.Error.WriteLine("---------------------------------"); - Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); - Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName); - Console.Error.WriteLine("---------------------------------"); - Console.Error.WriteLine(); - // check for senzing system properties string? installPath = Environment.GetEnvironmentVariable( "SENZING_DIR"); @@ -239,6 +232,14 @@ private static bool IsDirectory(string path) string? resourcePath = Environment.GetEnvironmentVariable( "SENZING_RESOURCE_DIR"); + Console.Error.WriteLine(); + Console.Error.WriteLine("---------------------------------"); + Console.Error.WriteLine("EXPLICIT SUPPORT PATH: " + supportPath); + Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); + Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName); + Console.Error.WriteLine("---------------------------------"); + Console.Error.WriteLine(); + // normalize empty strings as null if (installPath != null && installPath.Trim().Length == 0) { From f2b4e31f6968efdad6219b390dc4768b0ec1e16b Mon Sep 17 00:00:00 2001 From: "Barry M. Caceres" Date: Wed, 26 Feb 2025 14:31:46 -0800 Subject: [PATCH 25/25] Removed debugging code from InstallLocations.cs and fixed OS detection --- csharp/runner/SnippetRunner/InstallLocations.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/csharp/runner/SnippetRunner/InstallLocations.cs b/csharp/runner/SnippetRunner/InstallLocations.cs index e84de9d..d02c802 100644 --- a/csharp/runner/SnippetRunner/InstallLocations.cs +++ b/csharp/runner/SnippetRunner/InstallLocations.cs @@ -232,14 +232,6 @@ private static bool IsDirectory(string path) string? resourcePath = Environment.GetEnvironmentVariable( "SENZING_RESOURCE_DIR"); - Console.Error.WriteLine(); - Console.Error.WriteLine("---------------------------------"); - Console.Error.WriteLine("EXPLICIT SUPPORT PATH: " + supportPath); - Console.Error.WriteLine("DEFAULT SUPPORT PATH: " + defaultSupportPath); - Console.Error.WriteLine("HOME SUPPORT PATH: " + homeSupport.FullName); - Console.Error.WriteLine("---------------------------------"); - Console.Error.WriteLine(); - // normalize empty strings as null if (installPath != null && installPath.Trim().Length == 0) {