You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/09/30 19:19:43 UTC

[I] Admin tool Main.scala contains MIT-licensed code from Scallop without attribution [openwhisk]

pjfanning opened a new issue, #5591:
URL: https://github.com/apache/openwhisk/issues/5591

   `tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala` contains code copied from Scallop, which is MIT-licensed:
   
   ```scala
     private def printErr(message: String): Unit = {
       //Taken from ScallopConf
       if (overrideColorOutput.value.getOrElse(System.console() != null)) {
         Console.err.println("[\u001b[31m%s\u001b[0m] Error: %s" format (printedName, message))
       } else {
         // no colors on output
         Console.err.println("[%s] Error: %s" format (printedName, message))
       }
     }
   ```
   
   It was added in daa14c6cd (#3722, 2018), when the admin tool depended on Scallop 3.1.2. It is Scallop's default `errorMessageHandler`, minus the final `sys.exit(1)`: see [`jvm/src/main/scala/org.rogach.scallop/ScallopConf.scala` lines 73-81 at v3.1.2](https://github.com/scallop/scallop/blob/v3.1.2/jvm/src/main/scala/org.rogach.scallop/ScallopConf.scala#L73-L81):
   
   ```scala
     errorMessageHandler = { message =>
       if (overrideColorOutput.value.getOrElse(System.console() != null)) {
         Console.err.println("[\u001b[31m%s\u001b[0m] Error: %s" format (printedName, message))
       } else {
         // no colors on output
         Console.err.println("[%s] Error: %s" format (printedName, message))
       }
       sys.exit(1)
     }
   ```
   
   Scallop is licensed under the MIT License, `Copyright (C) 2012 Platon Pronko and Chris Hodapp`. MIT is Category A, so the code can be included, but the MIT licence requires its copyright and permission notice to be kept with copied code. Currently the file only carries the ASF header, and neither `LICENSE.txt` nor `NOTICE.txt` mentions Scallop.
   
   Suggested fix, either:
   
   1. Rewrite `printErr` independently (it is a few lines of error printing) and drop the "Taken from ScallopConf" comment; or
   2. Keep it, add the Scallop copyright line to the file below the ASF header, and add an entry to `LICENSE.txt` for Scallop (MIT, with its copyright line and licence text), naming the file.
   
   Apache OpenServerless vendors this file and tracks the same problem in apache/openserverless#264.
   


-- 
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: issues-unsubscribe@openwhisk.apache.org.apache.org

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