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

change uname check in scripts/install_protoc.sh for compatibility with macos #767

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

lugi0
Copy link
Contributor

@lugi0 lugi0 commented Feb 6, 2025

Description

The current version of the install_protoc.sh fails when running make build on MacOS due to a "bad substitution" error

./scripts/install_protoc.sh: line 6: ${OSTYPE,,}: bad substitution
make: *** [bin/protoc] Error 1

The change gets the value of $OSTYPE directly.

Furthermore, uname -s returns Darwin, which does not match against =~ darwin, causing the linux executable to be downloaded instead.
The change looks for both capitalized and non-capitalized versions of the name ([Dd]arwin).

The proposed changes have been tested both in MacOS as well as Fedora

How Has This Been Tested?

ran make build, correct version of protoc downloaded to bin folder

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages; the author will squash them after approval or in case of manual merges will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.

If you have UI changes

  • The developer has added tests or explained why testing cannot be added.
  • Included any necessary screenshots or gifs if it was a UI change.
  • Verify that UI/UX changes conform the UX guidelines for Kubeflow.

@tarilabs
Copy link
Member

tarilabs commented Feb 6, 2025

Furthermore, uname -s returns Darwin, which does not match against =~ darwin, causing the linux executable to be downloaded instead.

I believe the check is intended to make lowercase the return value from uname -s

See ${parameter,,pattern} from:
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion:~:text=%24%7Bparameter%2C%2Cpattern%7D

so regardless if it's coming from uname as Darwin, darwin, dArWiN, etc it was intended to be lowercase'd and checked to be the literal darwin (use of regexp for future extension)

I believe however current PR proposal makes it less Bash-centric and more explicit, so +1

Thanks @lugi0

Copy link
Member

@tarilabs tarilabs left a comment

Choose a reason for hiding this comment

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

per comments

/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tarilabs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 5bffa1f into kubeflow:main Feb 6, 2025
14 checks passed
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.

2 participants