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

Pulsar fails to build with GCC 13 #684

Open
5 tasks done
mauricioszabo opened this issue Aug 22, 2023 · 8 comments
Open
5 tasks done

Pulsar fails to build with GCC 13 #684

mauricioszabo opened this issue Aug 22, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@mauricioszabo
Copy link
Contributor

Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

What happened?

Pulsar fails to build with GCC 13 - superstring uses some outdated APIs

Pulsar version

Any version < Electron 25

Which OS does this happen on?

❓ Other(Please specify in the OS details field below)

OS details

Any system that uses GCC

Which CPU architecture are you running this on?

64-bit(x86_64)

What steps are needed to reproduce this?

Try to build

Additional Information:

This PR on a completely unrelated project can give us some hints on how to fix the issue: https://github.com/EdgeTX/edgetx/pull/3224/files

@mauricioszabo mauricioszabo added the bug Something isn't working label Aug 22, 2023
@confused-Techie
Copy link
Member

Do you think you're linked PR will be all that's needed to fix this issue on superstring? Since if so, that'd be very convenient lol.

Or is it more likely we will have to dive a little deeper into that codebase

@ianwillie
Copy link

ianwillie commented Oct 3, 2023

I wonder if this is the same bug as I am finding with Manjaro building pulsar v 1.109.0. Yarn install produces:
"error /home/ian/pulsar/node_modules/superstring: Command failed. Exit code: 1". See attached file for full terminal output.
Setup: Manjaro 6.1.53-1 (updated on 20231003) & gcc --version gcc (GCC) 13.2.1 20230801

Normally I do not compile pulsar but run distributed binary code and link my packages for development from within the packages directory. For example, dir ~/.pulsar/packages/ianasciidocpreview-active-editor-info links to /media/.../github_from_home/CloneOfianasciidocpreview-active-editor-info-20230915_ChromeZoomWiTransformFactorInFile. After editing the package file all I need to do is reload the pulsar-edit and the changes appear. Pulsar runs with the code "/home/ian/Downloads/pulsar-1.109.0/ . --no-sandbox" (--no-sandbos seems to be needed for Ctrl-Shift-I to call the console etc.)

Now, I am exploring the package markdown-preview which appears under the node-modules directory ".../pulsar/node_modules/markdown-preview/" and to edit and run it requires a locally compiled pulsar. This is following the instructions "https://pulsar-edit.dev/docs/launch-manual/sections/behind-pulsar/#Developing Node Modules"

Since I am unable to compile pulsar-edit, or so it seems, I am unable to edit the node-module markdown-preview and install it into the reloaded pulsar-edit. Pulsar compiled OK previously with v1.63, I think it was, but months ago.

Two questions:

  1. How do I succeed in compiling pulsar-edit.
  2. Is there some alternative way of editing the node-module markdown-preview and incorporating the changes in pulsar without compiling it locally first?

Thanks for your help with this.

Pulsar_SuperstringProblem_FailedToBuild.txt

@ianwillie
Copy link

ianwillie commented Oct 5, 2023

  1. How do I succeed in compiling pulsar-edit.

I worked out the answer to this for Manjaro & Archlinux but it will be similar for other Linux versions. I know nothing about MS Win use.

For Manjaro see https://wiki.archlinux.org/title/GNU_Compiler_Collection
With pacman-manager > Search gcc12 > Install gcc12 gcc12-fortran gcc12-libs (All from Official repos not AUR as stated in link.)

  This takes a while and a restart is require to complete it. On restart "gcc --version" indicates that the default version is still GCC13.
  
  On restart open terminal and enter "export CC=gcc-12 CXX=g++-12"   
     The above will tell the compiler to use gcc12. This command will stay in force for this terminal only and will not be in effect globally or in another terminal.
     If the terminal is changed, or a logout, or a restart then the command needs to be repeated.
  
  Then staying in the same terminal instance go through the commands in https://pulsar-edit.dev/docs/launch-manual/sections/core-hacking/#Building Pulsar
     # Install the development packges
     pacman -S base-devel libxkbfile libsecret libx11 libxcrypt-compat
     git clone https://github.com/pulsar-edit/pulsar.git && cd pulsar
     nvm install
     corepack enable
     git submodule init && git submodule update
     yarn install  # this will use the GCC versions found in export CC & CXX command 
     yarn build
     yarn build:apm
     yarn start  # check that pulsar starts OK. To get --dev use the -r command explained next.
     yarn start -r ~/pulsar   # to start in --dev mode  NB --dev does not seem to work with yarn so use -r followed by pulsar path instead

    To be sure all the yarn install & build commands can be preluded with "export CC=gcc-12 CXX=g++-12; yarn <command>"

Remember that to use pulsar package manager to see https://pulsar-edit.dev/docs/launch-manual/sections/core-hacking/#using-ppm-pulsar-package-manager
[EDIT] I forgot that these commands need to be added in each terminal instance if they are not error messages related to unknown Electron versions:
export ATOM_HOME=/home/<user>/.pulsar; export APM_PATH=/ppm/bin/apm; export ATOM_ELECTRON_VERSION=12.2.3;

Similarly if pulsar is not compiled in ~/github/pulsar then the location has to be put in export ATOM_DEV_RESOURCE_PATH=

I would just add that this is my first foray in using a different GCC from the installed standard GCC13. I am told that there may be consequences for Manjaro by doing this but it seems to work fine so far. When the issue is resolved by the pulsar team then I will uninstall GCC12. Please be careful and keep backups of the system!

Kind wishes, I hope that this helps someone as it helped me.

@morganwahl
Copy link

I'm hitting this same bug on arm64. For anyone curious, here's the full error output:

  CXX(target) Release/obj.target/superstring_core/src/core/regex.o
In file included from ../src/core/regex.cc:1:
../src/core/regex.h:17:27: error: ‘uint32_t’ has not been declared
   17 |   Regex(const char16_t *, uint32_t, std::u16string *error_message, bool ignore_case = false, bool unicode = false);
      |                           ^~~~~~~~
../src/core/regex.cc:50:1: error: no declaration matches ‘Regex::Regex(const char16_t*, uint32_t, std::u16string*, bool, bool)’
   50 | Regex::Regex(const char16_t *pattern, uint32_t pattern_length, u16string *error_message, bool ignore_case, bool unicode) {
      | ^~~~~
../src/core/regex.h:11:7: note: candidates are: ‘constexpr Regex::Regex(const Regex&)’
   11 | class Regex {
      |       ^~~~~
../src/core/regex.h:19:3: note:                 ‘Regex::Regex(Regex&&)’
   19 |   Regex(Regex &&);
      |   ^~~~~
../src/core/regex.h:18:3: note:                 ‘Regex::Regex(const std::u16string&, std::u16string*, bool, bool)’
   18 |   Regex(const std::u16string &, std::u16string *error_message, bool ignore_case = false, bool unicode = false);
      |   ^~~~~
../src/core/regex.h:17:3: note:                 ‘Regex::Regex(const char16_t*, int, std::u16string*, bool, bool)’
   17 |   Regex(const char16_t *, uint32_t, std::u16string *error_message, bool ignore_case = false, bool unicode = false);
      |   ^~~~~
../src/core/regex.cc:10:1: note:                 ‘Regex::Regex()’
   10 | Regex::Regex() : code{nullptr} {}
      | ^~~~~
../src/core/regex.h:13:3: note:                 ‘Regex::Regex(pcre2_real_code_16*)’
   13 |   Regex(pcre2_real_code_16 *);
      |   ^~~~~
../src/core/regex.h:11:7: note: ‘class Regex’ defined here
   11 | class Regex {
      |       ^~~~~
../src/core/regex.cc:12:18: warning: ‘std::u16string preprocess_pattern(const char16_t*, uint32_t)’ defined but not used [-Wunused-function]
   12 | static u16string preprocess_pattern(const char16_t *pattern, uint32_t length) {
      |                  ^~~~~~~~~~~~~~~~~~
make: *** [superstring_core.target.mk:125: Release/obj.target/superstring_core/src/core/regex.o] Error 1

@morganwahl
Copy link

I'd be happy to attempt a fix, but I'm confused what repo to do that fix in. Just looking at node_modules/superstring/package.json, it seems https://github.com/atom/superstring is what's being used, but that repo is archived.

@mauricioszabo
Copy link
Contributor Author

@morganwahl you can attempt a fix in https://github.com/pulsar-edit/superstring - it's the one we're going to use from now on

I'll also try to pull this PR to our fork: pulsar-edit/superstring#5, because that's what's being used in the new Electron branch

@morganwahl
Copy link

Just confirmed this bug is present on the atom version (commit 6732087), but seems to already be fixed on the pulsar fork! (commit c2ff062 ).

@mauricioszabo
Copy link
Contributor Author

Wow... amazing!

So we just need to bump superstring on Pulsar, sounds awesome! Thank you for checking it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants