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

FR: add the run program option #222

Closed
ghost opened this issue Mar 29, 2024 · 53 comments
Closed

FR: add the run program option #222

ghost opened this issue Mar 29, 2024 · 53 comments
Assignees
Labels
enhancement New feature or request ready for release

Comments

@ghost
Copy link

ghost commented Mar 29, 2024

This feature is only about build, isn't it? How to run the compiled program? Geany has a button to run the compiled program.

Yes, only build. The run program option will be added when the debugger plugin is implemented. I understand that in your case this would be useful because you don't have access to the console, so it could be handy for you.

Originally posted by @SpartanJ in #155 (reply in thread)

@SpartanJ SpartanJ self-assigned this Mar 30, 2024
@SpartanJ SpartanJ added the enhancement New feature or request label Mar 30, 2024
SpartanJ added a commit to SpartanJ/eepp that referenced this issue Apr 15, 2024
@SpartanJ
Copy link
Owner

Added a very simple Run step to the Build Settings. It will be improved in the future but this is enough for the moment.
Screenshot_20240415_013132

Default keybinding to execute the program is F5, or you can use the command palette, look for: "Project run executable".

@ghost
Copy link
Author

ghost commented Apr 17, 2024

There are only Build and Clean buttons. What about adding Run button and Build and Run button?

@SpartanJ
Copy link
Owner

SpartanJ commented Apr 17, 2024

It's a WIP. It will have much more options soon.

@ghost
Copy link
Author

ghost commented Apr 17, 2024

For unknown reasons, this combined with build/run feature doesn't work for me. I always got Build run with errors. But it doesn't show any errors, so I have no idea what's going on. The very same command works fine in Windows Command Prompt.

Update 1: I solved it by splitting the arguments from the command. Now the build feature works.

Update 2: I tested the run feature. I have the executable in the same directory as the source file. In Run, I set the command to be ${current_doc_name}.exe. Because there is no Run button so I pressed F5 as you said, but I saw nothing.

@SpartanJ
Copy link
Owner

Maybe enable the Execute in terminal checkbox? If it's a terminal app you won't see anything unless you request to open it with a terminal. Currently it does not display the std out of the process anywhere (it will be added later).

@ghost
Copy link
Author

ghost commented Apr 17, 2024

Maybe enable the Execute in terminal checkbox? If it's a terminal app you won't see anything unless you request to open it with a terminal. Currently it does not display the std out of the process anywhere (it will be added later).

If I check the Execute in terminal checkbox, I do see something. A Windows PowerShell window popped up but closed almost immediately, and the dialog from ecode said, This feature is not supported in this operating system. If I click OK, the Windows PowerShell window shows up again, but it doesn't run my program. It's only an empty prompt that opened in eepp\bin (which, of course, is not the directory that contains my source file and executable).

@SpartanJ
Copy link
Owner

The second part is wrong, I'll fix that (I mean, the second powershell shouldn't open). But the first part probably just run your application and you application closes intermediately so powershell will close automatically after the process ends. Everything is weird for you because it's not using the internal terminal because it's not available.

If you have the ecode source available and your building, probably what you want is to powershell to keep open after the process ends, please try the following change in ecode source:
src/tools/ecode/terminalmanager.cpp line 296, replace the " /c " in favor of " /k ", that should keep it open.

@ghost
Copy link
Author

ghost commented Apr 17, 2024

Geany uses an external terminal emulator to launch the program (cmd.exe in Windows), and they always make it wait for the user to enter a key to continue like this:

program out put


------------------
(program exited with code: 0)

Press any key to continue . . .

This is standard in IDE, including Visual Studio.

@ghost
Copy link
Author

ghost commented Apr 17, 2024

If you have the ecode source available and your building, probably what you want is to powershell to keep open after the process ends, please try the following change in ecode source: src/tools/ecode/terminalmanager.cpp line 296, replace the " /c " in favor of " /k ", that should keep it open.

What's the point of this? It will keep open, and I will have to type exit to quit it. Imagine having to do this many times while you are testing your program.

@SpartanJ
Copy link
Owner

I have no idea how it behaves, I was asking you to test it and to see if it was the same result than in Geany. Let's find out what command arguments is using Geany and just copy them.

@ghost
Copy link
Author

ghost commented Apr 17, 2024

I have no idea how it behaves, I was asking you to test it and to see if it was the same result than in Geany. Let's find out what command arguments is using Geany and just copy them.

I don't know anything about the internals of Geany. I used to use CodeBlocks and it does the same as Geany. I don't know how CodeBlocks does this, either. But it seems you will need a launcher, like this:

https://github.com/royqh1979/RedPanda-CPP/tree/master/tools/consolepauser

@SpartanJ
Copy link
Owner

I don't know anything about the internals of Geany.

Me neither but it's easy to check this particular thing, you just need to investigate the command used, so:
Screenshot_20240417_152928

They seem to use a bat file to do that "magic".
The bat file they generate is:

REM USAGE: geany-run-helper DIRECTORY AUTOCLOSE COMMAND...

REM unnecessary, but we get the directory
cd %1
shift
REM save autoclose option and remove it
set autoclose=%1
shift

REM spawn the child
REM it's tricky because shift doesn't affect %*, so hack it out
REM https://en.wikibooks.org/wiki/Windows_Batch_Scripting#Command-line_arguments
set SPAWN=
:argloop
if -%1-==-- goto argloop_end
	set SPAWN=%SPAWN% %1
	shift
goto argloop
:argloop_end
%SPAWN%

REM show the result
echo:
echo:
echo:------------------
echo:(program exited with code: %ERRORLEVEL%)
echo:

REM and if wanted, wait on the user
if not %autoclose%==1 pause

So basically I'll have to implement that trick if we want the same behaviour, a PITA to be honest.

@ghost
Copy link
Author

ghost commented Apr 17, 2024

a PITA to be honest.

Frankly speaking, I can live without this feature.

@ghost
Copy link
Author

ghost commented Apr 17, 2024

The second part is wrong, I'll fix that (I mean, the second powershell shouldn't open). But the first part probably just run your application and you application closes intermediately so powershell will close automatically after the process ends. Everything is weird for you because it's not using the internal terminal because it's not available.

I modified my code so the program will wait for me to enter a key before quitting. The result is still the same!

@SpartanJ
Copy link
Owner

I ended up implementing it anyway, so you shouldn't need the hack anymore, also made some other fixes. It now uses the same utility script than Geany, so it will behave exactly the same.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

I have tested the latest code. Now I see nothing when I click the Run button.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

For unknown reasons, this combined with build/run feature doesn't work for me. I always got Build run with errors. But it doesn't show any errors, so I have no idea what's going on. The very same command works fine in Windows Command Prompt.

Update 1: I solved it by splitting the arguments from the command. Now the build feature works.

Update 2: I tested the run feature. I have the executable in the same directory as the source file. In Run, I set the command to be ${current_doc_name}.exe. Because there is no Run button so I pressed F5 as you said, but I saw nothing.

Update 3: Now F5 is no longer Run but Build. Press F5 and it will try to build.

@SpartanJ
Copy link
Owner

F5 is now build and run. I added a new command for that because it's more practical.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

F5 is now build and run. I added a new command for that because it's more practical.

So Run is broken for me, because I don't see the compiled program running with either F5 or Run button.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

How to correctly run the compiled program? I have the executable in the same directory as the source file. In Run, I set the command to be ${current_doc_name}.exe.

@SpartanJ
Copy link
Owner

Mh that's because ${current_doc_name} is only for build commands, but let me add it.

@SpartanJ
Copy link
Owner

Done:

2024-04-25_14-25-51.mp4

@ghost
Copy link
Author

ghost commented Apr 25, 2024

I have pulled the latest code but I still see nothing. There is no Command Prompt window popping up. Note: I already have Execute in terminal checked.

@SpartanJ
Copy link
Owner

Please share you logs.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Please share you logs.

I checked ecode.log. There is only information about the LSP server clangd, but nothing related to build or run.

@SpartanJ
Copy link
Owner

If you click the button "Run" nothing is logged? (not the shortcut)

@ghost
Copy link
Author

ghost commented Apr 25, 2024

If you click the button "Run" nothing is logged? (not the shortcut)

Yes.

@SpartanJ
Copy link
Owner

Show me your config file please, it's in the ".ecode" folder.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Show me your config file please, it's in the ".ecode" folder.

When I click the Run button, there is no Command Prompt window popping up, and there is also nothing shown in the Build tab. I'm using ecode in portable mode, so ecode.log is in eppp/bin/config.

Here you are:

2024-04-26 00:57:55 - INFO: eepp initialized
2024-04-26 00:57:55 - INFO: C:\msys64\home\Administrator\eepp\bin\config\config.cfg loaded in 0.07ms
2024-04-26 00:57:55 - INFO: C:\msys64\home\Administrator\eepp\bin\config\state.cfg loaded in 0.02ms
2024-04-26 00:57:55 - INFO: Plugin: Auto Complete loaded and ready from process 4956
2024-04-26 00:57:55 - INFO: Plugin: Linter loaded and ready from process 4956
2024-04-26 00:57:55 - INFO: Plugin: XML Tools loaded and ready from process 4956
2024-04-26 00:57:55 - INFO: Plugin: Auto Formatter loaded and ready from process 4956
2024-04-26 00:57:55 - INFO: Plugin: LSP Client loaded and ready from process 4956
2024-04-26 00:57:55 - INFO: Plugin: Git loaded and ready from process 4956
2024-04-26 00:57:55 - INFO: Engine Initialized Succesfully.
	Version: eepp version 2.7.2 (codename: "Kāla")
	Build time: Apr 25 2024 14:36:43
	Platform: Windows
	OS: Microsoft Windows 8.1
	Arch: x64
	CPU Cores: 4
	Process Path: C:\msys64\home\Administrator\eepp\bin\
	Current Working Directory: C:\msys64\home\Administrator\eepp\bin
	Disk Free Space: 89.28 GiB
	Window/Input Backend: SDL 2.30.2
	GL Backend: OpenGL 2
	GL Vendor: Intel
	GL Renderer: Intel(R) HD Graphics 4600
	GL Version: 4.3.0 - Build 10.18.14.5180
	GL Shading Language Version: 4.30 - Build 10.18.14.5180
	Resolution: 1680x973
2024-04-26 00:57:55 - INFO: ecode version 0.5.2 (codename: "Ākāśa") initializing
2024-04-26 00:57:55 - INFO: Window creation took: 63.35 ms
2024-04-26 00:57:55 - INFO: C:\msys64\home\Administrator\eepp\bin\config\keybindings.cfg loaded in 0.44ms
2024-04-26 00:57:55 - INFO: StyleSheet loaded in: 4.449 ms.
2024-04-26 00:57:55 - INFO: StyleSheet loaded in: 0.029 ms.
2024-04-26 00:57:55 - INFO: Syntax definitions loaded in 4.26 ms.
2024-04-26 00:57:55 - INFO: StyleSheet loaded in: 1.441 ms.
2024-04-26 00:57:55 - INFO: Texture ID 1 loaded in 1.687 ms.
2024-04-26 00:57:55 - INFO: Texture ID 2 loaded in 0.851 ms.
2024-04-26 00:57:55 - INFO: Texture ID 3 loaded in 1.397 ms.
2024-04-26 00:57:55 - INFO: Texture ID 4 loaded in 0.891 ms.
2024-04-26 00:57:55 - INFO: Texture ID 5 loaded in 0.932 ms.
2024-04-26 00:57:55 - INFO: Texture ID 6 loaded in 0.839 ms.
2024-04-26 00:57:55 - INFO: Texture ID 7 loaded in 0.917 ms.
2024-04-26 00:57:55 - INFO: Texture ID 8 loaded in 0.476 ms.
2024-04-26 00:57:55 - INFO: Texture ID 9 loaded in 0.495 ms.
2024-04-26 00:57:55 - INFO: Texture ID 10 loaded in 0.459 ms.
2024-04-26 00:57:55 - INFO: Color Schemes loaded in 0.53ms.
2024-04-26 00:57:55 - INFO: SyntaxDefinitionManager loaded custom languages in: 0.04 ms
2024-04-26 00:57:55 - INFO: Terminal Color Schemes loaded in 0.23ms.
2024-04-26 00:57:55 - INFO: Base UI took: 105.41 ms
2024-04-26 00:57:55 - INFO: Texture ID 11 loaded in 0.391 ms.
2024-04-26 00:57:55 - INFO: Texture ID 12 loaded in 0.858 ms.
2024-04-26 00:57:55 - INFO: Texture ID 13 loaded in 0.097 ms.
2024-04-26 00:57:55 - INFO: Texture ID 14 loaded in 0.197 ms.
2024-04-26 00:57:55 - INFO: Settings Menu took: 45.23ms
2024-04-26 00:57:55 - INFO: Texture ID 15 loaded in 1.439 ms.
2024-04-26 00:57:55 - INFO: Texture ID 16 loaded in 0.556 ms.
2024-04-26 00:57:55 - INFO: Texture ID 17 loaded in 0.504 ms.
2024-04-26 00:57:55 - INFO: Complete UI took: 157.88 ms
2024-04-26 00:57:55 - INFO: StyleSheet loaded in: 0.313 ms.
2024-04-26 00:57:55 - INFO: Texture ID 18 loaded in 4.333 ms.
2024-04-26 00:57:55 - INFO: Texture ID 19 loaded in 0.199 ms.
2024-04-26 00:57:55 - INFO: Texture ID 20 loaded in 0.205 ms.
2024-04-26 00:57:55 - INFO: Texture ID 21 loaded in 0.298 ms.
2024-04-26 00:57:55 - INFO: Init ProjectTreeView took: 168.59 ms
2024-04-26 00:57:55 - INFO: First update took: 202.16 ms
2024-04-26 00:57:55 - INFO: First frame took: 242.00 ms
2024-04-26 00:57:55 - INFO: App Ready
2024-04-26 00:57:57 - INFO: Loading DirTree: C:\msys64\home\Administrator\test\
2024-04-26 00:57:57 - INFO: C:\msys64\home\Administrator\eepp\bin\config\projects\b0814221b60bfdddfef90b8dc9966a19.cfg loaded in 0.03ms
2024-04-26 00:57:57 - INFO: Load project took: 1.46 ms
2024-04-26 00:57:57 - INFO: DirTree read in: 7.75ms. Found 5 files.
2024-04-26 00:57:57 - INFO: Document "C:\msys64\home\Administrator\test\test.cpp" loaded in 0.22ms.
2024-04-26 00:57:57 - INFO: Texture ID 22 loaded in 2.158 ms.
2024-04-26 00:57:57 - INFO: LSPClientServer server clangd calling initialize
2024-04-26 00:57:57 - INFO: LSPClientServer server clangd calling initialized
2024-04-26 00:57:57 - INFO: LSPClientServer server clangd calling textDocument/didOpen file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:57:57 - INFO: LSPClientServer server clangd calling textDocument/documentSymbol file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:57:57 - INFO: LSPClientServer server clangd calling textDocument/semanticTokens/full file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:57:58 - INFO: LSPClientServer server clangd calling result for id 0
2024-04-26 00:57:58 - INFO: LSPClientServer::publishDiagnostics: file:///c:/msys64/home/Administrator/test/test.cpp - returned 0 items
2024-04-26 00:58:02 - INFO: Texture ID 23 loaded in 14.257 ms.
2024-04-26 00:58:02 - ERROR: Failed to create pseudo terminal
2024-04-26 00:58:03 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:58:07 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:58:08 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:58:14 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:58:20 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 00:59:36 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/msys64/home/Administrator/test/test.cpp
2024-04-26 01:01:00 - INFO: LSPClientServer:shutdown: clangd
2024-04-26 01:01:00 - INFO: LSPClientServer server clangd calling shutdown
2024-04-26 01:01:00 - INFO: LSPClientServer server clangd calling exit
2024-04-26 01:01:00 - INFO: eepp stoped

As you can see, there is only information about the LSP client clangd but nothing about build or run.

@SpartanJ
Copy link
Owner

I meant the file located at: C:\msys64\home\Administrator\test\.ecode\project_build.json.
The line: ERROR: Failed to create pseudo terminal is suspicious, the Run command should skip that for you.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Here you are:

{
  "test": {
    "build": [
      {
        "args": "${current_doc}",
        "command": "g++",
        "working_dir": ""
      }
    ],
    "build_types": [],
    "clean": [
      {
        "args": "",
        "command": "",
        "working_dir": ""
      }
    ],
    "config": {
      "clear_sys_env": false
    },
    "os": [],
    "output_parser": {
      "config": {
        "relative_file_paths": true
      }
    },
    "run": [
      {
        "args": "",
        "command": "${current_doc_name}.exe",
        "name": "",
        "run_in_terminal": true,
        "working_dir": "${project_root}"
      }
    ]
  }
}

Note: working_dir for Run is originally empty. I entered ${project_root} manually to see if it helped or not. It doesn't help, as the default working directory is the project's root anyway.

@SpartanJ
Copy link
Owner

Your build command is wrong. If build fails it wont run.
Replace your build arguments with:
-o ${current_doc_name}.exe ${current_doc}

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Your build command is wrong. If build fails it wont run. Replace your build arguments with: -o ${current_doc_name}.exe ${current_doc}

The command is corrected, but it still doesn't work.

@SpartanJ
Copy link
Owner

Your build output tells you that it succeeded? Can you show me the whole Build output?

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Your build output tells you that it succeeded? Can you show me the whole Build output?

Stripped the date and time:

Running steps for project test...
Starting g++ -o test.exe C:\msys64\home\Administrator\test\test.cpp
Working Dir C:\msys64\home\Administrator\test\
The process "g++" exited normally.
Elapsed Time: 439.79ms.
Build run successfully

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Btw, I always have the executable named test.exe because I build it manually with g++ on Command Prompt (outside of ecode). I think even if the build inside ecode fails, it should still be able to run the program as I have the executable (with the correct name).

Update: Maybe this isn't true in ecode because you have mixed build and run together, so there is no separate run anymore.

@SpartanJ
Copy link
Owner

In your ecode config path, it's this file: ecode/config/scripts/ecode-run-helper.bat?

@ghost
Copy link
Author

ghost commented Apr 25, 2024

In your ecode config path, it's this file: ecode/config/scripts/ecode-run-helper.bat?

No. I don't have this file. I do git pull and build the latest code with make config=release_x86_64 -C make/windows ecode -j4. My ecode config is predating the change you made to include ecode-run-helper.bat.

Update 1: I deleted the config directory to start with a brand new config, I still don't have eepp/bin/config/scripts/ecode-run-helper.bat.

Update 2: I do a search for all files with .bat extensions in eepp directory (the whole source tree) and I can't find that file.

@SpartanJ
Copy link
Owner

The file is auto-generated on the fly when you execute the "Run" command. But it's not being generated something is going wrong. But if the file fails it should be falling back to the old method of opening cmd.exe directly.
Please try this build, I added several logs so I can know what's happening. Also you could try to disable the "Run in terminal" flag, to see how it does behave. It might be an issue with the fact that I slightly changed the "Run" configuration format and maybe you need to recreate the Build configuration from zero.
ecode-windows-0.5.2-x86_64.zip

@ghost
Copy link
Author

ghost commented Apr 25, 2024

project_build.json

{
  "New Name": {
    "build": [
      {
        "args": "-o ${current_doc_name}.exe ${current_doc}",
        "command": "g++",
        "working_dir": ""
      }
    ],
    "build_types": [],
    "clean": [
      {
        "args": "",
        "command": "",
        "working_dir": ""
      }
    ],
    "config": {
      "clear_sys_env": false
    },
    "os": [],
    "output_parser": {
      "config": {
        "relative_file_paths": true
      }
    },
    "run": [
      {
        "args": "",
        "command": " ${current_doc_name}.exe",
        "name": "Custom Executable",
        "working_dir": ""
      }
    ]
  }
}

Build:

Running steps for project New Name...
Starting g++ -o test.exe C:\Users\Administrator\Downloads\test\test.cpp
Working Dir C:\Users\Administrator\Downloads\test\
The process "g++" exited normally.
Elapsed Time: 1s.
Build run successfully

Run with Run in terminal unchecked:

Starting  test.exe 
Working Dir C:\Users\Administrator\Downloads\test\
Elapsed Time: 1.13ms.
Run with errors

Run with Run in terminal checked:

Success! But nothing is shown on Build tab.

ecode.log

2024-04-26 01:57:24 - INFO: eepp initialized
2024-04-26 01:57:24 - INFO: Plugin: Auto Complete loaded and ready from process 4328
2024-04-26 01:57:24 - INFO: Plugin: Auto Formatter loaded and ready from process 4328
2024-04-26 01:57:24 - INFO: Plugin: Linter loaded and ready from process 4328
2024-04-26 01:57:24 - INFO: Plugin: LSP Client loaded and ready from process 4328
2024-04-26 01:57:24 - INFO: Plugin: Git loaded and ready from process 4328
2024-04-26 01:57:24 - INFO: Engine Initialized Succesfully.
	Version: eepp version 2.7.2 (codename: "Kāla")
	Build time: Apr 25 2024 14:23:06
	Platform: Windows
	OS: Microsoft Windows 8.1
	Arch: x64
	CPU Cores: 4
	Process Path: C:\Users\Administrator\Downloads\ecode\
	Current Working Directory: C:\Users\Administrator\Downloads\ecode
	Disk Free Space: 89.22 GiB
	Window/Input Backend: SDL 2.26.2
	GL Backend: OpenGL 2
	GL Vendor: Intel
	GL Renderer: Intel(R) HD Graphics 4600
	GL Version: 4.3.0 - Build 10.18.14.5180
	GL Shading Language Version: 4.30 - Build 10.18.14.5180
	Resolution: 1280x720
2024-04-26 01:57:24 - INFO: ecode version 0.5.2 (codename: "Ākāśa") initializing
2024-04-26 01:57:24 - INFO: Window creation took: 53.19 ms
2024-04-26 01:57:24 - INFO: Texture ID 1 loaded in 1.655 ms.
2024-04-26 01:57:24 - INFO: Texture ID 2 loaded in 0.943 ms.
2024-04-26 01:57:24 - INFO: Texture ID 3 loaded in 1.474 ms.
2024-04-26 01:57:24 - INFO: Texture ID 4 loaded in 1.337 ms.
2024-04-26 01:57:24 - INFO: StyleSheet loaded in: 4.919 ms.
2024-04-26 01:57:24 - INFO: StyleSheet loaded in: 0.031 ms.
2024-04-26 01:57:24 - INFO: Syntax definitions loaded in 5.28 ms.
2024-04-26 01:57:24 - INFO: StyleSheet loaded in: 1.521 ms.
2024-04-26 01:57:24 - INFO: Texture ID 5 loaded in 1.265 ms.
2024-04-26 01:57:24 - INFO: Texture ID 6 loaded in 0.499 ms.
2024-04-26 01:57:24 - INFO: Texture ID 7 loaded in 1.221 ms.
2024-04-26 01:57:24 - INFO: Texture ID 8 loaded in 0.879 ms.
2024-04-26 01:57:24 - INFO: Texture ID 9 loaded in 0.798 ms.
2024-04-26 01:57:24 - INFO: Texture ID 10 loaded in 0.727 ms.
2024-04-26 01:57:24 - INFO: Texture ID 11 loaded in 0.812 ms.
2024-04-26 01:57:24 - INFO: Texture ID 12 loaded in 0.510 ms.
2024-04-26 01:57:24 - INFO: Texture ID 13 loaded in 0.769 ms.
2024-04-26 01:57:24 - INFO: Texture ID 14 loaded in 0.699 ms.
2024-04-26 01:57:24 - INFO: Color Schemes loaded in 0.53ms.
2024-04-26 01:57:24 - INFO: SyntaxDefinitionManager loaded custom languages in: 0.06 ms
2024-04-26 01:57:24 - INFO: Terminal Color Schemes loaded in 0.23ms.
2024-04-26 01:57:24 - INFO: Base UI took: 98.88 ms
2024-04-26 01:57:24 - INFO: Texture ID 15 loaded in 1.192 ms.
2024-04-26 01:57:24 - INFO: Texture ID 16 loaded in 1.369 ms.
2024-04-26 01:57:24 - INFO: Texture ID 17 loaded in 0.094 ms.
2024-04-26 01:57:24 - INFO: Texture ID 18 loaded in 0.202 ms.
2024-04-26 01:57:24 - INFO: Settings Menu took: 44.66ms
2024-04-26 01:57:24 - INFO: Texture ID 19 loaded in 1.352 ms.
2024-04-26 01:57:24 - INFO: Texture ID 20 loaded in 1.558 ms.
2024-04-26 01:57:24 - INFO: Complete UI took: 152.06 ms
2024-04-26 01:57:24 - INFO: StyleSheet loaded in: 0.215 ms.
2024-04-26 01:57:24 - INFO: Texture ID 21 loaded in 7.563 ms.
2024-04-26 01:57:24 - INFO: Texture ID 22 loaded in 1.395 ms.
2024-04-26 01:57:24 - INFO: Texture ID 23 loaded in 1.141 ms.
2024-04-26 01:57:24 - INFO: Texture ID 24 loaded in 0.274 ms.
2024-04-26 01:57:24 - INFO: Init ProjectTreeView took: 168.10 ms
2024-04-26 01:57:24 - INFO: First update took: 199.48 ms
2024-04-26 01:57:24 - INFO: First frame took: 231.96 ms
2024-04-26 01:57:24 - INFO: App Ready
2024-04-26 01:57:32 - INFO: Loading DirTree: C:\Users\Administrator\Downloads\test\
2024-04-26 01:57:32 - INFO: Load project took: 0.16 ms
2024-04-26 01:57:32 - INFO: DirTree read in: 9.70ms. Found 1 files.
2024-04-26 01:57:32 - INFO: Texture ID 25 loaded in 2.473 ms.
2024-04-26 01:57:37 - WARNING: Property "is" is not defined!
2024-04-26 01:57:37 - WARNING: applyProperty: Property "is" not defined!
2024-04-26 01:57:37 - INFO: Texture ID 26 loaded in 12.113 ms.
2024-04-26 01:57:37 - INFO: Texture ID 27 loaded in 1.458 ms.
2024-04-26 01:57:37 - INFO: Texture ID 28 loaded in 1.054 ms.
2024-04-26 01:58:19 - INFO: Document "C:\Users\Administrator\Downloads\test\test.cpp" loaded in 1.08ms.
2024-04-26 01:58:19 - INFO: LSPClientServer server clangd calling initialize
2024-04-26 01:58:19 - INFO: LSPClientServer server clangd calling initialized
2024-04-26 01:58:19 - INFO: LSPClientServer server clangd calling textDocument/didOpen file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:58:19 - INFO: LSPClientServer server clangd calling textDocument/documentSymbol file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:58:19 - INFO: LSPClientServer server clangd calling textDocument/semanticTokens/full file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:58:21 - INFO: LSPClientServer server clangd calling result for id 0
2024-04-26 01:58:21 - INFO: LSPClientServer::publishDiagnostics: file:///c:/Users/Administrator/Downloads/test/test.cpp - returned 0 items
2024-04-26 01:58:21 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:58:24 - INFO: ProjectBuildManager::runConfig is already running or isRunningApp() is true
2024-04-26 01:58:26 - INFO: ProjectBuildManager::runConfig is already running or isRunningApp() is true
2024-04-26 01:58:28 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:58:40 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:58:47 - INFO: Running " test.exe " in app
2024-04-26 01:58:58 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:59:51 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 01:59:54 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:00:01 - INFO: Running " test.exe " in app
2024-04-26 02:00:03 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:00:45 - WARNING: Property "is" is not defined!
2024-04-26 02:00:45 - WARNING: applyProperty: Property "is" not defined!
2024-04-26 02:00:46 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:00:53 - INFO: Running " test.exe " in terminal
2024-04-26 02:00:53 - INFO: Trying to open in external terminal:  test.exe  C:\Users\Administrator\Downloads\test\
2024-04-26 02:00:53 - INFO: Running: cmd.exe /q /c ^"C:\Users\Administrator\Downloads\ecode\config\scripts\ecode-run-helper.bat^"^ ^"C:\Users\Administrator\Downloads\test\^"^ 0^ ^"test.exe^"
2024-04-26 02:00:54 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:00:57 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:01:15 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:01:17 - INFO: Running " test.exe " in terminal
2024-04-26 02:01:17 - INFO: Trying to open in external terminal:  test.exe  C:\Users\Administrator\Downloads\test\
2024-04-26 02:01:17 - INFO: Running: cmd.exe /q /c ^"C:\Users\Administrator\Downloads\ecode\config\scripts\ecode-run-helper.bat^"^ ^"C:\Users\Administrator\Downloads\test\^"^ 0^ ^"test.exe^"
2024-04-26 02:01:17 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:01:23 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:01:26 - INFO: Running " test.exe " in terminal
2024-04-26 02:01:26 - INFO: Trying to open in external terminal:  test.exe  C:\Users\Administrator\Downloads\test\
2024-04-26 02:01:26 - INFO: Running: cmd.exe /q /c ^"C:\Users\Administrator\Downloads\ecode\config\scripts\ecode-run-helper.bat^"^ ^"C:\Users\Administrator\Downloads\test\^"^ 0^ ^"test.exe^"
2024-04-26 02:01:29 - INFO: LSPClientServer server clangd calling textDocument/hover file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:01:54 - INFO: LSPClientServer server clangd calling textDocument/didClose file:///c:/Users/Administrator/Downloads/test/test.cpp
2024-04-26 02:01:54 - INFO: LSPClientServer::publishDiagnostics: file:///c:/Users/Administrator/Downloads/test/test.cpp - returned 0 items
2024-04-26 02:01:55 - INFO: LSPClientServer:shutdown: clangd
2024-04-26 02:01:55 - INFO: LSPClientServer server clangd calling shutdown
2024-04-26 02:01:55 - INFO: LSPClientServer server clangd calling exit
2024-04-26 02:01:55 - INFO: eepp stoped


@SpartanJ
Copy link
Owner

SpartanJ commented Apr 25, 2024

Ha, you have an space on the Run configuration:
"command": " ${current_doc_name}.exe",
I'll add a trim for that.

Edit: Just to clarify, it works with the terminal because it's trimming the exe path, but on the internal run it's not doing it.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Ha, you have an space on the Run configuration: "command": " ${current_doc_name}.exe", I'll add a trim for that.

Edit: Just to clarify, it works with the terminal because it's trimming the exe path, but on the internal run it's not doing it.

It only works on the build you give me. On my local build, it doesn't work, even if there is no space. I will try to make clean and rebuild everything. If it doesn't work, I will delete the whole source tree and clone from Github again. I will report to you if this works or not.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

I cleaned everything up with make config=release_x86_64 -C make/windows clean and did a rebuild. I deleted eepp/bin/config and the old project_build.json. Then I created a new build and run config and surprisingly it worked!

@SpartanJ
Copy link
Owner

Awesome! Running nightly builds isn't always safe, that's one of the reasons I'm not totally sure to share nightly builds. But I guess people will understand that fact.

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Currently it does not display the std out of the process anywhere (it will be added later).

Please add this feature. Currently I only see The process "g++" exited normally.

@SpartanJ
Copy link
Owner

SpartanJ commented Apr 25, 2024

The App output it's only possible to be available when you're not using "Run in terminal". Just disable run in terminal.

2024-04-25_17-18-48.mp4

@ghost
Copy link
Author

ghost commented Apr 25, 2024

You misunderstood me. I'm talking about Build, not Run. It turned out the feature is already exist. It's because the program compiled fine so there is no errors message from the compiler!

@ghost
Copy link
Author

ghost commented Apr 25, 2024

Btw, talking about the App output tab. Given this test.cpp program:

// Your First C++ Program

#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}

If I don't check Run in terminal, it will always report Run with errors:

Starting test.exe 
Working Dir C:\msys64\home\Administrator\test\
Elapsed Time: 0.99ms.
Run with errors

@SpartanJ
Copy link
Owner

SpartanJ commented Apr 25, 2024

That's because it's failing to run the process, the reason is simple, the binary path is not in PATH and without the full path provided it cannot find the exe. I just patched it to use the working directory if no full path is provided, please pull and rebuild.

@ghost
Copy link
Author

ghost commented Apr 26, 2024

Awesome! Running nightly builds isn't always safe, that's one of the reasons I'm not totally sure to share nightly builds. But I guess people will understand that fact.

As far as I know, Nightly builds are produced by Github Actions and Github Actions doesn't do incremental builds.

@SpartanJ
Copy link
Owner

You didn't have any issues with the incremental build. The problem with nightly builds comes from the fact that many changes can be temporal and may change during development, and for example for file formats this produces breaking changes, I did change the file format while I was developing and changed the feature and I did not make it backwards compatible with the previous unstable builds.

@ghost
Copy link
Author

ghost commented Apr 26, 2024

Update: I think ecode needs better behavior when handling untitled. Sometimes, I forget to open the actual source file so it's a new tab and of course it failed to run because there is no such program as .exe. Build will also fail with untitled. I found that ${current_doc} and ${current_doc_name} for untitled are both empty. IMO, untitled should be ignored.

@ghost
Copy link
Author

ghost commented Apr 26, 2024

The problem with nightly builds comes from the fact that many changes can be temporal and may change during development, and for example for file formats this produces breaking changes, I did change the file format while I was developing and changed the feature and I did not make it backwards compatible with the previous unstable builds.

You can't dismiss the advantage of Nightly builds. They are really convenient when you need to try the latest features. They help you save time since you don't need to build everything yourself. I have to keep the gigantic MSYS2 only to build ecode, and it also takes a very long time on my slow hardware. Btw, I'm too careless to not take the possibility of the file format being changed into account. When you are using the latest code, breakage like this is expected.

@SpartanJ SpartanJ closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready for release
Projects
None yet
Development

No branches or pull requests

1 participant