Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(stm32CubeProg): fallback to BSD getopt on mac#100

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fpistm merged 1 commit intostm32duino:mainfromfpistm:getopt
Jul 17, 2024

Conversation

fpistm
Copy link
Member

@fpistmfpistm commentedJul 1, 2024
edited
Loading

By default, MacOS uses getopt from FreeBSD and not the GNU-based one.
Then "-o" and long options are not supported except if gnu-getopt is installed.

Fixes#99

Main advantage to kept GNU getopt by default is it is able to deal with space in arguments.
Install the packagegnu-getopt via e.g.Homebrew:

brew install gnu-getopt

If not installed the BSD getopt is used but long option and space in arguments are not supported.

StevenRCE0 reacted with thumbs up emoji
@fpistmfpistm added the enhancementNew feature or request labelJul 1, 2024
@fpistmfpistm added this to the2.2.3 milestoneJul 1, 2024
@fpistmfpistmforce-pushed thegetopt branch 2 times, most recently from439a07d to4020213CompareJuly 15, 2024 13:10
@fpistmfpistmforce-pushed thegetopt branch 2 times, most recently from8fee15e to1c5f1bdCompareJuly 15, 2024 14:59
if ! command -v $STM32CP_CLI >/dev/null 2>&1; then
aborting
fi
if ! command -v /usr/local/opt/gnu-getopt/bin/getopt >/dev/null 2>&1; then

Choose a reason for hiding this comment

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

By the way, for Apple Silicon devices, the path should be/opt/homebrew/opt/gnu-getopt/, maybe this needs to be checked as well?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hi@lhvy
Thanks for the feedback, I'm not familiar with mac.
So something like this:

if!command -v /usr/local/opt/gnu-getopt/bin/getopt>/dev/null2>&1;thenif!command -v /opt/homebrew/opt/gnu-getopt/bin/getopt>/dev/null2>&1;thenecho"Warning: long options not supported due to getopt from FreeBSD usage."        GNU_GETOPT=nelseexport PATH="/opt/homebrew/opt/gnu-getopt/bin":"$PATH"fielseexport PATH="/usr/local/opt/gnu-getopt/bin":"$PATH"fi

By default, MacOS uses getopt from FreeBSD and not the GNU-based one.Then "-o" and long options are not supported except if gnu-getoptis installed.Fixesstm32duino#99Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistmfpistm changed the titlefix(stm32CubeProg): use BSD getoptfix(stm32CubeProg): fallback to BSD getopt on macJul 17, 2024
@fpistmfpistm merged commit17a14b7 intostm32duino:mainJul 17, 2024
@fpistmfpistm deleted the getopt branchJuly 17, 2024 15:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@lhvylhvylhvy left review comments

Assignees
No one assigned
Labels
enhancementNew feature or request
Projects
Milestone
2.2.3
Development

Successfully merging this pull request may close these issues.

Cannot upload sketch on MacOS
2 participants
@fpistm@lhvy

[8]ページ先頭

©2009-2025 Movatter.jp