Start with MonetDB development - development-environment

I want to integrate features into MonetDB, more specifically into the dictionary part of it. I found some information here, but this is not really elaborate.
The concrete feature I want to integrate is secondary in my question here. My biggest hurdle at the moment is: how do I start to develop MonetDB?
I was able to download the source and build it as described here. But where to go from there?
My preferred way would be: get MonetDB in some form of an IDE, set various breakpoints, send a SQL query and explore the code from there.
Is this possible? What development environment do you use? Is gdb debugging the only possibility? How do you debug?

Meanwhile, I figured it out myself. Maybe, somebody else will face this problem, wherefore I answer my own question. I finally ended up with Eclipse and describe a possible way to start MonetDB development/debugging:
Clone MonetDB repository from the official repository, e.g., from Github
Download the C++ version of a current Eclipse release
In Eclipse click on File > New > C/C++ > Makefile Project with Existing Code > Next. Insert the cloned repository dictionary as Existing Code Location and select the GNU Autotools Toolchain
Now you should be able to build MonetDB inside of Eclipse
After a successful build, you can choose Binaries from the Project Explorer. There you can right click the different binaries and use to run as or debug as
This finishes the setup of MonetDB inside Eclipse. Now, it depends on what you want to debug. If you want to change something at the server, you might want to debug monetdbd. My tips to do this are:
Start debugging of monetdbd per right click as explained before
Close the debug session and adjust the debug configuration
On the Arguments tab, insert the arguments: start -n <path to your dbfarm>. This will keep the database daemon from going into the background
On the Debugger tab, select Automatically debug forked process and optionally Non-stop mode
A new debug session will now automatically stop at the main of monetdbd and will also show the threads of the forked mserver5 process

Related

Debugging an app with computed environment variables in IntelliJ IDEA

Consider an app which, in 12-factor style, receives its config in the form of a JSON document provided as an environment variable. The config contains secrets, so it is never stored on disk; instead, it is computed on the fly before starting the app, using something like sops or nunjucks.
I am trying to debug such an app in IntelliJ. Is there any way to run some arbitrary script before launch and provide its output to the app as an environment variable?
I will accept answers for any run config type, but an approach that works with "npm" or "Application" would be most helpful for me.
EnvFile IntelliJ IDEA plug-in added this option some time ago.
I did a quick test and don't see this option available, at least on Windows.
EDIT: found it was only merged in the forked version and not available in the official plug-in. You will have to merge it manually and build the plug-in from sources.
IntelliJ IDEA doesn't have a built-in feature for that, feel free to vote for the corresponding request.

Getting set up with intelliJ IDEA

Really basic question here but this has always stopped me from using any JetBrains product, but here I am trying once again. I also have the same issues with CLion but that will be for another time and hopefully I can figure it out based on some feedback from this post.
I need to set up my environment in IntelliJ. Nothing special. No build tools. Currently I just run my school projects using
javac Main.java
java Main
This has gotten me so far but I really want to use IntelliJ tools to their full capacity.
I want to be able to set break points and step in and out of my code in their debugger and all the other nice tools that come with running my code through IntelliJ
Every get started tutorial that I have watched on YouTube or from JetBrains themselves already has a basic build configuration set up to run your basic "Hello World" application and that is what I think I need. Just compile my java files into classes and run/debug them.
This is what the run configuration icon in the IDE should look like
And this is what mine currently looks like
I have set many different JDKs to go along with my projects but none of them seem to get the tools I need set up in the IDE. I have even let IntelliJ download one for me and set it up itself to see if maybe I downloaded and installed it wrong and IntelliJ maybe wasn't recognizing it.
This picture below is showing the project structure for an application that I let IntelliJ download a JDK for and set it up itself
So if someone could help me that would be fantastic. Links to videos, blogs are welcome even though I know that isn't the convention on this forum but I think that would be sufficient for my situation. Thanks in advance!
---Update---
I have found that if I create a project in IntelliJ that I get all the default configurations that I need. The problem is when I need to get a project from VCS that I am not getting any of the configurations that I need to run/debug my program in IntelliJ.
The easiest solution here would be to click the green play button next to your main method, on the left where line numbers are displayed.
Intellij will configure a default java run configuration for you. It will be displayed in the menu for later use, like in the screenshot you posted, after your first run.
You can also create one using the to menu: Run > Edit run configuration to add some more options like arguments, environment variables (that only apply for the run config), etc.
A good starting point would be the Intellij help page on that topic. This help pages are always a good start and you find comprehensible instructions there on every topic.
Another good resource is the Intellij by JetBrains YouTube channel. This video about debugging shows both ways I described above. They have lots of quick tutorials about lot of features, like code generation or build tools. Check out the channel's playlists for specific topics.
Update
The problem with the already created project is that the default/ folder is not marked as source folder. You can do that by File > 'Project Structure...' and set the default/ folder as Sources:
The cause for intellij not recognizing this is because you didn't use a folder structure like the one of maven.
For source code:
src/main/java
src/main/resources
and for tests:
src/test/java
src/test/resources
If you set it up that way IntelliJ everything works as expected. I created a pull request to your repo. If you check out the branch, IntelliJ will setup everything correctly automatically.

IntelliJ is not able to recognize behave run options in feature file [behave python BDD library]

1. Intellij is not able to recognize the Run options in the feature file, while able to run the file using the command-line tool.
getting Nothing here.
2. There is even no option in the right-click menu
3. Steps are identified as not implemented while steps are implemented and executing successfully with behave CLI tool
It is not ideal, since as you say the ideal is to have the appropriate version of IntelliJ. However, a workaround that has saved me in these situations is to select the step I want to go to and use Ctrl+Shift+F to search in the whole project the place where the method is declared.
This command is also useful to know in which Scenarios a certain step is used, because even if you have the Professional version of IntelliJ it only allows you to access from the Scenario to the Step and not the other way around.

IntelliJ remote debug gradle project can't attach sources

I'm having trouble getting IntelliJ to recognize which source files correspond to the thing I'm trying to attach a debugger to. The project in question is a Gradle project running locally, using Java 1.7. (EDIT: I'm actually also running that project from within IntelliJ, and that's also what's building it. It's a Gretty task defined in the project's build.gradle file. I'm passing
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006
to the JVM to open the debugging port.)
I can tell that the debugger is attaching to the process correctly since I get the "Connected to the target VM" message. But breakpoints do not get the checkmark, and they aren't hit during execution. (EDIT: This is leading me to believe that the sources aren't being attached -- The debugger is attaching to a process successfully, and I have reason to believe that process is the one I want since I'm using JVM arguments on it to open the debugging port, but it appears to me that the IDE doesn't recognize what source files correspond to the running code.)
The other person who works on this code does not seem to have this issue. He's on an older version of IntelliJ. His "use module classpath" dropdown has a <whole project> option and mine does not (though it does have <no module> -- is that the same?). Unsure which version of IJ he's on specifically; I'm on Ultimate 2018.3.
I'm sure that I need to include more information than this, but due to my unfamiliarity with Gradle as a build/run tool and with how remote debugging works in general, I don't know what information I'm missing -- of course I will provide it as soon as someone asks me for it.
BIG EDIT (and probably the real answer here): I have a feeling I'm attaching to Gradle itself rather than the task. If I choose Run -> Attach to Process, the dialog shows me "45039 org.gradle.launcher.daemon.bootstrap.GradleDaemon (5006)".

Intellij 2018.2 stops working and exits on MacOs. What might be a problem?

As an daily IntelliJ user you usually concentrate on the projects you are working on and IntelliJ is just a tool. You are not willing to dig into tool's problem itself. But this is what is forced on you by default after IntelliJ installation on MacOS and opening relatively big project(most of the projects nowadays are huge and have thousands of files and use numbers of IntelliJ 3rd party plugins).
Here is a minimal list of actions. IntelliJ must have set MORE RAM to be used by default.
Read: https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files .
From IntelliJ open Help / Show log in Finder and open idea.log file with Console.app; In Console.app press "Reload" and "Now" buttons to track "live" what IntelliJ is doing.
If in logs of IntelliJ you find that some of the plugins exit with fatal error, you just uninstall those plugins. For me the one that failed to the moment of this answer was "BashSupport" as example.
Start Terminal.app ; Run command: open -a TextEdit /Applications/IntelliJ\ IDEA.app/Contents/bin/idea.vmoptions ; Change options in idea.vmoptions file to:
-Xms1024m
-Xmx2048m ; Read https://www.jetbrains.com/help/idea/tuning-the-ide.html to see how you can tune IntelliJ for your project. This step is handy when your IntelliJ app doesn't start at all and you want to change properties in a global way.
From IntelliJ open Help / Edit Custom Properties.... Here you can set same properties that will override global and will work only for current OS user.
Also there is also a possibility of underlying OS to do it voodoo magic so the IntelliJ won't work as it should like here - https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000398280-IDEA-Ultimate-2018-2-Unable-to-save-settings-Unable-to-create-file-Windows-10
Make sure your project build output for *.class files is set. Read: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000000584-Build-does-nothing . In my case when IntelliJ started project build it terminated without warnings shortly after.
Finally in my case none of 6 steps above solved the issue so I found this read: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000532044-IntelliJ-cannot-build-projects . Basically try reinstall IntelliJ from original distribution again.
I know that you must read https://www.jetbrains.com/help/idea every time you install a new version of IntelliJ, but why not to add some consistency into configuration process of the main java process that runs IntelliJ itself? You can ask how much ram to use during installation of IntelliJ and explain why it is so. Then Help digging won't be necessary in the first place for devs who fed up with changing those default settings that will be always more than 700MB. I think for most devs out there it is at least 10x of that. I bet what makes most devs mad about this is not the fact that you need to do some options changing, but where those options are depending on OS plus the fact that you simply forget why IntelliJ app just exits while you are doing a debugging of your own app. I bet this problem makes us mad since first java based IDEs appeared. User-friendly is the key here and explicit reminders within the app itself would help.