Cryptofex-bin-directory

From UVOO Tech Wiki
Jump to navigation Jump to search

The Cryptofex IDE bin Directory

This directory is the home of binary files that Cryptofex IDE needs access to in order to provide some of the features for working with files. In particular, it is the home of "rholangCLI.jar", which is used to provide an interpreter for testing Rholang files. I fully expect it will also be the home for platform-dependent binaries as well, such as "busybox", which we will likely need for the Windows packaged version of this IDE.

This file has a secondary purpose as well: to add "bin/" to the repository; due to the compiled nature of the files we expect to put in this directory, we do not want to add them to our git repository, yet git doesn't permit the addition of empty directories into the repositiory. Thus, I have decided to put the information relative to this directory here, rather than in another relevant document.

The position of this current directory is not the ideal position: due to some quirks with differences between running from the command line vs running from an AppImage, it is necessary to create two symlinks to make sure that things work correctly.

Suppose we have the following directory structure (simplified from the actual structure):

    /[cryptofex-ide-home]   [this is the directory that is one above the repository]
        /[electron-ide]     [the repository that holds the Cryptofex IDE source]
            /bin            [the directory that holds binary files for the IDE]
            /ide            [the directory I need to be in to run and/or build the IDE]

In order for Cryptofex IDE to find "bin" when running from the command line (ie, when

we run "yarn run" or "yarn test" from the "[electron-ide]/ide" directory) we need a "bin"

file on the same level as the repository. Thus, in the directory "[electron-ide]" we need to execute the following command:

mkdir ../usr
ln -s `pwd`/usr/sbin ../bin

In order for Electron Builder to find "bin" when constructing AppImage and friends, (ie, when we run "yarn dist"), we need to execute the following command:

ln -s `pwd`/bin ide/dist_bin

When we execute these commands, our directory structure should look something like this:

    /[cryptofex-ide-home]   [this is the directory that is one above the repository]
        /usr/sbin -> [electron-ide]/bin/
        /[electron-ide]     [the repository that holds the Cryptofex IDE source]
            /bin            [the directory that holds binary files for the IDE]
            /ide            [the directory I need to be in to run and/or build the IDE]
                /dist_bin -> ../bin

Note that the "/usr/sbin" symbolic link will be used by multiple versions of Cryptofex IDE if there is more than one repository in the same "[cryptofex-ide-home]" -- for example, I have "electron-ide" and "test-electron-ide" repositories. This probably won't be a problem in most cases -- if there's a reason for me to have two different "rholangCLI.jar" files, though, then I will be forced to put the repositories in two different "[cryptofex-ide-home]" directories.

(I find it useful to use a Unix tool called "tree" to view directory structures; this tool typically doesn't come with Unix distributions, though, but should be available in most