Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

hashtable.c can't be compiled with msvc14 on windows #396

Closed stuertz closed 4 years ago

stuertz commented 4 years ago

As already discussed in #393 and worked around in #394 the c extension can't be compiled on windows because of invalid code for the msvc14 compiler in hashtable.c which is originated from https://gist.github.com/tonious/1377667.

They have newer versions over there, that may fix this and a lot of other bugs with the hashtable.

Or replace it with any other hashtable, or even use c++ std::unordered_map, or take a look at https://stackoverflow.com/questions/1138742/looking-for-a-good-hash-table-implementation-in-c

2020-03-26T15:45:53.6880166Z   C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\bld\pyscss_1585237441034\_h_env\include -ID:\bld\pyscss_1585237441034\_h_env\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" -ID:\bld\pyscss_1585237441034\_h_env\Library\include -ID:\bld\pyscss_1585237441034\_h_env\Library\include /Tcscss/src/hashtable.c /Fobuild\temp.win-amd64-3.6\Release\scss/src/hashtable.obj
2020-03-26T15:45:53.6996221Z   hashtable.c
2020-03-26T15:45:53.7496203Z   scss/src/hashtable.c(46): error C2036: 'const void *': unknown size
2020-03-26T15:45:53.7579614Z   ==========================================================================
2020-03-26T15:45:53.7580323Z   WARNING: The C extension could not be compiled, speedups are not enabled.
2020-03-26T15:45:53.7580831Z   Failure information, if any, is above.
2020-03-26T15:45:53.7581174Z   Retrying the build without the C extension now.
Kronuz commented 4 years ago

Most likely, line scss/src/hashtable.c:46:

tail = (const unsigned char *)(key + nblocks * 4);

Should instead be:

tail = (const unsigned char *)(key) + nblocks * 4;

Please someone try it out and make a pull request.

@e0ne, could you please follow up on this one if you get a chance?

e0ne commented 4 years ago

Unfortunately, I don't have Windows environment so I can't test the fix. It would be good if somebody could test the fix mentioned above

stuertz commented 4 years ago

maybe I can have a look on it over the weekend ;-)