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

Fix global services not starting on macOS Sonoma #163

Merged
merged 10 commits into from
Feb 16, 2024

Conversation

kierenevans
Copy link
Collaborator

My gut feeling is that macOS Sonoma does not like files named something.service.

When calling ws global service proxy restart for example, the output is nothing, the exit code is 0, it just does nothing!

When experimenting, copying the file to a different name let it execute, however as the code referred to ws.service for launching services, we couldn't get things fully working.
It may also be the way the home directory folder gets installed, so this may not be the issue.

Let's test this out for people that are having this issue.

Also fixed an issue with #149 on my system where variables_order=GPCS instead of variables_order=EGPCS in the system php.ini.

@andytson-inviqa
Copy link
Contributor

andytson-inviqa commented Feb 16, 2024

what's strange though is it works fine for me on MacOS Sonoma, although aws it uses my host aws

dash is definitely more standard for cli plugin systems though

passthru(sprintf('cd %s/bin/ && ln -sf ./ws-aws ./ws.aws', $path));
passthru(sprintf('cd %s/bin/ && ln -sf ./ws-poweroff ./ws.poweroff', $path));
passthru(sprintf('cd %s/bin/ && ln -sf ./ws-service ./ws.service', $path));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would we use the . version for after this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case something in the harnesses use it. I don't think we do though, only ws.aws.

*/
private function buildEnv(): array
{
return getenv();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is apparently, since 8.0, but try

Suggested change
return getenv();
return getenv(null, true);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's default null is just not supplied and confused

Copy link
Collaborator Author

@kierenevans kierenevans Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that locally but phpstan wasn't having it (even latest phpstan version, even with the phpVersion config in phpstan.neon).

Copy link
Contributor

@andytson-inviqa andytson-inviqa Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry joke incoming

Suggested change
return getenv();
$env = [];
foreach (array_keys(getenv()) as $key) {
$value = getenv($key, true);
if ($value !== false) {
$env[$key] = $value;
}
}
return $env;

at least no http request variables in cli though so nvm

@kierenevans kierenevans merged commit 6a6fbe0 into 0.3.x Feb 16, 2024
5 checks passed
@kierenevans kierenevans deleted the fix-global-services-not-starting-on-macos-sonoma branch February 16, 2024 17:52
kierenevans added a commit that referenced this pull request Feb 20, 2024
@kierenevans kierenevans added the bug Something isn't working label Feb 20, 2024
andytson-inviqa pushed a commit that referenced this pull request Feb 21, 2024
Related to #163, add some tests surrounding the installation of the home
directory global services and the ability to run them on macOS Sonoma.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants