Skip to content
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

[Bug]: Error compiling Chapel-Py #25054

Closed
redhatturtle opened this issue May 15, 2024 · 3 comments
Closed

[Bug]: Error compiling Chapel-Py #25054

redhatturtle opened this issue May 15, 2024 · 3 comments
Assignees
Labels
area: Python bindings For things related to chapel-py, chpl-language-server, chplcheck, etc. type: Bug user issue

Comments

@redhatturtle
Copy link
Contributor

Summary of Problem

Description:
I get an error when compiling Chapel-Py and therefore the Chapel Language Server and ChplCheck

Building wheels for collected packages: chapel
  Building wheel for chapel (setup.py): started
  Building wheel for chapel (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [2061 lines of output]
      ...
      ...
      ...
      At global scope:
      cc1plus: note: unrecognized command-line option ‘-Wno-c99-designator’ may have been intended to silence earlier diagnostics
      cc1plus: some warnings being treated as errors
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chapel
  Running setup.py clean for chapel
Failed to build chapel
ERROR: Could not build wheels for chapel, which is required to install pyproject.toml-based projects
make[3]: *** [Makefile:109: chapel-py-venv] Error 1
make[2]: *** [Makefile:96: chapel-py-venv] Error 2
make[1]: *** [Makefile:132: third-party-chapel-py-venv] Error 2
make: *** [Makefile:137: chapel-py-venv] Error 2

Steps to Reproduce

Source Code:
The offending function is on ./tools/chapel-py/src/core-types-gen.cpp, lines 53 to 59.

static const char* blockStyleToString(BlockStyle blockStyle) {
  switch (blockStyle) {
    case BlockStyle::EXPLICIT: return "explicit";
    case BlockStyle::IMPLICIT: return "implicit";
    case BlockStyle::UNNECESSARY_KEYWORD_AND_BLOCK: return "unnecessary";
  }
}

I guess it just needs a default?

Compile command:
It only stops compilation because this flag is enabled by default
-Werror=return-type

Execution command:
I'm just running
make chapel-py-venv
I'm confused about how I'm the only one with this error, should this flag not be enabled by default?

Workaround

Just add a default to the switch statement.

    default: return "";

It compiles both in 2.0.1 and 2.1-pre but I have no idea if it's the right fix 🤷

Configuration Information

Happens on both 2.0.1 and the pre-release 2.1.0 (f1676da)

  • Output of chpl --version:
chpl version 2.1.0 pre-release (f1676da73c)
  built with LLVM version 17.0.6
  available LLVM targets: amdgcn, r600, nvptx64, nvptx, aarch64_32, aarch64_be, aarch64, arm64_32, arm64, x86-64, x86
Copyright 2020-2024 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native +
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet +
  CHPL_COMM_SUBSTRATE: smp +
  CHPL_GASNET_SEGMENT: fast
CHPL_TASKS: qthreads
CHPL_LAUNCHER: smp +
CHPL_TIMERS: generic +
CHPL_UNWIND: bundled +
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib +
  CHPL_NETWORK_ATOMICS: none
CHPL_GMP: bundled +
CHPL_HWLOC: bundled +
CHPL_RE2: bundled +
CHPL_LLVM: bundled +
CHPL_AUX_FILESYS: none +
  • Back-end compiler and version, e.g. gcc --version or clang --version:
gcc (SUSE Linux) 13.2.1 20240206 [revision 67ac78caf31f7cb3202177e6428a46d829b70f23]
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@jabraham17 jabraham17 added user issue area: Python bindings For things related to chapel-py, chpl-language-server, chplcheck, etc. labels May 15, 2024
@jabraham17 jabraham17 self-assigned this May 15, 2024
@jabraham17
Copy link
Member

Hi @redhatturtle, thanks for posting this. I suspect this has to do with your gcc version, but your patch is exactly how I would fix the issue.

Feel free to open a PR for it and ping me to review.

jabraham17 added a commit that referenced this issue May 16, 2024
Add a default case return to fix a build error in Chapel-Py.

Solves #25054 

[Contributed by @redhatturtle]
[Reviewed and merged by @jabraham17]
@jabraham17
Copy link
Member

Resolved with #25056

@bradcray
Copy link
Member

Thanks Jade!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Python bindings For things related to chapel-py, chpl-language-server, chplcheck, etc. type: Bug user issue
Projects
None yet
Development

No branches or pull requests

3 participants