miércoles, enero 28, 2009

La arquitectura de plugins del GCC y las licencias

(vía Vía Slashdot) Aunque estoy un poco desconectado de la evolución del gcc, de vez en o aparecen noticias interesantes, aunque en este caso más centradas en las cias de los diferentes componentes y librerías de apoyo que en la técnica en sí mismo. El equipo del gcc acaba de anunciar una nueva excepción al las librerías en tiempo ejecución (runtime) que acompañan al compilador, para proteger las interfaces con las cuales se desarrollarán los plugins.

Cuando se compila un programa con el gcc, pueden incluirse ciertas cabeceras y linkarse contra algunas librerias de tiempo de ejecución que trae el propio lador. Cuando esto ocurre entra en funcionamiento esta excepción:

A Compilation Process is "Eligible" if it is done using GCC, alone or with other GPL-compatible software, or if it is done without using any work based on GCC. For example, using non-GPL-compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process.

  1. Grant of Additional Permission. You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules, even if such propagation would otherwise violate the terms of GPLv3, provided that all Target Code was generated by Eligible Compilation Processes. You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules
  2. No Weakening of GCC Copyleft. The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of GCC.
Esto implica que si desarrollas un plugins que trabajen sobre la representación interna que utiliza el gcc y que no sea compatible con la licencia GPL ("Non Elegible"), no podrás distribuir el código generado por el mismo, puesto que la excepción anterior no se cumple, y por tanto si se distribuye se debe usar la licencia de la librería (GPL). Se puede leer más en la FAQ que los autores del gcc han colgado en la web.

Es la primera vez que veo una licencia libre que afecta a la manera de generar un programa cambia la licencia, porque se podría salvar el estado del gcc para optmizarlo posteriormente con un programa propietario, pero en ese caso ocurriría lo siguiente (de la FAQ):

When we first considered adding a plugin infrastructure to GCC, we were deeply concerned about the possibility that someone would write a plugin that would merely save GCC's internal, low-level compilation data structures to disk. With that done, other software would be able to optimize or otherwise improve that code without being directly connected to GCC. It may have been difficult for us to argue that those programs should be subject to the GPL's copyleft, so we wanted to discourage these sorts of arrangements.

We do that by excluding such output from the definition of Target Code. Because of this, even if someone writes a plugin that saves this information to disk, any programs that change the structures before GCC writes out Target Code will be involved in the Compilation Process. If that program is proprietary, the exception will not be available to any software compiled with it; the object code that GCC ultimately creates will have to be distributed under the terms of the GPL.

Desde mi punto de vista, si esta licencia es válida, abre un peligroso agujero: cualquiera puede poner restricciones en la distribución de un programa en función de que herramientas se utiliza para generarlo: Microsoft podría decir que si un programa no está generado con su compilador no puede linkarse contra las librerías del sistema, supuesto un cambio de licencia.

Actualización

Miguel habla del tema en El sistema de plugins cada vez más cerca de GCC.

Interesante un párrafo que no había leído anoche de la FAQ:

If you did use GPL-incompatible software in conjunction with GCC during the Compilation Process, you would not be able to take advantage of this permission. Since all of the object code that GCC generates is derived from these GPLed libraries, that means you would be required to follow the terms of the GPL when propagating any of that object code. You could not use GCC to develop your own GPL-incompatible software.

Puesto que es la primera vez que veo una restricción en una licencia libre sobre los datos de salida de un programa en función de que el programa esté modificado o no y estas modificaciones estén de acuerdo con la licencia del mismo, porque ya no entra en acción en la distribución, sino en la misma generación del programa con independencia de las fuentes de éste.

Technorati Tags: ,

No hay comentarios: