Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local get_ss3_exe w/ gh::gh() token fix (refactor get_ss3_exe if-else platform/os) #110

Closed
efletcherPIFSC opened this issue Nov 15, 2024 · 0 comments · Fixed by #111
Closed
Assignees
Labels
topic: Stock-Synthesis Specific for Stock-Synthesis Models or its functionality

Comments

@efletcherPIFSC
Copy link
Collaborator

efletcherPIFSC commented Nov 15, 2024

Fix nmfs-ost SAML auth issues with found with #109 to implement r4ss::get_ss3_exe with gh::gh NA_character token fix

Create a local get_ss3_exe R script to maintain compatibility with r4ss 1.49.3 and implement gh::gh() token issue fixes (#109 (comment))


os/platform if-else control statement for r4ss/r4ss get_ss3_exe can be optimized

The following the pseudo code for the if-else statement based on "current" implementation (at the time of issue was created) of get_ss3_exe

  • If .Platform OS.type is windows
    • If r_arch is 32-bit then warn user "(Windows) 32-bit Stock Synthesis executable isn't available"
    • else download the target version (tag) of Stock Synthesis windows binary (ss3_win.exe) from nmfs-ost/ss3-source-code
  • else
    • If (the first 6 characters of) R.version os matches "darwin" and R.version arch is "aarch64" then download the target version (tag) of Stock Synthesis binary (ss3_osx_arm64.exe) from nmfs-ost/ss3-source-code
    • else
      • If (the first 6 characters of) R.version os matches "darwin" and R.version arch is "x86_64" then download the target version (tag) of Stock Synthesis binary (ss3_osx.exe) from nmfs-ost/ss3-source-code
      • else
        • If .Platform OS.type is linux-gnu then download the target version tag of Stock Synthesis binary (ss3_linux) from nmfs-ost/ss3-source-code
        • else throw ss3 not available for platform error

Possible Solution

Unify control statements using R.version stating:

  • match mingw32 for windows
  • macOS: Check R.version$os the first 6 characters matches "darwin"
  • match linux-gnu for linux
  • throw error for other matchers
  • IF Windows
    • 32-bit check
    • get ss3_win.exe
  • ELSE IF "darwin" (macOS)
    • ss3_osx_arm64.exe
    • ss3_osx.exe
  • ELSE IF "linux" get ss3_linux
  • ELSE error
@efletcherPIFSC efletcherPIFSC added the topic: Stock-Synthesis Specific for Stock-Synthesis Models or its functionality label Nov 15, 2024
@efletcherPIFSC efletcherPIFSC self-assigned this Nov 15, 2024
@efletcherPIFSC efletcherPIFSC moved this to In Progress in ss3diags dev project Nov 15, 2024
efletcherPIFSC added a commit that referenced this issue Nov 15, 2024
@efletcherPIFSC efletcherPIFSC linked a pull request Nov 16, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in ss3diags dev project Nov 16, 2024
@efletcherPIFSC efletcherPIFSC changed the title refactor get_ss3_exe if-else platform/os Local get_ss3_exe w/ gh::gh() token fix (refactor get_ss3_exe if-else platform/os) Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: Stock-Synthesis Specific for Stock-Synthesis Models or its functionality
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant