You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/12/15 21:52:37 UTC

[GitHub] [daffodil-vscode] Shanedell opened a new pull request #63: Daffodil Debugger Classpaths

Shanedell opened a new pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63


   Daffodil Debugger Classpaths:
   
   - Create launch.json variable for daffodilDebugClasspath.
   - Add daffodilDebugClasspath to getConfig and default config
   - Create bash and bat templates for the scripts to run the debugger.
     - Created templates from the default of what we used.
     - Updated the templates to appened the value of the ENV DAFFODIL_DEBUG_CLASSPATH if it is set.
   - Update launch wizard to have an option for class paths.
     - Created two different check boxes that allows the input box to be replaced or appened with the files selected.
     - If folder selected the extension creates a string with all the full paths to all jars inside of the folder to it.
     - If multiple files are selected they will all be added.
   - Update issue with replace method, moved to replaceAll.
   
   Closes #54
   Closes #57


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996016513


   Schema jars do not contain java/scala code class files unless they are for a User-defined-function, or layering extension. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996169444


   @mbeckerle I was able to recreate your issue on my Ubuntu VM so I will be doing some testing to get this fixed, will let you know once I believe I found the fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995357972


   Could be but for either way the `styles.css` and `launchWizard.js` would not be getting loaded. I will push a commit up here shortly, you will want to pull that update down. Then rebuild and reinstall the VSIX file.
   
   Is the settings you see, look like this?
   
   <img width="1904" alt="Screen Shot 2021-12-15 at 8 28 48 PM" src="https://user-images.githubusercontent.com/32347414/146291184-1ebf4272-40d1-4fa2-b6af-4321ab649487.png">
   
   If so you were setting the global config not using the launch wizard. As stated in my previous comment there seems to be an issue that those globals do not get loaded when they are set and no `.vscode/launch.json` exists, this will need to be a separate issue I believe.
   
   If you the the config I sent for your `.vscode/launch.json`, I am pretty confident it will work.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995927886


   I don't think it needs to be can you try to this for your `.vscode/launch.json`
   ```
   {
       "version": "0.2.0",
       "configurations": [
           {
               "request": "launch",
               "type": "dfdl",
               "name": "Wizard Config",
               "program": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/main/resources/com/tresys/pcap/xsd/pcap.dfdl.xsd",
               "data": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/test/resources/com/tresys/pcap/data/icmp1.cap",
               "debugServer": 4711,
               "infosetOutput": {
                   "type": "none",
                   "path": "${workspaceFolder}/infoset.xml"
               },
               "trace": true,
               "stopOnEntry": true,
               "useExistingServer": false,
               "openHexView": false,
               "openInfosetView": false,
               "openInfosetDiffView": false,
               "daffodilDebugClasspath": "/home/mbeckerle/.ivy2/local/com.owlcyberdefense/dfdl-ethernetip/1.0.0/jars/dfdl-ethernetip.jar"
           }
       ]
   }
   ```
   
   For me only have the jar makes the debug work maybe pointing at those additional resources is causing an issue?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996250493


   I've got your latest commit (a1a7f006669a7a60e1fbe414e5094dfb83e8c2bb)
   
   I did a checkout of that and did 'git clean -xdf' to remove existing cruft and the existing vsix.
   
   That doesn't remove yarn.lock file, so I removed that by hand.
   
   Then 'yarn build' created vsix file.
   
   I installed it into vscode.
   
   I refreshed the launch.json from the examples in this github thread.
   
   I run it.
   
   Same exact SDE as before. Unable to find any of the imports/includes. 
   
   We need to turn on LogLevel Resolver(35) in Daffodil so we can see the classpath it is using. The API call is `setLoggingLevel(LogLevel.Resolver)`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell edited a comment on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell edited a comment on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996169444


   @mbeckerle I was able to recreate your issue on my Ubuntu VM so I will be doing some testing to get this fixed, will let you know once I believe I found the fix.
   
   But I did find an fix two other issues I found through setting up this VM:
   
   - `bash-template` in Ubuntu did not seem to like the License stuff being the first line. Had to have `/usr/bin/env bash` for the debugger script to run
   - the extension was doing a hand full of `.replaceAll`, this works in nodejs 10 but in later version they remove this function (install nodejs 12 on my VM). So the fix was using `.replace` but using regular expression to have it remove everything.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995344139


   I was able to get the fix the VSIX file so that the launch wizard works properly. @mbeckerle If you have this exact config in `vscode/launch.json` does debugging work?
   
   ```
   {
       "version": "0.2.0",
       "configurations": [
           {
               "request": "launch",
               "type": "dfdl",
               "name": "Wizard Config",
               "program": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/main/resources/com/tresys/pcap/xsd/pcap.dfdl.xsd",
               "data": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/test/resources/com/tresys/pcap/data/icmp1.cap",
               "debugServer": 4711,
               "infosetOutput": {
                   "type": "none",
                   "path": "${workspaceFolder}/infoset.xml"
               },
               "trace": true,
               "stopOnEntry": true,
               "useExistingServer": false,
               "openHexView": false,
               "openInfosetView": false,
               "openInfosetDiffView": false,
               "daffodilDebugClasspath": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/main/resources:/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/test/resources:/home/mbeckerle/.ivy2/local/com.owlcyberdefense/dfdl-ethernetip/1.0.0/jars/dfdl-ethernetip.jar"
           }
       ]
   }
   ```
   
   If so it could have been dealing with the launch wizard setting or you were trying to use the global settings and it didn't work properly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995299277


   I am not having any luck.
   
   First I ran vscode and uninstalled the current daffodil extension. Exit vscode.
   
   Then I checked out your PR branch, and did a yarn build.
   
   Then I installed the vsix file into vscode via command line.
   
   Start vscode again. Go to extensions. Daffodil is there. Click on settings gear.
   
   I put this in the "User" tab (not Workspace tab) debug classpath via the extension settings button
   
   /home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/main/resources:/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/test/resources:/home/mbeckerle/.ivy2/local/com.owlcyberdefense/dfdl-ethernetip/1.0.0/jars/dfdl-ethernetip.jar
   
   I have verified these are correct.
   
   Those are the root folders for main and test resources for pcap, and the jar for ethernetIP.
   
   I put this in absolute path to schema file:
   
   /home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/main/resources/com/tresys/pcap/xsd/pcap.dfdl.xsd
   
   I put this in absolute path to data file:
   
   /home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/test/resources/com/tresys/pcap/data/icmp1.cap
   
   There does not seem to be any Save or "Go" button to tell it to use these settings. 
   
   Somehow I got a Daffodil Launch configuration. (launch.json has a configuration named "Daffodil Launch")
   
   The schema file name isn't in the launch.json, It still just has ${file}, so I edited the schema file absolute path to the pcap.dfdl.xsd into the launch.json.
   
   When I run, I get an SDE (and the blocking dialog does not allow me to copy the messages! )
   
   The first SDE says line168 of pcap.dfdl.xsd unable to find eth:Ethernet type definition component. 
   
   That is defined by the ethernetIP schema imported at line 50. 
   
   So it is unable to resolve that file name: com/owlcyberdefense/dfdl/xsd/ethernetIP.dfdl.xsd
   
   Further down in the SDE dialog (that I can't copy from), are a bunch of errors and warnings basically saying it can't find any of the files it is trying to import, including the daffodil built in schema file that this extends. 
   
   So the classpath is definitely not working for me. 
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996740821


   @mbeckerle Excellent! Glad things are starting to work
   
   Yeah I am not sure if there is a way to step into another imported schema, that may require to the Scala code for the debugger to allow for that to happen. I can mess around here and see if I can find anything but I am thinking that maybe a separate issue as I believe it will require and update to the Scala code.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell merged pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell merged pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell edited a comment on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell edited a comment on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996169444


   @mbeckerle I was able to recreate your issue on my Ubuntu VM so I will be doing some testing to get this fixed, will let you know once I believe I found the fix.
   
   I also found an issue with `bash-template` in Ubuntu as it does not seem to like the License stuff being the first line have to have `/usr/bin/env bash` and it works for both Ubuntu and Mac, seems to pass ratCheck as well


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995955466


   ![image](https://user-images.githubusercontent.com/1524099/146406180-7bf330f8-c52b-442a-a562-4393b3151c1e.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996710855


   Yessss. Things are starting to work. 
   
   I can start the debugger with no SDE. 
   
   It stops on the xs:schema element of PCAPHeader element, and within that on the Network element.
   
   I continue and it stops at the PCAPHeader (Yay!)
   
   I continue again and can stop on more things.
   
   I noticed the "step into" button doesn't work "stepIn failure null" in Terminal. 
   
   This is significant progress. 
   
   I can't figure out how to access or set a breakpoint in the ethernetIP schema, which doesn't show up as files anywhere on the left, and since stepInto doesn't work.... Hmmm. 
   
   I will try more variations later today. (Out for a couple hours now. - until noon ish)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995965444


   Java 11 makes no difference. I rebuilt the vsix file using java 11, reinstalled it into vscode. running the launch config gives same SDE. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on a change in pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on a change in pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#discussion_r773161419



##########
File path: src/daffodilDebugger.ts
##########
@@ -180,12 +181,29 @@ export async function getDebugger(
         return stopDebugging()
       }
 
+      let workspaceFolder = vscode.workspace.workspaceFolders
+        ? vscode.workspace.workspaceFolders[0].uri.fsPath
+        : vscode.Uri.parse('').fsPath
+
+      // Get daffodilDebugger class paths to be added to the debugger
+      let daffodilDebugClasspath = config.daffodilDebugClasspath.includes(
+        '${workspaceFolder}'
+      )
+        ? config.daffodilDebugClasspath.replace(
+            regexp['workspace'],
+            workspaceFolder
+          )
+        : config.daffodilDebugClasspath
+
       // Start debugger in terminal based on scriptName
       let terminal = vscode.window.createTerminal({
         name: artifact.scriptName,
         cwd: `${rootPath}/daffodil-debugger-${daffodilVersion}-${LIB_VERSION}/bin/`,
         hideFromUser: false,
         shellPath: artifact.scriptName,
+        env: {
+          DAFFODIL_DEBUG_CLASSPATH: daffodilDebugClasspath,

Review comment:
       @jw3 When my other PR for the CI stuff is merged we will not be using `eslint` anymore as we will be using `prettier` and the way we have it configured, at least right now, it does not complain about this sort of thing.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell edited a comment on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell edited a comment on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995344139


   I was able to get the fix the VSIX file so that the launch wizard works properly. @mbeckerle If you have this exact config in `vscode/launch.json` does debugging work?
   
   ```
   {
       "version": "0.2.0",
       "configurations": [
           {
               "request": "launch",
               "type": "dfdl",
               "name": "Wizard Config",
               "program": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/main/resources/com/tresys/pcap/xsd/pcap.dfdl.xsd",
               "data": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/test/resources/com/tresys/pcap/data/icmp1.cap",
               "debugServer": 4711,
               "infosetOutput": {
                   "type": "none",
                   "path": "${workspaceFolder}/infoset.xml"
               },
               "trace": true,
               "stopOnEntry": true,
               "useExistingServer": false,
               "openHexView": false,
               "openInfosetView": false,
               "openInfosetDiffView": false,
               "daffodilDebugClasspath": "/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/main/resources:/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-pcap/src/test/resources:/home/mbeckerle/.ivy2/local/com.owlcyberdefense/dfdl-ethernetip/1.0.0/jars/dfdl-ethernetip.jar"
           }
       ]
   }
   ```
   
   If so it could have been dealing with the launch wizard setting or you were trying to use the global settings and it didn't work properly.
   
   From reading your comment a couple times and doing some testing that would be your issue. Right now the `Daffodil Launch` you chose to use does not seem to take in account the global variables (which is what you set when you were referring to setting for User, I do agree it is weird they don't have anything saying save you just have to click off of it). Would we want this as an additional issue to add to the issues section?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995949497


   Okay I did not realize that the build publishes a jar there as well, when I used it for mine it worked fine maybe another bug with the VSIX or just something my work machine is not catching.
   
   What OS are you using? Linux I assume by directories you listed but which distro? I will try to spin up a VM of the distro and test it out see if I can hit your issue that way as I can't duplicate it locally on my Mac.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995953347


   Ubuntu 20.04 is what I run. 
   I am going to try Java 11. I believe I am running Java 17 currently. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on a change in pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on a change in pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#discussion_r772501860



##########
File path: server/core/src/templates/bash-template
##########
@@ -263,8 +263,8 @@ run() {
     java_opts="${JAVA_OPTS}"
   fi
 
-  if [[ "$DAFFODIL_DEBUG_CLASSPATH" != "" ]]; then
-    app_classpath="$app_classpath:$DAFFODIL_DEBUG_CLASSPATH"
+  if [[ "$daffodilDebugClasspath" != "" ]]; then

Review comment:
       So it doesn't care about it in this particular file the only file where it complains is in the `src/daffodilDebugger.ts` file but I will revert that now




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996857749


   So from testing Mike is correct only the schema file listed as `program` will get debugged and can have breakpoints.
   
   For PCAP it imports a schema in the same directory called `binaryDynamicByteOrder.dfdl.xsd`. It also imports the `ethernetIP.dfdl.xsd` schema file from the `ethernetIP` repo.
   
   I tested this with the classpath importing the `ethernetIP` jar as well as importing its `resources` files. But in both of the imported schemas when I put a breakpoint on every single line of the schema being imported, those breakpoints are never hit (I only did this for `binaryDynamicByteOrder.dfdl.xsd`).
   
   @mbeckerle @arosien Do you think this needs to be implemented in this PR or make a seperate ticket for this? Will this be a blocker for 1.0.0?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996188400


   @mbeckerle I believe I fixed the issue, I was doing bad replaces of characters from the class path causing issues when running, if you use either the first or second `.vscode/launch.json` should work for you now. You will need to uninstall the extensions rebuilt it and install and it should work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on a change in pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on a change in pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#discussion_r772458342



##########
File path: server/core/src/templates/bash-template
##########
@@ -263,8 +263,8 @@ run() {
     java_opts="${JAVA_OPTS}"
   fi
 
-  if [[ "$DAFFODIL_DEBUG_CLASSPATH" != "" ]]; then
-    app_classpath="$app_classpath:$DAFFODIL_DEBUG_CLASSPATH"
+  if [[ "$daffodilDebugClasspath" != "" ]]; then

Review comment:
       So the change most dealt with the linting of TypeScript. In the `daffodilDebugger.ts` file when we export the ENV variable it will give a warning about `DAFFODIL_DEBUG_CLASSPATH` as TypeScript wants it be camel cased. However, if we don't care about this I can revert this change




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on a change in pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on a change in pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#discussion_r772499725



##########
File path: server/core/src/templates/bash-template
##########
@@ -263,8 +263,8 @@ run() {
     java_opts="${JAVA_OPTS}"
   fi
 
-  if [[ "$DAFFODIL_DEBUG_CLASSPATH" != "" ]]; then
-    app_classpath="$app_classpath:$DAFFODIL_DEBUG_CLASSPATH"
+  if [[ "$daffodilDebugClasspath" != "" ]]; then

Review comment:
       I am more comfortable sticking with DAFFODIL_DEBUG_CLASSPATH, particularly if a new lint tool would let us control/remove the warning for this particular style guideline. 
   
   But this is in bash code, so I'm not sure why typescript cares about it or is even able to parse it.  




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995354494


   I will try exactly this on Thursday. My settings does NOT look exactly like your screen shot, so something is definitely wrong. Is it possible that the yarn build failed, but left the older vsix file sitting there? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995936506


   Are you sure that is the proper path to your dfdl-ethernetip jar? Are you sure it isn't `/home/mbeckerle/Documents/dataiti/git/dfdl-schemas/dfdl-ethernet/target/dfdl-ethernetip-1.0.0.jar`, this would be more similar to the path I used.
   
   The error you are getting is from pcap not being able to include an item that would be in that jar. So wondering if that jar does not exist or just a pathing error.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995929602


   Same SDE with this new launch.json


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996256898


   Okay so try these steps:
   - 1.) Uninstall extension and delete the VSIX file
   - 2.) Reload VSCode
   - 3.) Remove both of these folders
   ```
   ~/.local/share/daffodil-dap
   server/core/target/
   ```
   - 4.) Run `yarn build`
   - 5.) Install the VSIX file
   - 6.) Try running schema again
   
   ---
   
   If this does not work I think best way for me to pin point where the issue is doing this.
   
   Can you edit this file
   
   ```
   ~/.local/share/daffodil-dap/daffodil-debugger-3.1.0-1.0.0-SNAPSHOT/bin/daffodil-debugger
   ```
   
   Edit these lines
   
   ```
     if [[ "$DAFFODIL_DEBUG_CLASSPATH" != "" ]]; then
       app_classpath="$app_classpath:$DAFFODIL_DEBUG_CLASSPATH"
     fi
   ```
   
   to be
   
   ```
     if [[ "$DAFFODIL_DEBUG_CLASSPATH" != "" ]]; then
       echo "$DAFFODIL_DEBUG_CLASSPATH" > output
       app_classpath="$app_classpath:$DAFFODIL_DEBUG_CLASSPATH"
     fi
   ```
   
   After saving try debug the schema again and then post a comment here with the contents of this file
   
   ```
   ~/.local/share/daffodil-dap/daffodil-debugger-3.1.0-1.0.0-SNAPSHOT/bin/output
   ```
   
   If this file does not exist after doing this then it is a different than I am thinking is happening.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995337779


   @mbeckerle is this what it looks like for you for the launch wizard?
   <img width="1904" alt="Screen Shot 2021-12-15 at 7 48 33 PM" src="https://user-images.githubusercontent.com/32347414/146287635-cff3b1e1-d83d-4201-a8e9-5fd7449085de.png">
   
   If so your config was not properly saved as there seems to be a debug with the launch wizard. On my work machine the wizard looks how it should but on my personal looks like what is posted which means the styles and script did not get loaded properly. This could be a reason behind your issues but I am looking into it now will report back once I get something figured out.
   
   Did you make your own `.vscode/launch.json` with these paths you sent?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995938039


   That jar is present at that path. Just double checked it. When I 'sbt publishLocal' on the ethernetIP schema project, this .ivy2/local directory is where the jar ends up. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995926332


   Does Daffodil-lib jar have to be on the debug classpath in order to use the DFDLGeneralFormat.dfdl.xsd schema file built-into daffodil? It is not on the debug classpath, because I'm assuming daffodil itself doesn't have to be. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995925230


   Using exactly the launch.json from above in this thread. I get this SDE
   ![image](https://user-images.githubusercontent.com/1524099/146400487-a800e08c-75d2-4e38-91c3-904c73800dc1.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] arosien commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
arosien commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996843983


   > I also tried using the debug classpath where PCAP and ethernetIP's src/main/resources and src/test/resources folders are on the classpath and that also seems to work.
   >
   > However there is no way to step into the ethernetIP schema, or set a breakpoint in there.
   
   In talking with @Shanedell we'll reproduce what you're seeing @mbeckerle and see if there needs to be a patch to the backend.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell edited a comment on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell edited a comment on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996857749


   So from testing Mike is correct only the schema file listed as `program` will get debugged and can have breakpoints.
   
   For PCAP it imports a schema in the same directory called `binaryDynamicByteOrder.dfdl.xsd`. It also imports the `ethernetIP.dfdl.xsd` schema file from the `ethernetIP` repo.
   
   I tested this with the classpath importing the `ethernetIP` jar as well as importing its `resources` files. But in both of the imported schemas when I put a breakpoint on every single line of the schema being imported, those breakpoints are never hit (I only did this for `binaryDynamicByteOrder.dfdl.xsd`).
   
   @mbeckerle @arosien Do you think this needs to be implemented in this PR or make a separate ticket for this? Will this be a blocker for 1.0.0?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996722088


   I also tried using the debug classpath where PCAP and ethernetIP's src/main/resources and src/test/resources folders are on the classpath and that also seems to work. 
   
   However there is no way to step into the ethernetIP schema, or set a breakpoint in there. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on a change in pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on a change in pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#discussion_r772458342



##########
File path: server/core/src/templates/bash-template
##########
@@ -263,8 +263,8 @@ run() {
     java_opts="${JAVA_OPTS}"
   fi
 
-  if [[ "$DAFFODIL_DEBUG_CLASSPATH" != "" ]]; then
-    app_classpath="$app_classpath:$DAFFODIL_DEBUG_CLASSPATH"
+  if [[ "$daffodilDebugClasspath" != "" ]]; then

Review comment:
       So the change most dealt with the linting of TypeScript. In the `daffodilDebugger.ts` file when we export the ENV variable it will give a warning about `DAFFODIL_DEBUG_CLASSPATH` as TypeScript wants it be camel cased. This actually deals with eslint, which in another PR we switch from eslint to prettier so this may not be an issue once the eslint packages and files are removed. So if you would like this to be reverted I can do that




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on a change in pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on a change in pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#discussion_r772442939



##########
File path: server/core/src/templates/bash-template
##########
@@ -263,8 +263,8 @@ run() {
     java_opts="${JAVA_OPTS}"
   fi
 
-  if [[ "$DAFFODIL_DEBUG_CLASSPATH" != "" ]]; then
-    app_classpath="$app_classpath:$DAFFODIL_DEBUG_CLASSPATH"
+  if [[ "$daffodilDebugClasspath" != "" ]]; then

Review comment:
       We don't have any actual style guidelines for this sort of thing. (Probably we should.)
   
   The precedent we do have is that the CLI looks for DAFFODIL_CLASSPATH, and it is a documented feature. So perhaps we should stick with that convention, and revert this change?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell edited a comment on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell edited a comment on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995337779


   @mbeckerle is this what it looks like for you for the launch wizard?
   <img width="1904" alt="Screen Shot 2021-12-15 at 7 48 33 PM" src="https://user-images.githubusercontent.com/32347414/146287635-cff3b1e1-d83d-4201-a8e9-5fd7449085de.png">
   
   If so your config was not properly saved as there seems to be a debug with the launch wizard. On my work machine the wizard looks how it should but on my personal when I build the vsix and install it that way, it looks like what is posted which means the styles and script did not get loaded properly. I think this because I didn't allow the script and style files to be bundled into the VSIX. This could be a reason behind your issues but I am looking into it now will report back once I get something figured out.
   
   Did you make your own `.vscode/launch.json` with these paths you sent?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] jw3 commented on a change in pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
jw3 commented on a change in pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#discussion_r772900871



##########
File path: src/daffodilDebugger.ts
##########
@@ -180,12 +181,29 @@ export async function getDebugger(
         return stopDebugging()
       }
 
+      let workspaceFolder = vscode.workspace.workspaceFolders
+        ? vscode.workspace.workspaceFolders[0].uri.fsPath
+        : vscode.Uri.parse('').fsPath
+
+      // Get daffodilDebugger class paths to be added to the debugger
+      let daffodilDebugClasspath = config.daffodilDebugClasspath.includes(
+        '${workspaceFolder}'
+      )
+        ? config.daffodilDebugClasspath.replace(
+            regexp['workspace'],
+            workspaceFolder
+          )
+        : config.daffodilDebugClasspath
+
       // Start debugger in terminal based on scriptName
       let terminal = vscode.window.createTerminal({
         name: artifact.scriptName,
         cwd: `${rootPath}/daffodil-debugger-${daffodilVersion}-${LIB_VERSION}/bin/`,
         hideFromUser: false,
         shellPath: artifact.scriptName,
+        env: {
+          DAFFODIL_DEBUG_CLASSPATH: daffodilDebugClasspath,

Review comment:
       you can add the following above this line for the linter
   
   `// eslint-disable-next-line @typescript-eslint/naming-convention`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] mbeckerle commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-997101604


   Getting stepping/breakpoints across multiple files working can be a separate PR. 
   
   I'm still checking out functionality here though. E.g., I haven't yet seen any output XML from a parse if I just continue past all the breakpoints. This is possibly just that I'm doing it wrong. 
   
   I do think debug  PCAP + EthernetIP needs to work, because that's an example we always refer people to, because so many people are familiar with IP packets and such as a format. 
   
   I'm really hoping v1.0.0 of the debugger can be used in training that I need to do this winter. For that it has to let you build a "real" schema, not just one limited to single files. 
   
   That said, "hoping" is the word here. I don't decide. We decide as a community, and if the PMC wants to release it sooner and wants to call it v1.0.0 I am not going to block things based on my preferences. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell edited a comment on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell edited a comment on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995949497


   Okay I did not realize that the build publishes a jar there as well, when I used it for mine it worked fine maybe another bug with the VSIX or just something my work machine is not catching.
   
   Can you also send a screenshot of what the workspace you have opened to debug in looks like? Just so I can see all the folders and files you have in the workspace?
   
   What OS are you using? Linux I assume by directories you listed but which distro? I will try to spin up a VM of the distro and test it out see if I can hit your issue that way as I can't duplicate it locally on my Mac.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-995982454


   Would the schemes need rebuilt for Java 11?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [daffodil-vscode] Shanedell commented on pull request #63: Daffodil Debugger Classpaths

Posted by GitBox <gi...@apache.org>.
Shanedell commented on pull request #63:
URL: https://github.com/apache/daffodil-vscode/pull/63#issuecomment-996026143


   Uh that is weird to me as I use java 11 so I will have to do some digging see if I can recreate the issue


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org