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

drivers/rtt_rtc: select rtc_utils #17530

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Conversation

fjmolinas
Copy link
Contributor

Contribution description

Spotted by @emmanuelsearch during release tests, if compiling only the rtt_rtc module with the mock then there is a missing dependency against rtc_utils.

Testing procedure

master

make -C tests/unittests/ tests-rtt_rtc
Building application "tests_unittests" for "native" with MCU "native".

"make" -C /home/francisco/workspace/RIOT2/boards/native
"make" -C /home/francisco/workspace/RIOT2/boards/native/drivers
"make" -C /home/francisco/workspace/RIOT2/core
"make" -C /home/francisco/workspace/RIOT2/cpu/native
"make" -C /home/francisco/workspace/RIOT2/cpu/native/periph
"make" -C /home/francisco/workspace/RIOT2/cpu/native/stdio_native
"make" -C /home/francisco/workspace/RIOT2/drivers
"make" -C /home/francisco/workspace/RIOT2/drivers/periph_common
"make" -C /home/francisco/workspace/RIOT2/drivers/rtt_rtc
"make" -C /home/francisco/workspace/RIOT2/sys
"make" -C /home/francisco/workspace/RIOT2/sys/embunit
"make" -C /home/francisco/workspace/RIOT2/sys/test_utils/interactive_sync
"make" -C /home/francisco/workspace/RIOT2/sys/ztimer
"make" -C /home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/rtt_rtc/rtt_rtc.o: in function `rtc_set_time':
/home/francisco/workspace/RIOT2/drivers/rtt_rtc/rtt_rtc.c:126: undefined reference to `rtc_tm_normalize'
/usr/bin/ld: /home/francisco/workspace/RIOT2/drivers/rtt_rtc/rtt_rtc.c:132: undefined reference to `rtc_mktime'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/rtt_rtc/rtt_rtc.o: in function `rtc_get_time':
/home/francisco/workspace/RIOT2/drivers/rtt_rtc/rtt_rtc.c:166: undefined reference to `rtc_localtime'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/rtt_rtc/rtt_rtc.o: in function `rtc_set_alarm':
/home/francisco/workspace/RIOT2/drivers/rtt_rtc/rtt_rtc.c:185: undefined reference to `rtc_mktime'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/tests-rtt_rtc/tests-rtt_rtc.o: in function `test_set_alarm_set_time':
/home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc/tests-rtt_rtc.c:180: undefined reference to `rtc_tm_compare'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc/tests-rtt_rtc.c:187: undefined reference to `rtc_tm_compare'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc/tests-rtt_rtc.c:200: undefined reference to `rtc_tm_compare'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/tests-rtt_rtc/tests-rtt_rtc.o: in function `_alarm_cb':
/home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc/tests-rtt_rtc.c:75: undefined reference to `rtc_tm_compare'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/tests-rtt_rtc/tests-rtt_rtc.o: in function `test_set_alarm_short':
/home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc/tests-rtt_rtc.c:141: undefined reference to `rtc_tm_compare'
/usr/bin/ld: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/tests-rtt_rtc/tests-rtt_rtc.o:/home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc/tests-rtt_rtc.c:148: more undefined references to `rtc_tm_compare' follow
collect2: error: ld returned 1 exit status
make: *** [/home/francisco/workspace/RIOT2/tests/unittests/../../Makefile.include:694: /home/francisco/workspace/RIOT2/tests/unittests/bin/native/tests_unittests.elf] Error 1

pr

make -C tests/unittests/ tests-rtt_rtc
Building application "tests_unittests" for "native" with MCU "native".

"make" -C /home/francisco/workspace/RIOT2/boards/native
"make" -C /home/francisco/workspace/RIOT2/boards/native/drivers
"make" -C /home/francisco/workspace/RIOT2/core
"make" -C /home/francisco/workspace/RIOT2/cpu/native
"make" -C /home/francisco/workspace/RIOT2/cpu/native/periph
"make" -C /home/francisco/workspace/RIOT2/cpu/native/stdio_native
"make" -C /home/francisco/workspace/RIOT2/drivers
"make" -C /home/francisco/workspace/RIOT2/drivers/periph_common
"make" -C /home/francisco/workspace/RIOT2/drivers/rtt_rtc
"make" -C /home/francisco/workspace/RIOT2/sys
"make" -C /home/francisco/workspace/RIOT2/sys/embunit
"make" -C /home/francisco/workspace/RIOT2/sys/rtc_utils
"make" -C /home/francisco/workspace/RIOT2/sys/test_utils/interactive_sync
"make" -C /home/francisco/workspace/RIOT2/sys/ztimer
"make" -C /home/francisco/workspace/RIOT2/tests/unittests/tests-rtt_rtc
   text	   data	    bss	    dec	    hex	filename
  38511	    684	  51960	  91155	  16413	/home/francisco/workspace/RIOT2/tests/unittests/bin/native/tests_unittests.elf

@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 18, 2022
@fjmolinas fjmolinas requested review from aabadie and removed request for cgundogan, jia200x and leandrolanzieri January 18, 2022 12:49
@github-actions github-actions bot added Area: build system Area: Build system Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: sys Area: System labels Jan 18, 2022
@fjmolinas fjmolinas added the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Jan 18, 2022
sys/Makefile.dep Outdated
@@ -853,4 +853,8 @@ ifneq (,$(filter fido2_ctap,$(USEMODULE)))
USEMODULE += fido2
endif

ifneq (,$(filter rtt_rtc,$(USEMODULE)))
USEMODULE += rtc_utils
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be added inside drivers/rtt_rtc/Makefile.dep instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah not sure why added it there

@@ -2,3 +2,8 @@
ifeq (,$(UNIT_TESTS))
FEATURES_REQUIRED += periph_rtt
endif

ifneq (,$(filter rtt_rtc,$(USEMODULE)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to filter on whether rtt_rtc is used, this is already done at that level.

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@fjmolinas
Copy link
Contributor Author

Backport provided in #17532

@OlegHahm OlegHahm added this to the Release 2022.04 milestone Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants