Skip to content

Fix build [#22] #23

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

Merged
merged 1 commit into from
May 9, 2016
Merged

Fix build [#22] #23

merged 1 commit into from
May 9, 2016

Conversation

genehack
Copy link
Contributor

@genehack genehack commented May 9, 2016

Not sure what the removed parenthetical is supposed to be doing, but based on the values I see in , it won't ever match.

This change fixes the build issues I see on both MacOS X and Linux.

@coveralls
Copy link

coveralls commented May 9, 2016

Coverage Status

Coverage remained the same at 96.833% when pulling 85a4e96 on genehack:fix-build-22 into 0a9e56b on sass:develop.

@mgreter
Copy link
Contributor

mgreter commented May 9, 2016

I guess I see what might be the issue. Can you try the following patch:

-       s/\$\*\.c(pp|xx)(?=\n|\Z)/-xc++ -std=c++0x \$\*\.c$1/g
+       s/\$\*\.c(pp|xx)(?=\n|\r|\Z)/-xc++ -std=c++0x \$\*\.c$1/g

The regex tries to match .cpp only before newlines (or end of file; without replacing the actual linefeed character) and it looks like I forgot that there are systems using more "esoteric" linefeeds 👊. Funny since the current regex is working on windows (at least on my multiple systems). If the diff above does not work, can you try to print the string in $_ at that stage, because it really seems to be a simple issue with the regex, and I would like to keep it "strict" to avoid "false" matches.

Thanks!

@genehack
Copy link
Contributor Author

genehack commented May 9, 2016

That change also works. If what you really care about is EOL matching, however, why not the (much easier to read, IMO):

s/\$\*\.c(pp|xx)$/-xc++ -std=c++0x \$\*\.c$1/gm

It's really not clear to me why you're including \Z, for example, unless you expect that string to completely lack a trailing newline.

Here's what's in @rv, FWIW:

.c.i:
        cc  -E -c $(PASTHRU_INC) $(INC) \
        $(CCFLAGS) $(OPTIMIZE) \
        $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \
        $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i

.c.s:
        $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c

.c$(OBJ_EXT):
        $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c

.cpp$(OBJ_EXT):
        $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp

.cxx$(OBJ_EXT):
        $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx

.cc$(OBJ_EXT):
        $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc

.C$(OBJ_EXT):
        $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C

@genehack
Copy link
Contributor Author

genehack commented May 9, 2016

I should also note that, based on conversation within irc.perl.org#toolchain, this bug depends on the installed version of ExtUtils::MakeMaker -- it will not trigger with version 7.10, but will will with anything more recent.

@genehack
Copy link
Contributor Author

genehack commented May 9, 2016

My apologies -- I was accidentally testing your patch, above, with EUMM 7.10.

Once I upgraded back to EUMM 7.16, both your suggested patch and my suggested alternative DO NOT work. My original patch, removing the EOL look-ahead, does work with EUMM 7.16.

@mgreter
Copy link
Contributor

mgreter commented May 9, 2016

TBH, I always struggle to remember what $ is really matching (since depending on multiline flag and implications). So I tend to simply name the chars I want it to match, I just find it easier to read TBH ;) But I agree that what you posted above is probably the "most correct" way to do it. If you can sucessfully test it I will gladly merge the updated PR. And also thx for the info on ExtUtils::MakeMaker.

@genehack
Copy link
Contributor Author

genehack commented May 9, 2016

Per BinGOs in #toolchain, the issue is a trailing space is being added. This patch:

-               s/\$\*\.c(pp|xx)(?=\n|\Z)/-xc++ -std=c++0x \$\*\.c$1/g
+               s/\$\*\.c(pp|xx)\s*(?=\n|\Z)/-xc++ -std=c++0x \$\*\.c$1/g

works around that.

@mgreter
Copy link
Contributor

mgreter commented May 9, 2016

Hmm, maybe there is some space before the newline. TBH if it turns out to be too complicated your first approach will probably just do it. I guess there should not be to many possibilities for false matches. But I am somewhat curious why it should not match the output you posted above for $_.

@mgreter
Copy link
Contributor

mgreter commented May 9, 2016

Can you update and force push this PR? And maybe also include the \r just in case ;)

bingos added a commit to Perl-Toolchain-Gang/ExtUtils-MakeMaker that referenced this pull request May 9, 2016
@genehack
Copy link
Contributor Author

genehack commented May 9, 2016

Force pushed with the addition of the \s* and the \r in the EOL look-ahead.

@@ -224,7 +224,7 @@ my $orig = \&ExtUtils::MM_Unix::c_o;
foreach (@rv) {
# add c++0x flag only for cpp files
# otherwise XS perl handshake fails
s/\$\*\.c(pp|xx)(?=\n|\Z)/-xc++ -std=c++0x \$\*\.c$1/g
s/\$\*\.c(pp|xx)\s*(?=\n|\r|\Z)/-xc++ -std=c++2x \$\*\.c$1/gm
Copy link
Contributor

@mgreter mgreter May 9, 2016

Choose a reason for hiding this comment

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

Why did you change c++0x to c++2x? Oversight? Not sure that even exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

crap, that's just a dumb typo. 1 sec.

@genehack
Copy link
Contributor Author

genehack commented May 9, 2016

Force pushed a version that doesn't have that '2' in there 8^/

Thanks to BinGOs in #toolchain for pointing out the additional space.
@genehack
Copy link
Contributor Author

genehack commented May 9, 2016

And force-pushed one more, taking the m back off the regex modifiers. I think it's about "stop coding" o'clock now...

@mgreter
Copy link
Contributor

mgreter commented May 9, 2016

Just read perlre again ( 😉) and the regex could probably even be further optimized (\s means the five characters [ \f\n\r\t]). Since the star makes it greedy it might eat empty lines, but this should not stop it from working. So it's good enough for me. Let's see if Travis CI is happy and I'll merge! 🚢

@coveralls
Copy link

coveralls commented May 9, 2016

Coverage Status

Coverage remained the same at 96.833% when pulling fdf5180 on genehack:fix-build-22 into 0a9e56b on sass:develop.

@mgreter mgreter merged commit bc55495 into sass:develop May 9, 2016
@mgreter
Copy link
Contributor

mgreter commented May 9, 2016

Thanks for your report, troubleshooting and PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants