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

statesmith 0.17.4 (new formula) #207657

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

emmby
Copy link

@emmby emmby commented Feb 14, 2025

  • [x ] Have you followed the guidelines for contributing?
  • [ x] Have you ensured that your commits follow the commit style guide?
  • [ x] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [ x] Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [x ] Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • [ x] Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

@github-actions github-actions bot added autosquash Automatically squash pull request commits according to Homebrew style. new formula PR adds a new formula to Homebrew/homebrew-core dotnet .NET use is a significant feature of the PR or issue labels Feb 14, 2025
Copy link
Contributor

Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

@github-actions github-actions bot added the icu4c ICU use is a significant feature of the PR or issue label Feb 14, 2025
@emmby
Copy link
Author

emmby commented Feb 14, 2025

Hm, have y'all see this before? Looks like there's a return in Application Support when dotnet tries to access Environment.SpecialFolder

Creating settings directory: /Users/brew/Library/Application 
  Support/StateSmith.Cli

Running on my own mac osx 15 doesn't seem to have this problem

mike@mac homebrew-core % ss.cli --version                                    
Creating settings directory: /Users/mike/Library/Application Support/StateSmith.Cli
StateSmith.Cli 0.17.4

@emmby
Copy link
Author

emmby commented Feb 19, 2025

The "Application <CR><LF>Support" problem seems to be specific to the brew environment.

If I run the exact same binary in my shell it works fine, but if I run it from brew test or brew install it fails:

mike@mac homebrew-core % brew uninstall statesmith
Error: No such keg: /opt/homebrew/Cellar/statesmith
mike@mac homebrew-core % brew reinstall --build-from-source statesmith
Warning: building from source is not supported!
You're on your own. Failures are expected so don't create any issues, please!
==> Fetching statesmith
==> Downloading https://github.com/StateSmith/StateSmith/archive/refs/tags/cli-v0.17.4.tar.gz
Already downloaded: /Users/mike/Library/Caches/Homebrew/downloads/7f182b42e3ed0066ed215e3c1904aa7b3c3a55459b2ef8cc457c19715083e452--StateSmith-cli-v0.17.4.tar.gz
==> Reinstalling statesmith 
==> dotnet publish -c Release -p:PublishSingleFile=true --self-contained --framework net8.0 /p:DefineConstants=SS_SINGLE_FILE_APPLICATION
🍺  /opt/homebrew/Cellar/statesmith/0.17.4: 7 files, 148.4MB, built in 12 seconds
==> Running `brew cleanup statesmith`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
mike@mac homebrew-core % rm -rf ~/Library/Application\ Support/StateSmith.Cli
mike@mac homebrew-core % /opt/homebrew/Cellar/statesmith/0.17.4/bin/ss.cli --version
Creating settings directory: /Users/mike/Library/Application Support/StateSmith.Cli
StateSmith.Cli 0.17.4


mike@mac homebrew-core % rm -rf ~/Library/Application\ Support/StateSmith.Cli       
mike@mac homebrew-core % brew test statesmith                    
==> Testing statesmith
==> /opt/homebrew/Cellar/statesmith/0.17.4/bin/ss.cli --version
Last 15 lines from /Users/mike/Library/Logs/Homebrew/statesmith/test.01.ss.cli:

/opt/homebrew/Cellar/statesmith/0.17.4/bin/ss.cli
--version

Creating settings directory: /Users/mike/Library/Application 
Support/StateSmith.Cli
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/Users/mike/Library/Application Support/StateSmith.Cli' is denied.
 ---> System.IO.IOException: Operation not permitted
   --- End of inner exception stack trace ---
   at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode)
   at System.IO.Directory.CreateDirectory(String path)
   at StateSmith.Cli.Data.DataPaths.GetOrMakeDataDirPath()
   at StateSmith.Cli.Data.DataPaths..ctor(IAnsiConsole console)
   at StateSmith.Cli.Program..ctor(String currentDirectory)
   at StateSmith.Cli.Program.Main(String[] args)
Error: statesmith: failed
Warning: Removed Sorbet lines from backtrace!

It doesn't seem to be a problem with ruby, just with brew. If I make the same call from a test ruby script using system, it works fine:

system("/opt/homebrew/Cellar/statesmith/0.17.4/bin/ss.cli --version")
mike@mac StateSmith % ruby test.rb                                        
Creating settings directory: /Users/mike/Library/Application Support/StateSmith.Cli
StateSmith.Cli 0.17.4

@emmby
Copy link
Author

emmby commented Feb 19, 2025

Is there a way to enable Full disk access for tests? I'm wondering if the CRLF is a red herring and the real problem is that ss.cli does not have full disk access and so cannot write to the user's home directory when running tests.

@SMillerDev
Copy link
Member

Is there a way to enable Full disk access for tests?

No, we very explicitly sandbox everything in a formula test to a tmp directory. $HOME will be set to that directory though, so the program should install there without any issues.

@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Feb 21, 2025
@emmby
Copy link
Author

emmby commented Feb 21, 2025

Is there a way to enable Full disk access for tests? I'm wondering if the CRLF is a red herring and the real problem is that ss.cli does not have full disk access and so cannot write to the user's home directory when running tests.

For posterity: the CRLF symptom is confirmed as a red herring. The real problem was that the brew sandbox was preventing writes to the Application Support directory as described in https://github.com/orgs/Homebrew/discussions/5966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet .NET use is a significant feature of the PR or issue icu4c ICU use is a significant feature of the PR or issue new formula PR adds a new formula to Homebrew/homebrew-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants