Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dissociate build directory and source directory? #18

Open
lramati opened this issue Mar 17, 2013 · 3 comments
Open

Dissociate build directory and source directory? #18

lramati opened this issue Mar 17, 2013 · 3 comments

Comments

@lramati
Copy link

lramati commented Mar 17, 2013

Should we allow users to do this?
I would imagine the setup running something like this:

"I'm guessing /path/run/from is where the root is..."
->
# verify path. if it doesnt exist, ask whether it was a typo or not,
# and act accordingly.

# try to access buildpath/src/ and other needed folders.
# if not found, prompt
"I can't seem to find the source files in <dir>! Can you tell me 
where you downloaded the red spider project to?"
# verify this path. Continue, this time installing from srcpath/* to 
# buildpath/* instead of from buildpath/* to itself. 

# Internally this can be done by setting srcpath and buildpath from
# the 1st prompt, and then if os.path.exists(os.path.join(srcpath, 'src'))
# fails, prompting for a new one
@jgonggrijp
Copy link
Member

I believe the above post leaves a lot of room for confusion. Let's get some things straight...

First off, we need to be clear on what path's what. The directory that you download when you're planning to install the RSP and which contains everything is what we call the root directory ( not the build directory, which seems to be implied sometimes in the post above). The root directory contains several files, including the setup script, and some subdirectories, including /src which is the source directory proper.

Current practice (on rsroot-env) is to keep the installation within the root directory, by creating additional subdirectories /bin from which the installed commands will be called (again, not the build directory which also seems to be implied sometimes in the post above) and /extbin from which rsshell will be permanently available to the user. In the future this installation may also create a /build subdirectory in order to house intermediate compilation products, i.e. the build directory proper. The advantage of this approach is that you can install the red spider project without administrative rights and still call rsshell from any working directory.

Because of this approach, what setup.py will currently do is

  1. to automatically determine the location of the root directory;
  2. to ask the user whether they agree, and if not, let them offer an alternative;
  3. if necessary, to keep asking until the user enters a valid path;
  4. not to give the user any more choice, assuming that the chosen path contains the /src subdirectory and that the command should be installed in the /bin subdirectory, as described above.

@firerogue is suggesting that we might want to give the user more freedom regarding the paths and change the behaviour of setup.py accordingly. In particular we might like to allow users to install the commands outside the root directory. For example if the root directory is ~/redspider somebody might want to put the commands in /usr/local/bin in pure unix fashion. The change in that case would be from step 4 onwards in the list:

  • to let the user select an installation directory, providing RED_SPIDER_ROOT/bin as the default;
  • to ask the user whether they're sure if they enter a path that doesn't exist;
  • to create the directory if the user is sure, or to keep asking if the user meant to select an existing directory;
  • to install into the selected directory.

Now the question is: should we do that? Personally I think it wouldn't hurt to have the option. On the other hand, it doesn't seem terribly useful to me either. In the spirit of "less is more", I'd propose to not do this unless many people want to be able to install the commands outside of the root directory.

Another question is: could we do that? We sure can, but it requires some further sophistication of rsshell first. Currently the only information it gets from setup.py is the location of the root directory and it assumes that the installed commands are in there in the /bin subdir. Making it work with other configurations requires that we pass more information from setup.py to rsshell, i.e. with a configuration file. That in itself is no problem at all, since I'm already planning to add such a feature.

@lramati
Copy link
Author

lramati commented Mar 17, 2013

would it really need that much more information? or can you just pass the new bin/ directory without caring about the src directories? or is that a problem because of the work/ and other such directories?

@jgonggrijp
Copy link
Member

Well, if the path to the installed commands is the only thing you give more freedom then of course the only additional information you need to pass from setup.py to rsshell is that path. The problem is that currently all such information is passed through the environment, being stored permanently in ~/.profile on unixy systems or in the registry on Windows. You don't want to permanently pollute the environment with too many things. Currently we have one variable added to the environment and we can keep it at that if we start working with a configuration file.

Apart from that using a configuration file offers other benefits, e.g. you can store settings for the behaviour of rsshell, use multiple configuration files, create multiple clones of the repo and use the rsshell from one repo on the commands from another, etcetera. It opens a whole new world of flexibility!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants