-
Notifications
You must be signed in to change notification settings - Fork 301
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
Replace scala.sys.Process
#5317
base: master
Are you sure you want to change the base?
Conversation
joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/ExternalCommand.scala
Outdated
Show resolved
Hide resolved
…references to new ExternalCommand
scala.sys.Process
scala.sys.Process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite get it sorry.
- We now carry two almost identical implementation around. (semanticcpg and sbt)
- User downstream need to change the dependency from x2cpg to semanticcpg or at it additionaly
- Scala process is a wrapper around Java processbuilder anyway
- Every invocation is now more complicated, e.g., if std out/err is not used and one only is interested in the return value
- Especially at the sbt side of things simply using Scala process looks cleaner
semanticcpg/src/main/scala/io/shiftleft/semanticcpg/utils/ExternalCommand.scala
Outdated
Show resolved
Hide resolved
@@ -1,10 +1,11 @@ | |||
package io.joern.x2cpg.utils | |||
package io.shiftleft.semanticcpg.utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to not make this a breaking change, make object ExternalCommand
a trait or class and with e.g. an Impl
suffix and have two object
s extend it, one in the old and one in the new namespace. Please put a deprecation warning on the old namespace version. That way we dont break anything without a headsup.
…s.Process. Re-added io.joern.x2cpg.utils.ExternalCommand with Deprecated annotation. Added io.shiftleft.semanticcpg.utils.ExternalCommandImpl trait
…s.Process. Re-added io.joern.x2cpg.utils.ExternalCommand with Deprecated annotation. Added io.shiftleft.semanticcpg.utils.ExternalCommandImpl trait
joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/utils/GccSpecificExternalCommand.scala
Outdated
Show resolved
Hide resolved
.../frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/passes/DownloadDependenciesPass.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy if everyone else is happy
scala.sys.Process
withjava.lang.ProcessBuilder
io.joern.x2cpg.utils.ExternalCommand
toio.shiftleft.semanticcpg.utils.ExternalCommand
so it can be used in the required placesExternalCommand
that allows the process to run in the current directory inherited from the Java parentExternalCommandUtil
, which replicates some ofExternalCommand.scala
functionality so that it can be used inbuild.sbt
files