Skip to content

Conversation

@yongtang
Copy link
Member

@yongtang yongtang commented Dec 1, 2016

This fix is to address #29005 where continuation after comments are not allowed after #24725.

This fix made the change so that #29005 could be addressed.

An integration test has been added. Other related tests have been udpated to conform to the behavior changes.

Please feel free for any suggestions.

This fix fixes #29005.

/cc @tianon @duglin @thaJeztah

Copy link
Member

@thaJeztah thaJeztah Dec 1, 2016

Choose a reason for hiding this comment

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

This should be modified to match the "old" matching of comments. Due to the "weird" parsing of empty lines in the old behavior, comments not starting at position 0 were actually seen as empty lines / comments.

stripComments() only matches comments that start at position 0, so something like;

if strings.TrimSpace(newline)[0] == '#' {
    continue
}

Copy link
Member

Choose a reason for hiding this comment

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

@tianon gave this short example of how it worked in older versions;

$ docker build -
FROM debian:sid

RUN echo hi \
  # wut
&& echo no \ 
# omg
&& echo yes

Sending build context to Docker daemon 2.048 kB
Step 1 : FROM debian:sid
 ---> 42e8eb53d800
Step 2 : RUN echo hi && echo no && echo yes
 ---> Running in 8109ed576ebd
hi
no
yes
 ---> c661a428bc70
Removing intermediate container 8109ed576ebd
Successfully built c661a428bc70

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @thaJeztah. The PR has been updated using the test case above. Please take a look and let me know if there are any issues.

@thaJeztah thaJeztah added this to the 1.13.0 milestone Dec 1, 2016
This fix is to address moby#29005 where continuation after comments
are not allowed after moby#24725.

This fix made the change so that moby#29005 could be addressed.

An integration test has been added. Other related tests have
been udpated to conform to the behavior changes.

This fix fixes moby#29005, but please feel free for any additional
suggestions.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@yongtang yongtang force-pushed the 29005-continuation-after-comment branch from e5690e8 to 26aa42e Compare December 1, 2016 02:11
vdemeester
vdemeester previously approved these changes Dec 1, 2016
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

@vdemeester vdemeester dismissed their stale review December 1, 2016 09:42

Actually, I think we should only warn ppl about it for now (so reverting the behavior) and in 3 versions, error out.

@thaJeztah
Copy link
Member

I think this PR is one possible solution, I'll add some points to #29005 so that we can discuss the best option

@duglin
Copy link
Contributor

duglin commented Dec 1, 2016

LGTM

1 similar comment
@runcom
Copy link
Member

runcom commented Dec 1, 2016

LGTM

@runcom
Copy link
Member

runcom commented Dec 1, 2016

@thaJeztah @vdemeester any blocker on this PR?

@legendarysrk
Copy link

This fix is not legit/ proper solution for "Allow continuation after comments".#29006 given by #yongtang

@vdemeester
Copy link
Member

I would tend to prefer reverting it for 1.13 (#29064) and re-adding back with warning and depreciation notice later 👼.

@vdemeester vdemeester modified the milestones: 1.13.0, 1.14.0 Dec 2, 2016
@yongtang yongtang deleted the 29005-continuation-after-comment branch December 6, 2016 23:15
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.

Parser in docker 1.13 breaks backwards compatibility for comments in middle of RUN statement

7 participants