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

Standard Makefile targets and minimize duplication across apps #604

Open
6 tasks
phil-davis opened this issue Nov 28, 2018 · 7 comments
Open
6 tasks

Standard Makefile targets and minimize duplication across apps #604

phil-davis opened this issue Nov 28, 2018 · 7 comments

Comments

@phil-davis
Copy link
Contributor

phil-davis commented Nov 28, 2018

Overview

The Makefiles in core and apps have a range of different targets for build, dist, dev, clean and so on.

For example, we currently have Makefile targets like:

make clean
make clean-build
make clean-dist
make clean-deps
make clean-composer-deps
make clean-nodejs-deps
make clean-js-deps
make clean-test
make clean-test-acceptance
make clean-test-results
make clean-docs

(examples above were found by looking in the core and password_policy Makefiles - there will be others, I suspect)

In various apps we have been adding make test-php-style make test-php-phan make test-php-phpstan Those things put dependencies under a vendor-bin folder. The dependencies get "sorted out" and loaded by composer when you first run the relevant type of test. Versions of dependencies will get loaded to match the version of PHP that the developer happens to be running.

If the developer switches to using a different version of PHP (e.g. when testing "interesting stuff" locally), specially if they switch back to PHP 5.6, then the loaded dependencies might not be correct any more.

It would be handy if there is a way to clean these loaded dependencies so that the developer can quickly start-over and have composer sort out new dependencies to match the current PHP version.

Issue

Decide some "standard" targets for:

  • build-dist-release process (whatever it will be called)
  • making an app ready in a developer environment (make ddev or whatever)
  • cleaning stuff like these vendor-bin dependency files, other composer, yarn, JS whatever artifacts
  • produce a "standard" Makefile in one app and agree on it, merge it
  • design a way to be able to put common parts of it somewhere that can be "pulled in" to minimize duplication of the script across apps
  • implement in all apps
@phil-davis
Copy link
Contributor Author

This issue comes out of comment owncloud/files_antivirus#273 (comment)

@phil-davis phil-davis changed the title Standard Makefile "clean" targets Standard Makefile targets and minimize duplication across apps Feb 12, 2019
@phil-davis
Copy link
Contributor Author

One example to look at that has rules in separate files: https://github.com/owncloud/customgroups/blob/master/Makefile

@PVince81
Copy link
Contributor

as suggested by @patrickjahns, see https://github.com/cloudposse/build-harness

or need to replace Makefiles with a tool that lives in another repo which must be used for buildling all apps and core

@PVince81
Copy link
Contributor

@phil-davis AFAIK we already normalized the make targets across apps as part of #582

so we can keep this ticket for the "central make rules" part and relevant research

@phil-davis
Copy link
Contributor Author

phil-davis commented Mar 11, 2019

We normalized most of them - the test-* targets are all normalized, most apps have targets like clean clean-deps dist but some still have make appstore and some other unusual clean targets.

But when we design a place that has "central make rules" then as we "include" that from each app, we will be forced to normalize any left-over make targets that we find.

@PVince81
Copy link
Contributor

backlogged for now

@PVince81 PVince81 added this to the backlog milestone Mar 11, 2019
@phil-davis phil-davis removed their assignment Aug 31, 2020
@phil-davis
Copy link
Contributor Author

Removed my assignment. Someone will need to decide if we want to do any more here. The Makefile targets for tests are all standardized. .drone.star works in the same way in all core apps.

Places where build-dist-release targets are a bit confusing/different are getting found as app releases are done.

The structure of all this is stable now, so I don't know if we want/need to try to put stuff into common files... for these existing apps.

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