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

Grab-bag of fixes for OS X #1093

Merged
merged 8 commits into from
Aug 21, 2023
Merged

Grab-bag of fixes for OS X #1093

merged 8 commits into from
Aug 21, 2023

Conversation

grebe
Copy link
Collaborator

@grebe grebe commented Aug 7, 2023

No description provided.

@grebe grebe requested a review from proppy August 7, 2023 18:35
@grebe grebe force-pushed the fixes branch 2 times, most recently from f7c7075 to ea72ae3 Compare August 7, 2023 23:10
@grebe grebe requested a review from meheff August 9, 2023 17:19
grebe added 8 commits August 21, 2023 14:31
On GNU systems, strerror_r() returns char*, but on XSI systems it
returns int. When checking the return value, we need to either compare
with 0 or nullptr.
/bin/sh on OS X is very limited. Also, do some very minor cleanup.
On OS X, symbols are prepended with an underscore.
These have fixes for running on OS X.
@copybara-service copybara-service bot merged commit 2ae4c99 into google:main Aug 21, 2023
@@ -42,7 +42,7 @@ TEST(SubprocessTest, EmptyArgvFails) {

TEST(SubprocessTest, NonZeroExitWorks) {
auto result = InvokeSubprocess(
{"/bin/sh", "-c", "echo -n hey && echo -n hello >&2 && exit 10"},
{"/bin/bash", "-c", "echo -n hey && echo -n hello >&2 && exit 10"},
Copy link
Member

Choose a reason for hiding this comment

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

While /bin/sh is pretty universally installed on Unix-like systems, /bin/bash is not (and so this test fails now on minimal Unix systems or where bash is in a different path).
What were the things that didn't work in OSX, could we re-work it to work with the minimal bourne shell available there ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The flags passed to echo weren't supported by /bin/sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants