BIRCH/Winbirch/Birchconfig and winbirch
From Bioinformatics.Org Wiki
Contents |
Overview
This page is to summarize the changes that will need to be made to birchconfig in order to get it to work on windows platforms
Status
I now have a tarball for the framework that is able to install and setup BIRCH properly, so far as I can tell.
A video of the process can be viewed here
Outstanding issues
Issues stem from the fact that we are using windows JVM, but must run everything else through cygwin
- The shell scripts really don't like paths with spaces in them, so installing to Program Files is proving to be a headache
- We need to ensure that all the necessary environment variables are exported to the user registry so that biolegato can use them.
- Not sure if custom documentation is working yet, need to fix this.
The plan
Find out what it will take to keep birchconfig from crashing- Modify profile.source and cshrc.source accordingly so that there is appropriate entries for "winxp-32"
- Modify birchconfig to use platformdetect.py and probes instead of guessing
- The scripts that birchconfig is using are all shell scripts, they will need to be updated to python scripts anyways, so probably the sooner the better.
How to trick windows into working
- Anytime you are working with paths, try and make them relative to CWD using java's System.getProperty("user.dir")
- Whenever exporting to a tarball, you need to make sure you reset the permissions to good ones before compression.
The process:
- Make the changes to the framework
- Test them within IDE, if they don't work, go back to step 1, if they do, go to step 3
- Revert all the files that you DIDN'T mean to change (commit the ones that you did, then revert the rest of the project)
- Export the project
- Set the permissions
- Create the tarball
- Test the standalone tarball
Issues Solved
- The java program needs to see windows paths, but cygwin needs posix compliant paths.
- WindowsCompat class created to convert paths as needed IFF the platform is windows and a java command wrapper was created. Also, making any path relative to the CWD seems to decrease platform dependence.
- Commands need to be run through cygwin instead of windows shell
- modified runCommand.java so that if the platform is windows it will run commands through cygwin
- The "mv" class doesn't reliably move/rename files.
- Wrote my own python script called "pymv" that will correctly move any file given an absolute path or path relative to cwd
- When committing to the repository or exporting on windows... svn breaks all unix file permissions >.< because its being execute from a win32 implementation of SVN, and the developers never thought they would have to worry about umasks...
- The only way to fix this cross-platform permission issue is with the nasty command "chmod 777 -R framework"... it isn't pretty but it seems to work.
- We need to export the environment variables to windows so that biolegato can see them
- I created an exe that will update the windows registry. Basically, at install time all the environment variables will be "dumped" into the windows registry for the current user. If we need the flexibility to change them, I will make a script that do this from cygwin. Once exported, it is important to run the envupdate.exe. It current exports:
- $BIRCH -> %BIRCH%
- GDE_HELP_DIR ->%GDE_HELP_DIR%
- I created an exe that will update the windows registry. Basically, at install time all the environment variables will be "dumped" into the windows registry for the current user. If we need the flexibility to change them, I will make a script that do this from cygwin. Once exported, it is important to run the envupdate.exe. It current exports:
Note: it would be helpful if all the birch environment variables had "BIRCH" in them.
I have also created a wrapper "java.py" which i put in /usr/bin, so that it is recognized BEFORE the windows java. This way it can convert unix to dos paths and then invoke the windows java.
(note to self: todo: modify java.py to use cmd /c start java as a prefix)
WindowsCompat and runCommand
The modifications that I made to runCommand and calls to WindowsCompat won't affect how birchconfig works in windows. Simply put, if the platform isn't windows the default/original behavior is used. My changes will only take effect if the platform is set to windows.
Biolegato Implications
Luckily, biolegato is able to open files without needing to use the WindowsCompat class that I created.
There are however implications for how biolegato will run programs:
- Some minor modifications will probably need to be made:
- biolegato's "runner" class will need to be modified in much the same way that runCommand.java in birchconfig was modified, ie, so that if the platform is windows it is run through cygwin
- This class will also need to convert the windows paths for any input files into unix paths (this is extremely simple string replacement, see my WindowsCompat class for an example)
- How does biolegato load its menu entries in? Ie, where does it get the information from? Is it an environment variable, or is it hardcoded somewhere?
To Do
For some reason there is an issue with the file permissions, this needs to be fixed. (revert unmodified files back to base revision)
Create a python wrapper to export environment variables to windows then run biolegatoCreate a video demonstrating progress- Make installation relative to CWD or able to be specified by user
- Make a script that will sniff out the permissions in the original framework, save them then re-write them. This can be a wrapper to the export command.
- Make installer create symbolic links to program files, and documents and settings, since these are commonly used paths that contain spaces, which we are best to avoid
- Ensure that custom documentation etc is working