What are the steps to package and release VS Code? - visual-studio-code

I am trying to figure out how to package an unchanged fork of VS Code.
My first steps were to follow the electron application distubution documentation, which has not been successful. I also found this post, where another user had the same question. However, the vscode-win32 gulp task seems to have been replaced by x64 and ia32 versions, and when I try running these tasks they generate an out-vscode folder as opposed to a full electron project.
This led me to believe that I can use this new out folder (as well as node modules, packages.json, etc.) with the electron release being used by VS Code to mimic the resources/app folder from the installed version of VS Code in Program Files, however when I try running electron.exe using this method I get:
The factory method of "vs/code/electron-main/main" has thrown an exception TypeError: Path must be a string. Received undefined
In short, I have been struggling with this for a couple of days, and I am out of ideas. If anyone has packaged the project and can offer a suggestion for how to do so, I would really appreciate it.

SOLVED
The issue seemed to be due to being branched off of master as opposed to release. I'd assume there are changes in main that aren't accounted for in the gulp task.
For anyone confused by my post, the expected behavior for a successful build is for a folder named VSCode-win32-x64 to be generated in the directory where your vscode clone is located.

Related

esp-idf build fails with "fatal error: esp_wifi.h: No such file or directory"

I am a student who has gotten a part time job embedded system programming. I am given a program the company uses, and asked to understand it. This is a working program. Therefore, the project can be built and flashed on ESP32 by the developers with no problem. So, the code and CMake files should have no issues. However, I cannot build the program either with VSCode extension nor with idf.py. In fact, I cannot build esp-idf examples from the official website, either.
Note: I am new to StackOverflow as well as to ESP32, so sorry if I made any mistakes here. If this post is problematic in any way, please inform me.
The error message from the terminal is shown here
I was initially using VSCode on Windows 10 (Windows is not activated). At first, ESP extension was completely failing to start the building process because it could not locate the tools. I was getting "could not be located" errors for all the tools. Below is a list of what I did in this setting:
I had v5.0.0 for esp-idf downloaded from Espressif server. I deleted it and tried v4.3.3 and then I tried to download from Github server. I downloaded the requirements for idf.py scripting environment and completed the settings for it as described by the Espressif's documentation.
I manually set the environment variables for IDF_PATH and PATH for both the user and for the system.
After 2, the initial error was gone. Unfortunately, I had a new error which indicated that ".elf" file for the project output could not be found. I do not exactly recall the error but if it is integral to the problem's solution I can try to replicate this issue.
I tried to delete and reinstall VSCode. I tried running VSCode with admin authority.
I tried changing the IDF_TOOLS_PATH in the VSCode esp-idf extension configurations from ".espressif" to "esp\esp-idf".
At this point, I moved to try to build the project on Ubuntu 22.04.1 LTS:
In Ubuntu, I got the fatal error: esp_event.h: No such file or directory error.
It does not seem to be a common issue and I could not find much about it online.
I followed the Linux setup steps in the documentation. It said that only step 1 (Downloading the prerequisites) was necessary for the VSCode extension.
I decided to try the "master branch" from esp-idf configurations as well. After I downloaded the master branch, the error changed to the current version: 'fatal error: esp_wifi.h: No such file or directory'
I also tried the idf.py in Ubuntu but I got the same error.
Both in Ubuntu and in Windows, the Doctor Command returns nothing. It does not even open the terminal or any window. I am not sure what it should return but some online discussions were asking about its return so I wanted to note it here.
Edit: When I tried the examples on Ubuntu, they actually build just fine. Doctor Command also works with examples.
However, the main code has still issues. Initially, I assumed I made some mistakes with esp-idf configurations. But, perhaps that was not the case.
I had the same problem and ended up editing my project's CMakeLists.txt. When I added "esp_wifi" to the "REQUIRES" list, it worked for me:
idf_component_register(
SRCS "main.c"
INCLUDE_DIRS res
EMBED_FILES res/settings.html
REQUIRES esp_wifi
)

Visual Studio Code does not see changes in F# Solution

Currently I am trying to use Visual Studio Code with Ionide to build a F# Solution. To describe my problem, i first describe what i have done, and what works.
I created a solution with two Projects. One Project is a Queue that contains a F# library. Another project is Queue.Test that is a console application that uses the Queue library, and should contain the Tests for the Queue library.
I'm using .Net6 and created the solution and Project with the dotnet cli tool.
In general, i can build the project with dotnet and i also can use everything in Visual Studio Code. I load the Folder that contains both projects, and Visual Studio Code loads the library.
I am able to edit the Library and my Console application. In my Console application i also can access the Queue and so on. Autocompletion works, and so on.
But, there is one problem. When i add a new function to my library, let's say Queue.help then in my Console application, i cannot see that function. It doesn't show in autocomplete, and when I write code that uses that function i get a compiler error telling me that function doesn't exists.
I can Build/Rebuild from VS Code or from CLI but the problem goes not away.
The only way Ionide starts to see the new function is by building the library AND restarting VS Code. As long i don't restart, it seems to not update the generated dll (i guess).
This is sure annoying, as i don't want to reload/restart VSCode everytime I add a new function to my library.
So my question: How i can I fix this?
What i want is to be able to change my library, and at the same time write tests in the other project and get full Code autocompletion.
Does somebody else have the same problem, or should I change my workflow?
What can i do, to debug this problem on my own?
Some tips?
This issue is fixed by the recent version of Ionide 5.10.1

Allegro 5 - Cosmic Protector Demo

I'm new to C++ and Allegro 5 but have been able to follow tutorials online and am able to build and compile several smaller projects successfully.
I cannot however get the demo project named Cosmic Protector to run and would like to at least learn what is wrong.
Unfortunately, I can't give you much to go on.
A window opens briefly and then closes, leaving the console open with the message..
process 6400 exited with code 255
If you have this demo running in VC 2017 with the latest release of Allegro 5 (5.2.4) installed via Nuget, I'd like to know that even.
The source for this program is available at...
https://github.com/liballeg/allegro5/tree/master/demos/cosmic_protector
Thank you, Jack
The allegro example programs and demos are usually built with CMake alongside the Allegro library. I just tested the CMake build of Allegro 5 with VS2017 on Windows 10 and it builds the Cosmic Protector demo successfully. You have to move the allegro dlls into the same directory as the exe, but other than that it runs perfectly.
As to why it's not working for you, cosmic protector depends on a data directory that holds it's resources. The working directory may be wrong, which would cause it to be unable to find resources. The data dir needs to be copied alongside the executable.
You can set the working directory to $(OutDir) under Debugging in Project->Properties and then it should find any data in the same directory as the exe.
How are you building cosmic protector?
Thanks to BugSquasher, I now have this working.
Here's how...
Start Visual Studio 2017
Create New Project of type Windows Console Application.
Name project CosmicProtector and save it in appropriate place on my HDD.
Disable precompiled headers and delete the any .h and .cpp
files associated with the new project regarding precompiled headers.
(for example pch.h)
Install Allegro 5.2.4 via Nuget.
In Visual Studio, navigate to Project Settings/Properties and ensure all
Allegro addons are enabled.
Copy the Cosmic Protector SRC and Header files and paste them into my
project directory.
Next in Visual Studio Project, Add the Source and Header files
respectively.
Rather stupidly, the step I had missed and that your reply brought my attention to was...
Copy the data directory and paste this into my project directory in the
applicable location.
Now build...
The project built right away, except for some errors reported in Game.cpp, GUI.cpp and Render.cpp
One error in Game.cpp, this being an instance of...
error C4996 'snprintf': This function or variable may be unsafe. Consider using snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address this I have changed the instance of snprintf to sprintf_s.
Three errors in GUI.cpp, were instances of...
Error C4996 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address all of these I changed each instance of strcpy to strcpy_s.
And one error in GUI.cpp, this being an instance of...
error C4996 'snprintf': This function or variable may be unsafe. Consider using snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address this I have changed the instance of snprintf to sprintf_s.
One error in Render.cpp, this being an instance of...
error C4996 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
To address this I have changed the instance of sprintf to sprintf_s.
Then build and it works:)
Thank you so much for your reply as I had moved on to other things but will find it very useful I think being able to build and run this demo.
It's only your reply that has brought me back to it and this time, I am successful:)

Microsoft.Quantum.Canon.nuspec missing

I am playing around with Microsoft's Q# library, and I've gone through the install, however the build is failing and I am having a tough time figuring out the problem. My first suspicion is Microsoft.Quantum.Canon
EXEC : error QS1001: Assembly E:\Projects\Quantum\Microsoft.Quantum.Canon\bin\Debug\Microsoft.Quantum.Canon.dll not found
I also have noticed Microsoft.Quantum.Canon.nuspec is missing. I've tried to do a Nuget.exe restore on the solutions but that did not work.
Has anyone worked through this?
It's been reported on GitHub already, although it appears to be intentional. See the comments in the .gitignore file:
# These files are generated by bootstrap from a .v.template (version template).
# Any changes must be done to the corresponding the .v.template file directly
Microsoft.Quantum.Canon/Microsoft.Quantum.Canon.nuspec
I can't find any info on this .v.template file, probably it's part of internal Microsoft build tooling. You can copy the template file and fill in the missing parameters if you wish, but the file not existing doesn't make the build fail , does it?

Why can I not compile TypeScript anymore?

I'm doing some web development and I did a commit & sync via GitHub's Mac GUI, then I installed some Mac updates that required a restart (I don't know what the updates were). When I opened my project in PHPStorm again, I found this error when I tried compiling my TypeScript:
/usr/local/bin/tsc
env: node: No such file or directory
I know the compilation was working before. My web application had no issues. This question deals specifically with me being able to do this yesterday, with no changes to the FileWatcher configuration.
I have my TypeScript Compiler in usr/local/bin/tsc (which I have checked as a valid path to a typescript compiler alias). When I click on the alias, It opens a terminal window and runs typescript, so I know it's there. PHPStorm also complains if I try to change the file path, saying I must pick a valid executable.
I modified my Environment Variables on the advice of Dan Clark's site but that hasn't changed anything. I don't have the reputation to upload a photo of my File Watchers Dialog.
Does anyone know why I am getting this error, and how it can be fixed? I mention GitHub because that's the last thing I did before things stopped working: a commit & sync, then a restart to install some Mac updates.
Both which node and which tsc point in the right direction. Just tsc also works.
My solution was to use the directory of the actual TypeScript compiler at /usr/local/lib/node_modules/typescript/bin/tsc
instead of
/usr/local/bin/tsc, which is the alias.
That lets me compile using the FileWatcher.
As for why this happened, it's still a mystery to me.