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
drush make [download][url], relative [download][url] is not relative to the makefile #2482
Comments
|
This is an issue for me as I try to get the Aegir Git project able to clone a repo with a makefile in it: https://www.drupal.org/node/2838489 We are attempting to include makefile in a git repository that uses relative paths to include site specific code. You can run Aegir uses absolute paths when calling drush for both the makefile path and destination path. This setup (a makefile and custom code in a repo) is somewhat of a holy grail for developers and aegir maintainers because it combines the usefulness of git with the stability of using a makefile, but it currenly cannot be done in aegir because relative paths only work from CWD. I'd love to track this one down and help out. cc:@ergonlogic |
|
I can confirm this issue. Presumably a work-around is to build the makefile from the root of your repo, or something similar, so that you can consistently point to the right paths relative to CWD. Fixing this would, however potentially change behaviour. So, I'd suggest adding a flag that defaults to CWD, but can be switched to allow "relative to makefile". This is complicated by includes and recursive makefile builds. Presumably the "relative to makefile" will mean relative to the makefile in which the project is defined. So we'll presumably need to resolve these to full paths during the initial parsing of the makefile, prior to inclusion. The documentation will also have to be update to reflect the correct default behaviour (cwd), as well as the new behaviour. |
|
Thanks for the reply, @ergonlogic ... I attempted a fix in the PR mentioned above, but as you said, this is tricky... If someone else thinks making a drush option to use relative paths is a good idea, I can try that but I do think that using the path of makefile as the relative root is the more logical behavior. |
|
DrushMakeProject::preprocessLocalFileUrl() appears to already be trying to do this. |
|
I guess, since the docs already state that this ought to be relative to the makefile, that this is a bug. So backwards compatibility isn't really an issue. |
|
preprocessLocalFileUrl() appears to only be called when resolving patch and translation paths. Presumably we'd be able to re-use it when downloading a package. |
|
Would it be simpler to chdir to DrushMakeProject->make_directory and then chdir back? |
|
I believe that we'll need to resolve the full path in _make_parse_info_file(), prior to including other makefiles, since |
|
Actually, after further reading, I don't think preprocessLocalFileUrl() will help here. DrushMakeProject->make_directory appears to be the target build directory. |
|
In |
|
Make is deprecated. Closing old issues. |
drzraf commentedDec 2, 2016
Setup a makefile inside
/path/to/my_repo(which containsmy_profile), containing:/path/to/my_repo/,drush makesucceeds/tmp/,drush makefails"./my_profile" is not relative to the Makefile contrary to what documentation says, but relative to the current directory.
The text was updated successfully, but these errors were encountered: