You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "stevedlawrence (via GitHub)" <gi...@apache.org> on 2025/01/03 13:10:26 UTC

[PR] Support exporting the packageDaffodilBin task [daffodil-sbt]

stevedlawrence opened a new pull request, #83:
URL: https://github.com/apache/daffodil-sbt/pull/83

   It is currently difficult to debug the packageDaffodilBin task because it is forked by SBT as a separate process. To make it easier to debug, this writes the command that packageDaffodilBin fork/execs to the export stream. Users can then run 'sbt "export packageDaffodilBin"' to view that command, which can then be manullay run, copied into a shell script, added to an IDE for debugging, etc.
   
   Closes #76
   Closes #80


-- 
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


Re: [PR] Support exporting the packageDaffodilBin task [daffodil-sbt]

Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence merged PR #83:
URL: https://github.com/apache/daffodil-sbt/pull/83


-- 
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


Re: [PR] Support exporting the packageDaffodilBin task [daffodil-sbt]

Posted by "mbeckerle (via GitHub)" <gi...@apache.org>.
mbeckerle commented on code in PR #83:
URL: https://github.com/apache/daffodil-sbt/pull/83#discussion_r1901795200


##########
src/main/scala/org/apache/daffodil/DaffodilPlugin.scala:
##########
@@ -389,6 +391,16 @@ object DaffodilPlugin extends AutoPlugin {
               dbi.config.map { _.toString }.getOrElse("")
             )
 
+            // SBT has the concept of an "export stream"--this is a stream that an SBT task can

Review Comment:
   Ok, so this is a very cool thing. 
   
   Can you add a line to this comment about OS platform portability? Is this command "current platform" compatible, or ??
   
   E.g., The java classpath becomes an argument to this java command? That requires OS-specific syntax for the separator (: vs. ;) Or is classpath still handled separately somehow? 
   
   This overall feature will need documenting in the README.md for the plugin. Though perhaps we should develop the whole debug idiom and explain that rather than explain just how this export operation works.  E.g., suppose it turns out users need to add things like "-Xmx4g -Xss4m" or such. 
   
   There are sort of two use cases for this feature.
   
   1. I am a regular DFDL user and just want to make shell scripts to build and run my parse/unparse testing assembling the classpath and such for me so that all my dependent schemas, charsets, layers, and UDFs are found. 
   3. I am a daffodil developer and want to debug daffodil in the context of a DFDL schema project.
   
   The former needs to be documented in the README.md.
   
   The latter could be documented in a separate place, such as on our Wiki. 



-- 
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


Re: [PR] Support exporting the packageDaffodilBin task [daffodil-sbt]

Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence commented on code in PR #83:
URL: https://github.com/apache/daffodil-sbt/pull/83#discussion_r1901850270


##########
src/main/scala/org/apache/daffodil/DaffodilPlugin.scala:
##########
@@ -389,6 +391,16 @@ object DaffodilPlugin extends AutoPlugin {
               dbi.config.map { _.toString }.getOrElse("")
             )
 
+            // SBT has the concept of an "export stream"--this is a stream that an SBT task can

Review Comment:
   > Can you add a line to this comment about OS platform portability? Is this command "current platform" compatible, or ??
   
   Sure thing.
   
   The output will work on the current platform where it is generated. The classpath string is generated using `File.pathSeparator`, so it will use the correct colon vs semicolon depending on your current platform. But that does mean you can't necessarily take a command generated on Linux and use it unmodifed on Windows. That said, the file paths are absolute so are almost certainly going to be different on different platforms, and probably even be different on different machines with the same platform unless they happen to have the same directory layout. So probably if safest to just always run "export packageDaffodilBin" on the system you want to run the command on. I'll add a comment about this.
    
   > This overall feature will need documenting in the README.md for the plugin. 
   
   I did add brief blurb to the readme targeted towards DFDL users. Do you think it needs more details?
   
   I think the second use case is the intention of issue #76, so that probably shouldn't be marked as resolved by this, I'll remove that from the commit message. This change really only fixes #80, this just will make #76 a bit easier. Agreed that documentation about how to use the generated command in a debugger probably wants to live a wiki somewhere.
   
   > Though perhaps we should develop the whole debug idiom and explain that rather than explain just how this export operation works. E.g., suppose it turns out users need to add things like "-Xmx4g -Xss4m" or such.
   
   The README does mention that you can modify `packageDaffodilBin / javaOptions` to provide addition java options when building the saved paresrs. These options are included in the exported command line. So if packageDaffodilBin happens to need special options (e.g. more memory), that will be part of the output.
   
   That said, I don't know if there are any options on top of those that might be needed to enable debugging (e.g. maybe even more memory is needed, maybe there are special debug flags). That probably wants to be documented in whatever wiki page resolves #76.



-- 
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