-
Notifications
You must be signed in to change notification settings - Fork 2k
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
makefiles/tools/serial: Check empty port #10342
Conversation
This is only part of the required cleanup but should show what should be done to only evaluate @gebart would that be an adequate direction as a base for your PR ? |
For a detailed testing procedure: Test with the With this PRNo check when term is not required (used
and an error message on
In masterYou get a warning when not needed
The warning and a crash when termprog is executed
|
Could you try adding this diff and run a build in CI. It should make murdock fail if one board uses diff --git a/.murdock b/.murdock
index 5d03a2a09..02690805e 100755
--- a/.murdock
+++ b/.murdock
@@ -153,6 +153,11 @@ compile() {
[ ! -d "$appdir" ] && error "$0: compile: error: application directory \"$appdir\" doesn't exist"
[ ! -d "boards/$board" ] && error "$0: compile: error: board directory \"boards/$board\" doesn't exist"
+ # Try removing PORT that should be already be set by murdock
+ # https://github.com/RIOT-OS/RIOT/pull/7695#discussion_r180896514
+ # to let the auto-detection work and fail in murdock
+ unset PORT
+
# compile
CCACHE_BASEDIR="$(pwd)" BOARD=$board TOOLCHAIN=$toolchain RIOT_CI_BUILD=1 \
make -C${appdir} clean all -j${JOBS:-4} I cannot directly push to your branch. |
The I also have other helper functions that I would want to but in common. |
To help getting this merged, I would keep this PR as a global PR with split ones. I cen start reviewing PRs that removes exports as they can be integrated alone. |
01befc1
to
ae7cc3f
Compare
2ff6492
to
c49f9d0
Compare
c49f9d0
to
f764d2b
Compare
I cherry-picked #10454 inside this PR. Hope murdock is happy now. |
f764d2b
to
199733f
Compare
@cladmi I rebased and most of the PR disappeared (it's a good thing, means stuff got merged). I removed the WIP tag, I think this is not WIP any more. |
199733f
to
5dcf7f1
Compare
D'oh! I screwed up the rebase, force pushing again. |
5dcf7f1
to
3d96730
Compare
This variable is only used for the term recipe (and maybe for flashing). They should not be evaluated if they are not needed and the user should not see a warning that the port is not set if he does not use port (for example in make all.)
The example in the tool documentation contains several things that are wrong: - exports PORT. - Defines the port using :=. - Defines PORT instead of PORT_LINUX, PORT_DARWIN - ifeq-based logic (which will force an evaluation). I have not tested the new example script.
By ensuring the PORT auto-detection worked, we can give meaningful error messages and fail earlier. This uses ensure_value from makefiles/utils/checks.mk. An include was added to Makefile.include to make this fuction available to all other makefiles.
not waiting anymore as #10440 is merged. |
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.
There's a REMOVEME DELETEME
commit in this PR. Blocking to avoid any accidental merge.
The PR needs rebasing. Most of the commits are already in. |
True. c103b3f is merged already. |
Only the commit I cherry-picked is missing. |
Yes that's what I just noticed as well. I propose we close this PR and go with #12479. |
Please note, the github UI shows commits in the wrong order.
Contribution description
By ensuring the PORT auto-detection worked, we can give meaningful error messages and fail earlier.
Remarks
Hopefully this serves to illustrate why gratuitous usage of
export
and:=
should be avoided in makefiles.I'm thinking on putting these kind of helper functions in a separate
utils.mk
modules.Testing procedure
Try to
make term
forBOARD=cc2538dk
without any connected board and see how it fails. You should still be able tomake
with no problems or warnings.Issues/PRs references
Parallel to #7695.
Contains some changes by (and made on request of, and with assistance of) @cladmi
Depends on
#10439,#10440