-
Notifications
You must be signed in to change notification settings - Fork 463
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
[RFC] Add back gcc 4.4 compatibility #1623
base: 3.4-stable
Are you sure you want to change the base?
Conversation
ad80b79
to
2f6fa3b
Compare
I was able to get it to compile with gcc 4.4.2, so it seems it had proper support for variadic templates. Tested it via various old strawberry perl portable installs for windows (which come with different gcc toolchains). Might be that I use different cflags on the perl-libsass install, because I think this posed a problem when I tried some time ago. For documentation here how I compile in the perl portableshell: git clone http://www.github.com/sass/perl-libsass --branch=latest
cd perl-libsass
cpan . # only needed once for deps
perl Makefile.PL
dmake -P9 test |
This is essential to use this module on Centos6 based hosts, in corporate environments |
How so? I routinely build LibSass on centos 5. Updating GCC is trivial
|
IMHO we cannot do this without also running GCC 4.4 in CI as well |
In our corporate environment, we are required to stick to the officially supported Centos6 releases of GCC, which is stuck at 4.4.7. And while there are a whole host of work-around, that's not the route we want our developers to go down if we can help it. |
b9e7d4d
to
d85d9fd
Compare
src/ast.hpp
Outdated
@@ -309,7 +309,7 @@ namespace Sass { | |||
virtual void adjust_after_pushing(std::pair<Expression*, Expression*> p) { } | |||
public: | |||
Hashed(size_t s = 0) : elements_(ExpressionMap(s)), list_(std::vector<Expression*>()) | |||
{ elements_.reserve(s); list_.reserve(s); reset_duplicate_key(); } | |||
{ /* elements_.reserve(s); */ list_.reserve(s); reset_duplicate_key(); } |
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.
#995 adds an autoconf macro here:
+#ifdef HAVE_CXX_UNORDERED_MAP_RESERVE
+ elements_.reserve(s); list_.reserve(s);
+#endif
For non-autoconf builds it stays undefined, so no harm here.
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.
Ordered Map doesn't seem to support it anyway, so I guess this has resolved itself.
I have rebased this to latest master and fixed the remaining issue with mac clang. I pretty much would like to get this merged, as it would allow perl-libsass to autodetect this and apply the last "patch" in form of the script in the second commit to the source tree. To get the git tree 4.4 compatible, we would need to get rid of all @ArcticSnowman would that be good enough to support your use case? It does add the dependency on the perl script, but perl should be widely available or you can always generate the gcc 4.4 compatible source tree somewhere else and transfer it (or generate a patch to apply). Since the proof is in the pudding (libsass via strawberry perl and gcc 4.4.3 on windows): mkdir libsass-gcc-4.4
cd libsass-gcc-4.4
wget -c http://strawberryperl.com/download/5.12.3.0/strawberry-perl-5.12.3.0-portable.zip
mkdir perl
cd perl
unzip ..\strawberry-perl-5.12.3.0-portable.zip
portableshell.bat
git clone https://github.com/sass/perl-libsass.git
cd perl-libsass
git submodule update --init
cd libsass
git remote add mgreter https://github.com/mgreter/libsass.git
git fetch mgreter
git checkout -b compat/gcc-4.4 mgreter/compat/gcc-4.4
perl script\replace-range-for-loops.pl
cd ..
perl -MCPAN -e "CPAN::Shell->notest('install', 'ExtUtils::CppGuess')"
perl -MCPAN -e "CPAN::Shell->notest('install', 'Test::Differences')"
perl -MCPAN -e "CPAN::Shell->notest('install', 'Encode::Locale')"
gcc -v
cpan . |
I also like the short |
IMO any code change may add something gcc 4.4 incompatible (I did so with ltrim/rtrim). I guess there are always chances we need to fix up these incompatibilites at a later stage, and I don't see the short for loops as an exclusion here. And as a developer I really would like to keep the convenience. |
Please a documentation page for compiling with gcc 4.4 which at the very IMO any code change may add something gcc 4.4 incompatible (I did so with — |
My shop only supports GCC 4.4.7 on our production machines. I'd love to see this get merged in, and libsass-python library updated when it's ready. |
+1 most production environments aren't going to support gcc5 for a while, it would be nice to keep Saas working without requiring crazy-bleeding-edge versions of things. Enterprise life-cycles are measured in years, not months... |
I'm open to a PR for cpplint style check in CI. With cinema level
|
e85b4cb
to
10d21d5
Compare
10d21d5
to
f5e12bf
Compare
f5e12bf
to
5a9953b
Compare
5a9953b
to
a056e7a
Compare
Any progress on this, or is it decided to not have 4.4 support?
Still seems pretty unreasonable that libsass can't be used on CentOS 6 (LOTS of shared-hosting boxes). |
I'm regularly releasing perl-libsass with gcc 4.4 support. The archive contains gcc 4.4 compatible libsass sources (this branch with unrolled for loops). On compatible systems it should also automatically compile and install sassc plus libsass plugins. Unfortunately I wasn't able to convince other libsass maintainers to get this merged into master (see their comments/reasoning above), but you could try to apply the patches in this branch on any implementation (i.e. node-sass). Then you only need to execute |
12b785d
to
a7ee270
Compare
3d438f1
to
47c834b
Compare
47c834b
to
a45228d
Compare
a45228d
to
badc22f
Compare
badc22f
to
8b98d23
Compare
Do we still want to deal with non C++ 11 compilers in 2019? |
I will and have updated this branch for perl-libsass and will do so in the future. |
I'm curious, why does Perl require such an old GCC version? |
There are quite a few CPAN testers that still use 4.4, there are even some that are still on gcc 4.2. |
Since I get quite a few build fails from cpan test matrix for gcc 4.4, I tried how difficult it is to bring back gcc 4.4 compatibility based upon some previous work. It actually is not too hard to get libsass compiled with gcc 4.4 (and passing the spec tests). I want to put this PR into consideration, since I would like to apply the
replace-range-for-loops.pl
automatically when gcc 4.4 is detected by perl-libsass. Falls under "nice to have", but changes seem rather minimal.The perl script produces this result: https://github.com/sass/libsass/tree/perl-libsass/gcc-4.4
Proof of concept:
Feedback welcome