Giter VIP home page Giter VIP logo

Comments (12)

asottile avatar asottile commented on July 17, 2024

Gentoo is elevating the warning to an error, that's on them

from libsass-python.

thesamesam avatar thesamesam commented on July 17, 2024

We're definitely not. It's Clang that's bailing out.

Note that in this case, it's not just saying "unknown argument, treating as an error" (which Clang can do and there's a way to suppress it), it's actually saying "-std is valid for C but I have no idea what value you just told me to use" (because C++ happens to have a -std too). In this case, it's not an unknown option causing the failure, but garbage ("c++0x", wrt a C compiler) passed into an argument which happens to be valid in C (-std).

But it's always invalid to pass CXXFLAGS to a C compiler anyway. For example, -Werror=odr is completely valid for C++, and means nothing for C. So, even if we were, it'd be something to fix (if minor).

Could you elaborate on what you mean please?

from libsass-python.

asottile avatar asottile commented on July 17, 2024

it's building fine for us on clang so it's (as last time and as usual with Gentoo) something they're doing

from libsass-python.

thesamesam avatar thesamesam commented on July 17, 2024

The flags setup.py passes to CC are always C++ only. There's no variable used to just pass to CC.

On a fresh clone of libsass-python:

$ python setup.py build
/usr/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
running build
running build_py
running build_ext
building '_sass' extension
x86_64-pc-linux-gnu-gcc -Wsign-compare -DNDEBUG -fPIC -DPy_LIMITED_API -I./libsass/include -I/usr/include/python3.11 -c _sass.c -o build/temp.linux-x86_64-cpython-311/_sass.o -fPIC -std=gnu++0x -Wall -Wno-parentheses -Werror=switch -DLIBSASS_VERSION=\"3.6.5\"
cc1: warning: command-line option ‘-std=gnu++11’ is valid for C++/ObjC++ but not for C
x86_64-pc-linux-gnu-gcc -Wsign-compare -DNDEBUG -fPIC -DPy_LIMITED_API -I./libsass/include -I/usr/include/python3.11 -c libsass/src/ast.cpp -o build/temp.linux-x86_64-cpython-311/libsass/src/ast.o -fPIC -std=gnu++0x -Wall -Wno-parentheses -Werror=switch -DLIBSASS_VERSION=\"3.6.5\"

/tmp/libsass-python $ CC=clang python setup.py build
/usr/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
running build
running build_py
running build_ext
building '_sass' extension
clang -Wsign-compare -DNDEBUG -fPIC -DPy_LIMITED_API -I./libsass/include -I/usr/include/python3.11 -c _sass.c -o build/temp.linux-x86_64-cpython-311/_sass.o -fPIC -std=gnu++0x -Wall -Wno-parentheses -Werror=switch -DLIBSASS_VERSION=\"3.6.5\"
error: invalid argument '-std=gnu++0x' not allowed with 'C'
error: command '/usr/lib/llvm/15/bin/clang' failed with exit code 1

It's just that GCC doesn't bail out on this, but Clang does. setup.py doesn't treat CC and CXX differently and hence always passes C++ specific flags.

Could you show me where e.g. your CI builds with Clang so I can try spot what the difference is? I looked at Azure but I couldn't spot the right part. Thanks!

from libsass-python.

asottile avatar asottile commented on July 17, 2024

the macos builds run on clang for example

from libsass-python.

mgorny avatar mgorny commented on July 17, 2024

The MacOS builds use platform.system() == 'Darwin' code path that applies different flags than Linux builds. Also, clang's behavior varies across platforms.

from libsass-python.

mazunki avatar mazunki commented on July 17, 2024

Would be cool if developers actually listened to maintainers instead of blaming them for reporting errors :)

from libsass-python.

asottile avatar asottile commented on July 17, 2024

would be cool if package maintainers actually maintained instead of throwing things over the fence -- our builds are green

from libsass-python.

mazunki avatar mazunki commented on July 17, 2024

Passing checks is only sufficient if checks encompass the whole scope. If you don't care about clang on Linux, just say that instead.

from libsass-python.

AndrewAmmerlaan avatar AndrewAmmerlaan commented on July 17, 2024

would be cool if package maintainers actually maintained instead of throwing things over the fence -- our builds are green

What is this supposed to mean? The package maintainers are maintaining it, in fact the problem has already been fixed in the Gentoo repository. This Issue is an attempt to bring the fix to the rest of Linux, hardly "throwing things over the fence", I would appreciate a more constructive attitude from your side.

from libsass-python.

asottile avatar asottile commented on July 17, 2024

I don't see a patch?

from libsass-python.

AndrewAmmerlaan avatar AndrewAmmerlaan commented on July 17, 2024

I don't see a patch?

You can find the sed command we use to fix this issue in the bug report I linked in my first post. But since you asked so nicely I went ahead and put it in a patch form for you:

diff --git a/setup.py b/setup.py
index a3719a9..95ccf1f 100644
--- a/setup.py
+++ b/setup.py
@@ -15,10 +15,10 @@ from setuptools import setup
 
 MACOS_FLAG = ['-mmacosx-version-min=10.7']
 FLAGS_POSIX = [
-    '-fPIC', '-std=gnu++0x', '-Wall', '-Wno-parentheses', '-Werror=switch',
+    '-fPIC',  '-Wall', '-Wno-parentheses', '-Werror=switch',
 ]
 FLAGS_CLANG = ['-c', '-O3'] + FLAGS_POSIX + ['-stdlib=libc++']
-LFLAGS_POSIX = ['-fPIC',  '-lstdc++']
+LFLAGS_POSIX = ['-fPIC',  ]
 LFLAGS_CLANG = ['-fPIC', '-stdlib=libc++']
 
 sources = ['_sass.c']

from libsass-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.