-
Notifications
You must be signed in to change notification settings - Fork 483
fix(make): do not place composer at /tmp/composer/composer
#738
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
Conversation
mkdir -p $(COMPOSERTMP) | ||
mv composer.phar $(COMPOSERTMP)/composer | ||
composer install -q | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is that we're loosing the 2 steps approach here (download target and usage target)
Download target should be invoked during an environment preparation phase, not during build. Usage when we need it during build.
Also using a full path name for calling composer is not necessarily an issue, (instead of using the PATH which can be wrong) as long as we don't use something controversial such as /tmp/something. It could have been stored in the fossology tree as well, but I didn't found a variable describing it in that Makefile, so that's why I didn't use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's a problem of the wrapper script. A correct altenrative would be to download composer to some temporary path (e.g. tmp/composer/
) and later in the next step all the make command with the correct path (e.g. PATH='tmp/composer/:$PATH make ....
).
Does this fit your 2 step approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that going back that way will solve all the problems (at least not the ones for building)
utils/run_with_composer_in_path.sh
Outdated
[[ -e "$tmp_composer" ]] || { | ||
curl -sS https://getcomposer.org/installer \ | ||
| php && mv composer.phar "$tmp_composer" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think we're back to what existed initially, and the problem related to that approach: there is no split between the download of composer and its usage again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could split it up again (instead of using the wrapper) as discussed in the comment above
I think there are coherency issues that need to be solved: You have a Vagrant file that does: You have a Dockerfile that does: You have a Makefile that does: So we have 3 ways of dealing with composer, whereas a single one should be used everywhere. I'll propose a patch for this as I think that's what is creating the issues reported. |
In this PR all three cases are consistend and match the first version (AFAIK). Plus you have the option to implement packaging without breaking changes using An alternative would be to introduce a new environmental variable which can be used to define the position of composer. Would it be an option to call make with
and within the makefile use something like |
The (
is that ok? |
No the calls to download composer are all different in that they all place the resulting file in different places, creating a mess when you need to call the tool afterwards through a single call ! The problem is splitting download from usage, not the Variable. |
But the download is splitted. The makefiles do never download composer. For that one either calls In your example of the mess are still two of three variants introduced by your movement of composer to |
5d9f156
to
3735e45
Compare
@bcornec With 3735e45 the idea suggested in the comment above is now working and one is able to call make in the following way (after downloading composer.phar to make COMPOSER_PHAR=/tmp/composer/composer phpvendors
#or
make COMPOSER_PHAR=/tmp/composer/composer install This allows you to download composer at an arbitrary timepoint and in an arbitrary way, without introducing braking changes to other parts of the code. note: I was not able to find the code in |
3735e45
to
76ca5c2
Compare
one might want to replace the line 76ca5c2#diff-2f7bc9d6d5478304df37e9900a6e32f2R35 (and other lines which download composer) by an script |
How to install composer programmatically is described here: https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md (under MIT) |
This PR now contains a script to install composer
|
9b273fb
to
7e73cfd
Compare
7e73cfd
to
52ec230
Compare
@mcjaeger This PR is now rebased to current master |
this commit - undos the changes to the composer placement introduced in fossology#701 - adds the option to pass the environmental variable `COMPOSER_PHAR` to `src/Makefile` to allow placing the composer.phar at arbitrary places - this fixes the source installation, i.e. the documentation was not up to date - this fixes the problems with `vagrant up` (see fossology#732) - this fixes the problems with `docker-compose build` as discussed in fossology#731 closes fossology#732
- add script to install fixed composer version - default to composer in $PATH
52ec230
to
ae02b42
Compare
actually it seems like the fo-apache.conf is not copied anymore, but that is another issue as this seems to be also in master |
this pull request
COMPOSER_PHAR
tosrc/Makefile
to allow placing the composer.phar at arbitrary placesto date
vagrant up
(see docker-compose up fails to build fossology-scheduler #732)docker-compose build
as discussed in #731
closes #732