-
Notifications
You must be signed in to change notification settings - Fork 325
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
Makefile fixes #2934
Makefile fixes #2934
Conversation
Hmm, I'm not entirely happy with the solution. By the same logic that applies to Also, your commits need better descriptions for what they fix directly in the commit message. If we ever decide to ditch Github, PR descriptions will be lost, but commit messages won't. |
There's not many other variables users could override by accident. 5 or so, I think. This one has the closest name of an actual variable ( not really a gripe of mine but by your rule Noone should be setting
that's new to me. Sure I could do that. Are you talking about commit titles only or actual commit descriptions? |
Renaming the variable would be fine.
I think it makes sense to mention the variable somewhere in the docs, at least in the "development" section.
My opinion is the opposite. Commit descriptions should contains a full explanation of the whats and whys if it's not obvious from the change itself (also keep in mind that what may be obvious now may not be when someone tried to find the reason for a change in a few years). For some commits the title is enough ("add device" or "update module" is usually sufficiently self-explanatory), but often having some additional explanation is preferable. PR descriptions can just be a copy of the commit description then (which Github will already do by default for single-commit PRs), or summarize the overall changes on a higher level if the PR contains multiple related commits. |
Some communities are using GLUON_TARGETS as a variable in their makefile. This can lead to conflicts when said variable is set on the commandline by users of these communities' makefile. This happened because this is just a temporary variable that was never mentioned anywhere. PR freifunk-gluon#2934
f20d87e
to
70b316e
Compare
BROKEN TARGETS were built when BROKEN was set as a variable regardless of it's value. Even an empty BROKEN variable caused BROKEN TARGETS to be built. For DEVICES the number was evaluated and compared to true by Lua. Make behavior consistent for relevant values UNSET/EMPTY/0 and 1: UNSET/EMPTY/0: Don't build BROKEN TARGETS and DEVICES 1: Build BROKEN TARGETS and DEVICES The behavior remains inconsistent for all positive numbers except 1. (even floating point) PR freifunk-gluon#2934
70b316e
to
b1ffa2f
Compare
I just updated my PR and added a commit description to both commits. Feel free to review :) |
Commit descriptions are looking good now, but you don't need to include the PR number - for squashes, this will be added by Github, and for merges, the merge commit contains the PR number. I don't like the variable name |
BROKEN TARGETS were built when BROKEN was set as a variable regardless of it's value. Even an empty BROKEN variable caused BROKEN TARGETS to be built. For DEVICES the number was evaluated and compared to true by Lua. Make behavior consistent for relevant values UNSET/EMPTY/0 and 1: UNSET/EMPTY/0: Don't build BROKEN TARGETS and DEVICES 1: Build BROKEN TARGETS and DEVICES The behavior remains inconsistent for all positive numbers except 1. (even floating point) PR freifunk-gluon#2934
BROKEN TARGETS were built when BROKEN was set as a variable regardless of it's value. Even an empty BROKEN variable caused BROKEN TARGETS to be built. For DEVICES the number was evaluated and compared to true by Lua. Make behavior consistent for relevant values UNSET/EMPTY/0 and 1: UNSET/EMPTY/0: Don't build BROKEN TARGETS and DEVICES 1: Build BROKEN TARGETS and DEVICES The behavior remains inconsistent for all positive numbers except 1. (even floating point)
I dropped the commit editing the variable name |
Successfully created backport PR for |
BROKEN TARGETS were built when BROKEN was set as a variable regardless of it's value. Even an empty BROKEN variable caused BROKEN TARGETS to be built. For DEVICES the number was evaluated and compared to true by Lua. Make behavior consistent for relevant values UNSET/EMPTY/0 and 1: UNSET/EMPTY/0: Don't build BROKEN TARGETS and DEVICES 1: Build BROKEN TARGETS and DEVICES The behavior remains inconsistent for all positive numbers except 1. (even floating point)
I formatted the less important prosa as quotes to highlight the more important info
This PR fixes two bugs I encountered while improving our Makefile.
It calls Gluon's Makefile as a submake.
That's kind of relevant for the first commit.
My fix:
Rename
GLUON_TARGETS
toGLUON_TARGETLIST
use "override" when setting GLUON_TARGETSThis way the new values always take precedence regardless of what users input.The first occurence ofGLUON_TARGETS :=
actually resets it to the empty string. Now it also/actually empties it when set on the command lineThis mostly prevents confusing output like this, it didn't cause any actual bugs on our end:
(when leaving BROKEN unset, intentionally, to provoke the error message for an existing target)
Second commit:
I stumbled across the weird way Gluon handles the environment variable BROKEN:
first of, here are the definitions
devices
targets
why weird you ask? Well, it's inconsistent.
The fix isn't perfect, but it catches the relevant numbers (0 and 1, as well as an empty or unset variable), so it should be fine.
new behavior:
devices stays the same
targets can't (easily) compare numbers (or floats for that matter): only an exact "1" builds BROKEN devices, everything else does nothing
I could adjust Devices so it matches Targets behavior exactly, the decision is up to you
I could also add documentation for
BROKEN
(I think there is none, yet?)