Difference between revisions of "GSoC - Windows Support"
Hzwakenberg (talk | contribs) m |
|||
(18 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Liberty Eiffel meets Windows == |
== Liberty Eiffel meets Windows == |
||
+ | |||
− | The following paragraphs will describe in big lines how the project is going to be implemented. |
||
+ | === New small footprint installation method using Tiny-C === |
||
+ | Since October 2024, an installation script exists that loosely mimics the 'install.sh' script that is used on Linux based machines. The installation process is documented on a separate page: [[Installing on Windows using the Tiny-C compiler]] |
||
+ | This Windows cmd-script only assumes that you have a Tiny-C compiler installed - no need to download and run external installation packages. |
||
+ | |||
+ | |||
+ | |||
+ | === 2016 GSOC effort: === |
||
+ | |||
+ | * [https://github.com/petr00/Liberty-Eiffel-Windows Link to repository] |
||
+ | |||
+ | |||
+ | |||
+ | ---- |
||
+ | |||
+ | |||
'''Final Goal ''' |
'''Final Goal ''' |
||
Line 8: | Line 23: | ||
from the UNIX/LINUX environment to the WINDOWS environment and wrap it into a nice installer. |
from the UNIX/LINUX environment to the WINDOWS environment and wrap it into a nice installer. |
||
+ | ---- |
||
− | '''General view''' |
||
+ | |||
+ | == '''Progress''' == |
||
+ | |||
+ | |||
+ | I've created a working installer application that replicates all the facilities, but one, that Liberty Eiffel offers in POSIX systems, |
||
+ | in Windows Environment. The only facility that I didn't reproduce, '''net cluster''', caused the eiffeltest_server tool to be inoperable. |
||
+ | |||
− | The first step of the process would be '''compiling the original germ on Windows environment''', using mingw64 as compiler. Any change will be discussed with Paolo/Raphael or in the mailing list. |
||
− | The next step will be fixing the plugins. Both exec and net do not work as intended , therefore I must document about any possible solutions to fix the problems they cause. |
||
---- |
---- |
||
+ | |||
− | After this step , a '''install.sh equivalent for Windows''' will be created via a final batch file. |
||
+ | The other tools (se, clean, ace_check, eiffeltest, mock, eiffeltest_ng, pretty, short, class_check, finder, eiffeldoc, extract_internals) work just fine together will all the other plugins and all functionalities. |
||
− | The final batch will include a target preparing for both the installing destination folder and the Liberty Environment (including load paths), will bootstrap SmartEiffel tools (compile the germ, including the 136.c files), generate the wrappers for the libraries and compile all the Liberty Eiffel tools. |
||
+ | |||
− | The binaries created will be tested with the Liberty Eiffel automated tests. |
||
+ | |||
− | If the tests won’t give the desired results (Windows results will be compared with the ones from Linux), further research will be made about which plugin is not working properly and the missing part of the plugins would be implemented (if they do not exist) or solve the bugs that cause the failures. |
||
---- |
---- |
||
− | In order to satisfy all our users needs, I will create two different '''setup.exe''' files (both will contain information such as the compiler’s path). |
||
+ | |||
− | The reason for doing so is because there are two different possible scenarios: |
||
+ | == What I coded: == |
||
− | 1. The user already has mingw64 installed on his computer. |
||
+ | |||
− | 2. Mingw64 is not yet installed on the user’s computer. |
||
+ | |||
− | If scenario number two is correct, then mingw64 will be additional installed. |
||
+ | * [https://github.com/petr00/Liberty-Eiffel-Windows/blob/master/nsis-installer/liberty/install.bat install.bat], which creates the "T stages" and compiles *almost* all the tools, creates the configuration file and the binaries from the tools. |
||
+ | |||
+ | * [https://github.com/petr00/Liberty-Eiffel-Windows/blob/master/nsis-installer/liberty/install.bat\set_path.cmd set_path.cmd], simple utility used to create the Liberty Eiffel configuration file, called by installer.nsi . |
||
+ | |||
+ | * [https://github.com/petr00/Liberty-Eiffel-Windows/tree/master/nsis-installer/installer.nsi installer.nsi], a nicely wrapped NSIS installer + uninstaller, that follows the best practices : required executionlevel, write/delete registers, function to create/delete environment variable for the binaries created from the compiled Liberty Eiffel tools, has a function that reads the product version of the Liberty Eiffel install application and downloads from it's official website documentation regarding that patch( at the moment the site's structure does not allow that, but the function will be used in the near future, the installers now is only downloading from a plain link), an option for downloading mingw-w64, custom images etc. |
||
+ | |||
+ | |||
+ | * A part of liberty/[https://github.com/petr00/Liberty-Eiffel-Windows/blob/master/nsis-installer/liberty/se_make.bat se_make.bat](inspired from [https://github.com/LibertyEiffel/Liberty/blob/master/work/se_make.sh /work/se_make.sh]), no longer needed for this patch, therefore I did not completed all of it. |
||
+ | |||
+ | |||
+ | |||
+ | ----- |
||
+ | |||
+ | |||
+ | |||
+ | == '''General''' == |
||
+ | |||
+ | |||
+ | The original main goal was to create two versions of an installer application: one that assumes that the end-user already has mingw-w64 installed, |
||
+ | and one that installs mingw-w64 for the user. |
||
+ | |||
+ | The reason was flexibility: the installer with mingw attached would be bigger with around 300mb. |
||
+ | After searching, I found out that there are not offline installers for mingw available, but online versions of only around 200kb. |
||
+ | Therefore I only created one version of Liberty Eiffel installer that offers the user the ability to download mingw via calling mingw's online installer. |
||
---- |
---- |
||
+ | |||
− | '''Tasks :''' |
||
+ | |||
− | * Create an install.bat for all the c files from the germ |
||
+ | The "T stages" refers to compiling Liberty Eiffel's base code (currently 136 C-files created by the Liberty Eiffel compiler) and create a binary from these, and with that binary the same |
||
+ | 136 C-files (that represent the core of smarteiffel) get compiled again, and so on for three times. After three such processes, if the resulting applications are binary indentical to the previous compile, the installer proceeds further to the [[http://wiki.liberty-eiffel.org/index.php/GSoC_-_Windows_Support#Progress tools compilation]]. |
||
---- |
---- |
||
+ | |||
− | '''Problems that I am facing right now :''' |
||
+ | |||
− | * Solve undefined reference to 'WinMain' error when compiling compile_to_c.h with mingw-w64 (solved) |
||
+ | The NSIS installer does just as mentioned [[http://wiki.liberty-eiffel.org/index.php/GSoC_-_Windows_Support#Progress above]] and has incorporated an uninstaller that uninstalls exactly what the installer created. |
||
− | * Finding a Windows equivalent for <sys/wait.h> (convince the compiler it is running on a posix machine) (solved) |
||
+ | |||
− | * Getting the right tool to create an installer (HZ suggestion: NSIS, http://nsis.sourceforge.net/Main_Page - open source, configurable as an Eclipse-plugin as well) |
||
+ | == '''Repository structure''' == |
||
+ | |||
+ | |||
+ | |||
+ | Please note that I did not want to create a very long post about all the details of installer.nsi, but you can check some of those [https://github.com/petr00/Liberty-Eiffel-Windows/blob/master/nsis-installer/readme.md here]. |
||
+ | |||
+ | |||
+ | ---- |
||
+ | |||
+ | |||
+ | From this repository only the files mentioned [[http://wiki.liberty-eiffel.org/index.php?title=GSoC_-_Windows_Support&action=submit#Progress above]], 'What I coded' paragraph were made by me, plus the images. |
||
+ | The other files are duplicates from Liberty Eiffel's core structure(only the most relevant files) to create an ease of use of the installer script for testing purposes. |
Latest revision as of 10:27, 28 October 2024
Liberty Eiffel meets Windows
New small footprint installation method using Tiny-C
Since October 2024, an installation script exists that loosely mimics the 'install.sh' script that is used on Linux based machines. The installation process is documented on a separate page: Installing on Windows using the Tiny-C compiler This Windows cmd-script only assumes that you have a Tiny-C compiler installed - no need to download and run external installation packages.
2016 GSOC effort:
Final Goal
Bootstrap the Liberty-Eiffel programming language (compiler,classes, functions etc.) from the UNIX/LINUX environment to the WINDOWS environment and wrap it into a nice installer.
Progress
I've created a working installer application that replicates all the facilities, but one, that Liberty Eiffel offers in POSIX systems, in Windows Environment. The only facility that I didn't reproduce, net cluster, caused the eiffeltest_server tool to be inoperable.
The other tools (se, clean, ace_check, eiffeltest, mock, eiffeltest_ng, pretty, short, class_check, finder, eiffeldoc, extract_internals) work just fine together will all the other plugins and all functionalities.
What I coded:
- install.bat, which creates the "T stages" and compiles *almost* all the tools, creates the configuration file and the binaries from the tools.
- set_path.cmd, simple utility used to create the Liberty Eiffel configuration file, called by installer.nsi .
- installer.nsi, a nicely wrapped NSIS installer + uninstaller, that follows the best practices : required executionlevel, write/delete registers, function to create/delete environment variable for the binaries created from the compiled Liberty Eiffel tools, has a function that reads the product version of the Liberty Eiffel install application and downloads from it's official website documentation regarding that patch( at the moment the site's structure does not allow that, but the function will be used in the near future, the installers now is only downloading from a plain link), an option for downloading mingw-w64, custom images etc.
- A part of liberty/se_make.bat(inspired from /work/se_make.sh), no longer needed for this patch, therefore I did not completed all of it.
General
The original main goal was to create two versions of an installer application: one that assumes that the end-user already has mingw-w64 installed, and one that installs mingw-w64 for the user.
The reason was flexibility: the installer with mingw attached would be bigger with around 300mb. After searching, I found out that there are not offline installers for mingw available, but online versions of only around 200kb. Therefore I only created one version of Liberty Eiffel installer that offers the user the ability to download mingw via calling mingw's online installer.
The "T stages" refers to compiling Liberty Eiffel's base code (currently 136 C-files created by the Liberty Eiffel compiler) and create a binary from these, and with that binary the same
136 C-files (that represent the core of smarteiffel) get compiled again, and so on for three times. After three such processes, if the resulting applications are binary indentical to the previous compile, the installer proceeds further to the [tools compilation].
The NSIS installer does just as mentioned [above] and has incorporated an uninstaller that uninstalls exactly what the installer created.
Repository structure
Please note that I did not want to create a very long post about all the details of installer.nsi, but you can check some of those here.
From this repository only the files mentioned [above], 'What I coded' paragraph were made by me, plus the images.
The other files are duplicates from Liberty Eiffel's core structure(only the most relevant files) to create an ease of use of the installer script for testing purposes.