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

Portability fixes for configure#270

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
eddelbuettel merged 1 commit intoRcppCore:masterfrommsk:configure-portability
Sep 30, 2019

Conversation

@msk
Copy link
Contributor

@mskmsk commentedSep 30, 2019

Thetest command, as well as the[ command, is not required to
know the== operator. Only a few implementations like bash and some
versions of ksh support it.

When you runtest foo == foo on a platform that does not support the
== operator, the result will be false instead of true. This can lead
to unexpected behavior.

kthohr reacted with thumbs up emoji
The `test` command, as well as the `[` command, is not required toknow the `==` operator. Only a few implementations like bash and someversions of ksh support it.When you run `test foo == foo` on a platform that does not support the`==` operator, the result will be false instead of true. This can leadto unexpected behavior.
@eddelbuettel
Copy link
Member

eddelbuettel commentedSep 30, 2019
edited
Loading

I have memories of having fought this before, making me unlikely to wanting to return to this.bash it is. I generally change these things only when CRAN asks me too, and as it works even on their Solaris machine the status quo may not change easily.

We also recommend filing an issue ticket prior to making PRs to not waste effort.

So let's turn this then into the issue you never filed: What type of platform would require this?

@msk
Copy link
ContributorAuthor

msk commentedSep 30, 2019

Thank you for quick feedback.

NetBSD is one of the platforms requiring this change. I am a developer ofpkgsrc, the package management system for NetBSD and many other OS's, and had to add this change as a local patch when I packaged RcppArmadillo for pkgsrc.

I understand your concern about potential problems a build script change like this may cause. However, this PR is not adding anything that RcppArmadillo is not already using. RcppArmadillo'sconfigure uses= (mostly autoconf-generated) more often then==.

❯ grep "if test " configure | grep " = " | wc -l      33❯ grep "if test " configure | grep " == " | wc -l       6

and evenconfigure.ac has one:

❯ grep "if test " configure.ac | grep " = "if test "${GXX}" = yes; then

So, changing== to= is not only for portability but also for consistency.

@kevinushey
Copy link
Contributor

FWIWs1 = s2 is mandated by POSIX (https://pubs.opengroup.org/onlinepubs/009695399/utilities/test.html), whiles1 == s2 is not. So I would agree that using= rather than== is warranted for portability (even ifbash remains the default shell as appropriate).

As far as I know,== is abash-ism that does exactly the same thing as=, so there shouldn't be any risk.

coatless and eddelbuettel reacted with thumbs up emoji

@eddelbuettel
Copy link
Member

I looked more closely (now that I am back from traveling) and the changes toconfigure.ac are pretty short and sweet and straight (and affect mostly contributed code, hi@kthohr ;-) ) so I think I'll just merge this. (And we didn't really need a change toconfigure as it gets generated anyway but doesn't hurt...)

@eddelbuetteleddelbuettel merged commit0fdb3e3 intoRcppCore:masterSep 30, 2019
@kthohr
Copy link
Contributor

#170

Some of those pre-dated my PR ;-)

@eddelbuettel
Copy link
Member

;-) No worries.

eddelbuettel added a commit that referenced this pull requestOct 1, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@eddelbuetteleddelbuetteleddelbuettel approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@msk@eddelbuettel@kevinushey@kthohr

[8]ページ先頭

©2009-2025 Movatter.jp