GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix failing test and the false negative CI by zhsj · Pull Request #19 · moby/sys

Conversation

@zhsj

@zhsj zhsj commented Jun 25, 2020

Copy link
Copy Markdown
Contributor

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@zhsj
zhsj force-pushed the fix-test branch from 62b6839 to 8e33885 Compare June 25, 2020 16:09
zhsj
zhsj commented Jun 25, 2020
View reviewed changes
Comment thread mountinfo/mountinfo_linux.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

thaJeztah
thaJeztah reviewed Jun 25, 2020
View reviewed changes
Comment thread Makefile
@@ -1,3 +1,4 @@
.SHELLFLAGS = -ec

@thaJeztah thaJeztah Jun 25, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🤔 isn't that usually the default? Is that some weird configuration in GH Actions?

edit: ah! interesting https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html

The default value of .SHELLFLAGS is -c normally, or -ec in POSIX-conforming mode.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
thaJeztah
thaJeztah approved these changes Jun 25, 2020
View reviewed changes

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

@kolyshkin PTAL

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SamWhited

SamWhited commented Jun 25, 2020

Copy link
Copy Markdown

Would setting .POSIX: also fix this? I normally stick this at the top of my makefiles since it's portable between GNU Make and NetBSD Make (though that doesn't really matter here).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zhsj

zhsj commented Jun 26, 2020

Copy link
Copy Markdown
Contributor Author

Would setting .POSIX: also fix this? I normally stick this at the top of my makefiles since it's portable between GNU Make and NetBSD Make (though that doesn't really matter here).

I just know this .POSIX: syntax.. However IMO it's less clear than .SHELLFLAGS.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kolyshkin
kolyshkin reviewed Jun 29, 2020
View reviewed changes
Comment thread mountinfo/mountinfo_linux.go Outdated
for j := 2; j < 4; j++ { // one digit already; two more
x := s[j] - '0'
if x < 0 || x > 7 {
if x > 7 {

@kolyshkin kolyshkin Jun 29, 2020

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

OK I think the correct thing to do would be

if s[j] < '0' || s[j] > '7' {
  return "", fmt.Errorf("bad escape sequence %q: not a digit", s[:3])
}
x := s[j] - '0'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kolyshkin kolyshkin Jun 29, 2020

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This won't fix anything (we will still catch underflow in case s[j] is less than '0'), but it's a tad cleaner code with no ambiguity.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kolyshkin

kolyshkin commented Jun 29, 2020

Copy link
Copy Markdown
Collaborator

Thank you for the fixes! Can you please split it into 3 commits:

  • Fixing the test case
  • Fixing the is-octal-digit check
  • fixing the make flags

with a brief commit message describing the reason for the change.

Otherwise it won't be easy to follow the git history

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zhsj added 3 commits July 1, 2020 03:01
@zhsj
makefile: fix test exit code
8589e2e
Add -e to .SHELLFLAGS, so for loop can fail correctly

Signed-off-by: Shengjing Zhu <[email protected]>
@zhsj
mountinfo: fix test case in TestParseMountinfoWithSpaces
9693022
Align the test result after:

0b171c2
mountinfo: also unescape fstype and source

Signed-off-by: Shengjing Zhu <[email protected]>
@zhsj
mountinfo: fixing is-octal-digit check
ed8a4e4
The old check is always true when comparing with 0, since x is byte type

Signed-off-by: Shengjing Zhu <[email protected]>
@zhsj
zhsj force-pushed the fix-test branch from 8e33885 to ed8a4e4 Compare June 30, 2020 19:13
@zhsj

zhsj commented Jun 30, 2020

Copy link
Copy Markdown
Contributor Author

Thank you for the fixes! Can you please split it into 3 commits:

  • Fixing the test case
  • Fixing the is-octal-digit check
  • fixing the make flags

with a brief commit message describing the reason for the change.

Otherwise it won't be easy to follow the git history

done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thaJeztah
thaJeztah approved these changes Jun 30, 2020
View reviewed changes

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM, thanks!

@kolyshkin PTAL

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kolyshkin
kolyshkin approved these changes Jun 30, 2020
View reviewed changes

@kolyshkin kolyshkin left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kolyshkin
kolyshkin merged commit 9e8d3ad into moby:master Jun 30, 2020
@zhsj
zhsj deleted the fix-test branch June 30, 2020 19:36
This was referenced Dec 2, 2020
[19.03 backport] static: add containerd-shim-runc-v2 docker/docker-ce-packaging#504
Merged
Makefile: switch to POSIX mode to handle errors docker/containerd-packaging#208
Closed
Makefile: switch to POSIX mode to handle errors moby/moby#41741
Closed
@thaJeztah thaJeztah mentioned this pull request Jan 14, 2022
CI: mac os x linter warnings ignored #99
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@thaJeztah thaJeztah thaJeztah approved these changes
@kolyshkin kolyshkin kolyshkin approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@zhsj @SamWhited @kolyshkin @thaJeztah
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.