You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/04/01 20:28:53 UTC

[GitHub] [trafficcontrol] zrhoffman opened a new pull request #5703: Add Makefile RPM target aliases

zrhoffman opened a new pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703


   <!--
   ************ STOP!! ************
   If this Pull Request is intended to fix a security vulnerability, DO NOT submit it! Instead, contact
   the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
   -->
   ## What does this PR (Pull Request) do?
   <!-- Explain the changes you made here. If this fixes an Issue, identify it by
   replacing the text in the checkbox item with the Issue number e.g.
   
   - [x] This PR fixes #9001 OR is not related to any Issue
   
   ^ This will automatically close Issue number 9001 when the Pull Request is
   merged (The '#' is important).
   
   Be sure you check the box properly, see the "The following criteria are ALL
   met by this PR" section for details.
   -->
   Before #5653, you could build a single RPM by running `make cache/traffic_ops_ort.rpm` or `make traffic_monitor/traffic_monitor.rpm`, etc. and these Makefile targets were available to shell completion.
   As of #5653, no RPM targets are completable in the shell and the only completable targets are the phony ones: `all`, `build-builders`, `clean`, `debug`, `native`, `nearly-all`, `pull-builders`, and `very-clean`.
   This PR re-adds completion for those relative RPM targets but does *not* add them to the `all` target.
   - [x] This PR is not related to any Issue <!-- You can check for an issue here: https://github.com/apache/trafficcontrol/issues -->
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this
   Pull Request. Also, feel free to add the name of a tool or script that is
   affected but not on the list.
   
   Additionally, if this Pull Request does NOT affect documentation, please
   explain why documentation is not required. -->
   
   - CDN in a Box
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your Pull Request. If
   it includes tests (and most should), outline here the steps needed to run the
   tests. If not, lay out the manual testing procedure and please explain why
   tests are unnecessary for this Pull Request. -->
   In the CDN in a Box directory:
   * Run `make` to verify that the `all` target still works
   * Run `make traffic_ops/traffic_ops.rpm` and verify that the RPM ends up at `infrastructure/cdn-in-a-box/traffic_ops/traffic_ops.rpm`
   
   In the main project directory:
   * Run `make -f infrastructure/cdn-in-a-box/Makefile traffic_ops/traffic_ops.rpm` and verify that the RPM ends up at `infrastructure/cdn-in-a-box/traffic_ops/traffic_ops.rpm` and not `traffic_ops/traffic_ops.rpm`
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   <!-- If this PR fixes a bug, please list here all of the affected versions - to
   the best of your knowledge. It's also pretty helpful to include a commit hash
   of where 'master' is at the time this PR is opened (if it affects master),
   because what 'master' means will change over time. For example, if this PR
   fixes a bug that's present in master (at commit hash '1df853c8'), in v4.0.0,
   and in the current 4.0.1 Release candidate (e.g. RC1), then this list would
   look like:
   
   - master (1df853c8)
   - 4.0.0
   - 4.0.1 (RC1)
   
   If you don't know what other versions might have this bug, AND don't know how
   to find the commit hash of 'master', then feel free to leave this section
   blank (or, preferably, delete it entirely).
    -->
    - master (c928be0441)
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [x] Building RPMs for CDN in a Box and building/running CDN in a Box itself is a sufficient test for the CiaB Makefile
   - [x] Bugfix, documentation is unnecessary
   - [x] An update to CHANGELOG.md is unnecessary
   - [x] This PR includes any and all required license headers
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   ## Additional Information
   <!-- If you would like to include any additional information on the PR for
   potential reviewers please put it here.
   
   Some examples of this would be:
   
   - Before and after screenshots/gifs of the Traffic Portal if it is affected
   - Links to other dependent Pull Requests
   - References to relevant context (e.g. new/updates to dependent libraries,
   mailing list records, blueprints)
   
   Feel free to leave this section blank (or, preferably, delete it entirely).
   -->
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#discussion_r605986880



##########
File path: infrastructure/cdn-in-a-box/Makefile
##########
@@ -130,6 +130,15 @@ $(TS_RPM): $(TS_DIST_RPM)
 $(ORT_RPM): $(ORT_DIST_RPM)
 	cp -f "$?" "$@"
 
+# RPM target aliases
+traffic_monitor/traffic_monitor.rpm: $(TM_RPM)
+traffic_ops/traffic_ops.rpm: $(TO_RPM)
+traffic_portal/traffic_portal.rpm: $(TP_RPM)
+traffic_router/traffic_router.rpm: $(TR_RPM)
+traffic_router/tomcat.rpm: $(TOMCAT_RPM)
+traffic_stats/traffic_stats.rpm: $(TS_RPM)
+cache/traffic_ops_ort.rpm: $(ORT_RPM)

Review comment:
       So again, we could make these `.PHONY` if we're okay with `make` not being able to tell when it needs to rebuild them, or we could again restrict it to running within the CDN-in-a-Box directory if we're okay with the that restriction. Of course, it'd still need to support running in directories with spaces in them, since a user should be able to clone wherever they want and we don't have control over that. In that case, I'd be totally fine taking out the checks at the start of the makefile that it used to have to error out if you're not calling it from the right place, if those are too much of a pain to do correctly. I don't think people did that, in general, and I think we could get away with an admonition in the docs/README instead




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#issuecomment-812176481


   > For the record, after #5653 you can still `make` individual RPMs, even if shell completions have a hard time with it
   
   Not with the same command, I can't. This is what I get:
   
   ```shell
   [user@computer cdn-in-a-box]$ make traffic_ops/traffic_ops.rpm
   make: *** No rule to make target 'traffic_ops/traffic_ops.rpm'.  Stop.
   ```
   `make $(realpath traffic_ops/traffic_ops.rpm)` works, but that takes awhile to type because there's no shell completion.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on pull request #5703: Separate Makefile targets for relative and absolute RPM paths

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#issuecomment-812298883


   Force-pushed to reword the commit message


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 merged pull request #5703: Separate Makefile targets for relative and absolute RPM paths

Posted by GitBox <gi...@apache.org>.
ocket8888 merged pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#discussion_r606039697



##########
File path: infrastructure/cdn-in-a-box/Makefile
##########
@@ -130,6 +130,15 @@ $(TS_RPM): $(TS_DIST_RPM)
 $(ORT_RPM): $(ORT_DIST_RPM)
 	cp -f "$?" "$@"
 
+# RPM target aliases
+traffic_monitor/traffic_monitor.rpm: $(TM_RPM)
+traffic_ops/traffic_ops.rpm: $(TO_RPM)
+traffic_portal/traffic_portal.rpm: $(TP_RPM)
+traffic_router/traffic_router.rpm: $(TR_RPM)
+traffic_router/tomcat.rpm: $(TOMCAT_RPM)
+traffic_stats/traffic_stats.rpm: $(TS_RPM)
+cache/traffic_ops_ort.rpm: $(ORT_RPM)

Review comment:
       Gave the Makefile separate targets for relative paths and absolute paths in fc200a5946. Now it tab-completes both the relative-path RPM filename and the full-path RPM filename.
   
   If you build a relative-path RPM target, Make treats the corresponding full-path RPM target as built, too.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#issuecomment-812174528


   For the record, after #5653 you can still `make` individual RPMs, even if shell completions have a hard time with it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#issuecomment-812215870


   oh, you're right. Man, that's weird...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#discussion_r605985485



##########
File path: infrastructure/cdn-in-a-box/Makefile
##########
@@ -130,6 +130,15 @@ $(TS_RPM): $(TS_DIST_RPM)
 $(ORT_RPM): $(ORT_DIST_RPM)
 	cp -f "$?" "$@"
 
+# RPM target aliases
+traffic_monitor/traffic_monitor.rpm: $(TM_RPM)
+traffic_ops/traffic_ops.rpm: $(TO_RPM)
+traffic_portal/traffic_portal.rpm: $(TP_RPM)
+traffic_router/traffic_router.rpm: $(TR_RPM)
+traffic_router/tomcat.rpm: $(TOMCAT_RPM)
+traffic_stats/traffic_stats.rpm: $(TS_RPM)
+cache/traffic_ops_ort.rpm: $(ORT_RPM)

Review comment:
       These are, unfortunately, lies. These recipes are only the truth if you're running `make` from within the CDN-in-a-Box directory. If you run it anywhere else, it doesn't produce the target, which is something we now support.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#issuecomment-812177664


   What's your `make` version? Works fine for me:
   ```
   $ make traffic_ops/traffic_ops.rpm
   make: Nothing to be done for 'traffic_ops/traffic_ops.rpm'.
   $
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#discussion_r605986880



##########
File path: infrastructure/cdn-in-a-box/Makefile
##########
@@ -130,6 +130,15 @@ $(TS_RPM): $(TS_DIST_RPM)
 $(ORT_RPM): $(ORT_DIST_RPM)
 	cp -f "$?" "$@"
 
+# RPM target aliases
+traffic_monitor/traffic_monitor.rpm: $(TM_RPM)
+traffic_ops/traffic_ops.rpm: $(TO_RPM)
+traffic_portal/traffic_portal.rpm: $(TP_RPM)
+traffic_router/traffic_router.rpm: $(TR_RPM)
+traffic_router/tomcat.rpm: $(TOMCAT_RPM)
+traffic_stats/traffic_stats.rpm: $(TS_RPM)
+cache/traffic_ops_ort.rpm: $(ORT_RPM)

Review comment:
       So again, we could make these `.PHONY` if we're okay with `make` not being able to tell when it needs to rebuild them, or we could again restrict it to running within the CDN-in-a-Box directory if we're okay with the that restriction. Of course, it'd still need to support running in directories with spaces in them, since a user should be able to clone wherever they want and we don't have control over that. In that case, I'd be totally fine taking out the checks at the start of the makefile that it used to have to error out if you're not calling it from the right place, if those are too much of a pain to do correctly. I don't think people did that, in general, and I don't think `cd` as a dependency is asking too much.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on pull request #5703: Add Makefile RPM target aliases

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #5703:
URL: https://github.com/apache/trafficcontrol/pull/5703#issuecomment-812205054


   > What's your `make` version? Works fine for me:
   > 
   > ```
   > $ make traffic_ops/traffic_ops.rpm
   > make: Nothing to be done for 'traffic_ops/traffic_ops.rpm'.
   > $
   > ```
   
   Yes, but remove `traffic_ops/traffic_ops.rpm` and try again.
   
   I'm using GNU Make 4.3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org