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

Test for posix lib + newlib (also start to fix issues) #13685

Merged
merged 3 commits into from
Feb 23, 2019

Conversation

galak
Copy link
Collaborator

@galak galak commented Feb 22, 2019

No description provided.

@galak galak requested a review from pfalcon as a code owner February 22, 2019 18:11
@galak galak requested a review from vanti February 22, 2019 18:11
@galak
Copy link
Collaborator Author

galak commented Feb 22, 2019

@vanti I think this might be a cleaner test addition for newlib and posix+lib to get us more coverage. Take a look and see if you agree and we can close out your PR.

@codecov-io
Copy link

codecov-io commented Feb 22, 2019

Codecov Report

Merging #13685 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #13685   +/-   ##
=======================================
  Coverage   52.24%   52.24%           
=======================================
  Files         307      307           
  Lines       45413    45413           
  Branches    10508    10508           
=======================================
  Hits        23726    23726           
  Misses      16898    16898           
  Partials     4789     4789

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5ee803...2944888. Read the comment docs.

include/posix/mqueue.h Outdated Show resolved Hide resolved
@vanti
Copy link
Collaborator

vanti commented Feb 22, 2019

@vanti I think this might be a cleaner test addition for newlib and posix+lib to get us more coverage. Take a look and see if you agree and we can close out your PR.

@galak I am not too familiar with how the testcase.yaml files work, but when I copy your testcase.yaml files into my local repo and rebuild the posix/fs and posix/common tests I do not see the build error from sdk-ng#45. Adding CONFIG_NEWLIB_LIBC=y to posix/fs/prj.conf does the trick though.

Copy link
Contributor

@pfalcon pfalcon left a comment

Choose a reason for hiding this comment

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

Thanks. I won't be surprised if the build now will fail because <sys/types.h> is not included somewhere, but that's the way to resolve such issues.

@pfalcon
Copy link
Contributor

pfalcon commented Feb 22, 2019

Ok, so the typical situation, you make one change, there's a cascade of fallouts: https://app.shippable.com/github/zephyrproject-rtos/zephyr/runs/35304/2/tests .

In #12984 , I ended up banning native_posix, riscv32, xtensa, qemu_x86_64 (i.e. effectively everything but x86 and arm I guess ;-) ), and it still has a hundred of failures on last check (but it has massive changes of course).

Add a build variant of the posix tests with newlib enabled.  Since the
interation of posix is greatly related to the libc we should have these
tests build with and without newlib support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
With newer newlib we get a build error with mqueue.h realted to mode_t.
Let's just let newlib define mode_t and have minimal libc also define
it in sys/types.h.  So we remove the duplicated definition in
posix/unistd.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some older variants of newlib (like what we have on xtensa or riscv in
SDK 0.9.5) define timespec and itimerspec in sys/types.h.  The timespec
can be handled by a check of __timespec_defined.  However itimerspec
doesn't have anything similar so we have to do it by newlib version
info.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
@galak galak merged commit 29dac22 into zephyrproject-rtos:master Feb 23, 2019
@galak galak deleted the posix-newlib branch February 23, 2019 17:42

/* Older newlib's like 2.{0-2}.0 don't define any newlib version defines, only
Copy link
Contributor

Choose a reason for hiding this comment

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

@galak, The proper fix for this would be the same as for mode_t - figure out the proper header belongs to, rely on newlib's existing definition there, and move def from posix/* to minimal/*. (Again, when we repeat that process a hundred of times, we'll find that we just recreated newlib headers in minimal. So, it's still not to late to say "POSIX and minimal don't plat well together, a [decent] libc is part of POSIX", and concentrate only on POSIX+newlib).

@nashif
Copy link
Member

nashif commented Feb 23, 2019

@galak Why was this merged with CI failing? Now everything is failing in CI because of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants