-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[R-package] Suppress 'warning: unknown pragma' for CRAN package #3433
Comments
I'll take this one. I don't have a Mac like the example, but I do have Linux w/ |
sure, thanks for contributing! I'll assign it to you. I agree, this is probably a |
I forgot to include a reference to my fork with the changes mentioned above: https://github.com/cctechwiz-forks/LightGBM/tree/suppress-warning-unknown-pragma-cran I can make a PR if that is easier, I just didn't want to go forward with that if you'd rather have someone else test this. |
thanks @cctechwiz ! Yes, we should also remove these warning-suppression pragmas from Please open a PR. We'll be able to see the results from Mac builds in CI there. Please check the box on it that says "allow updates by maintainers", and I'll be able to push to it as well. |
Sounds good. |
I did not see a checkbox for "allow updates by maintainers" while making this PR. I've seen that checkbox before, so maybe I just missed it? Are there certain criteria that you are aware of for allowing maintainers to update? |
It looks like this, whenever you click "Create pull request" (see the bottom left corner of the image below)
That "allow maintainers to update" is just a thing that would allow me to push changes directly to your branch in your fork, but only while it is in an open pull request against the upstream project. So it's a much tighter set of permissions than you adding me as a contributor on Not a problem though, it looks like maybe it defaults to true on GitHub, and I don't know if we'll even end up needing it. |
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Description of the problem
As of the changes in #3160 , builds of the CRAN version of the R package with
gcc
now raise "unknown pragma" warnings.CRAN does not allow the use of
-Wunknown-pragmas
to suppress such warnings, so we remove them withsed
when building the R package.The "bug" here is that LightGBM's CI did not catch this. That should also be fixed.
How to fix this
Add
pragma: warning
to the set of checks atLightGBM/build-cran-package.sh
Lines 53 to 65 in 5b0ab05
Add some code to the CI script for Mac/Linux that tests for the presence of this warning and fails if it finds it. Similar to
LightGBM/.ci/test_r_package.sh
Lines 206 to 216 in 5b0ab05
How fixing this improves
{lightgbm}
This warning does not affect the correctness of an installation, but showing it in logs may waste users' time by leading them to believe that something is wrong with their installation.
Environment info
LightGBM version or commit hash: latest
master
(5b0ab05)Error message and / or logs
Reproducible example(s)
On a Mac, using
gcc
:sh build-cran-package.sh R CMD INSTALL lightgbm_*.tar.gz
The text was updated successfully, but these errors were encountered: