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

ci: go back to stricter checks #1012

Merged
merged 13 commits into from
Jan 16, 2024
Merged

ci: go back to stricter checks #1012

merged 13 commits into from
Jan 16, 2024

Conversation

maelle
Copy link
Contributor

@maelle maelle commented Dec 18, 2023

Fix #1006

Now I understand why everything was green on CI!

@maelle maelle requested a review from krlmlr December 18, 2023 11:15
Copy link
Contributor

aviator-app bot commented Dec 18, 2023

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.

Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@krlmlr
Copy link
Contributor

krlmlr commented Dec 18, 2023

What's there for me to review? Should we fix first?

@maelle
Copy link
Contributor Author

maelle commented Dec 18, 2023

I think it'd make sense to merge then rebase all PRs that work towards getting the build green again?

@aviator-app aviator-app bot force-pushed the maelle-patch-1 branch 2 times, most recently from 4fa994a to 3a734ed Compare December 21, 2023 13:47
@krlmlr krlmlr added this to the upgrade milestone Dec 29, 2023
@aviator-app aviator-app bot added the blocked label Jan 11, 2024
Copy link
Contributor

aviator-app bot commented Jan 11, 2024

This pull request failed to merge: some CI status(es) failed. Remove the blocked label to re-queue.

Failed CI(s): Check ubuntu-20.04 (devel), Check ubuntu-20.04 (oldrel-2)

@krlmlr krlmlr force-pushed the maelle-patch-1 branch 3 times, most recently from 82fc1b3 to 0dfb8d1 Compare January 11, 2024 19:44
@krlmlr krlmlr removed the blocked label Jan 11, 2024
@aviator-app aviator-app bot force-pushed the maelle-patch-1 branch 2 times, most recently from 4d23cb7 to e3e43ce Compare January 11, 2024 21:18
@aviator-app aviator-app bot added the blocked label Jan 11, 2024
Copy link
Contributor

aviator-app bot commented Jan 11, 2024

This pull request failed to merge: some CI status(es) failed. Remove the blocked label to re-queue.

Failed CI(s): Check ubuntu-20.04 (oldrel-2)

@krlmlr krlmlr removed the blocked label Jan 11, 2024
@aviator-app aviator-app bot added the blocked label Jan 11, 2024
Copy link
Contributor

aviator-app bot commented Jan 11, 2024

This pull request failed to merge: some CI status(es) failed. Remove the blocked label to re-queue.

Failed CI(s): Check windows-latest (release), Check ubuntu-20.04 (oldrel-3), Check ubuntu-20.04 (release), Check macOS-latest (release), Check ubuntu-20.04 (oldrel-1), Check ubuntu-20.04 (devel), Check ubuntu-20.04 (oldrel-2)

@krlmlr krlmlr removed the blocked label Jan 11, 2024
Copy link
Contributor

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Thanks! Should be good now.

@aviator-app aviator-app bot added the blocked label Jan 11, 2024
Copy link
Contributor

aviator-app bot commented Jan 11, 2024

This pull request failed to merge: some CI status(es) failed. Remove the blocked label to re-queue.

Failed CI(s): Check macOS-latest (release)

@krlmlr
Copy link
Contributor

krlmlr commented Jan 11, 2024

@Antonov548: We now have compilation warnings on a few platforms only, e.g., on macOS:

  rinterface.c:6349:84: warning: variable 'c_outfile' is uninitialized when used here [-Wuninitialized]
  rinterface.c:8381:58: warning: variable 'c_instream' is uninitialized when used here [-Wuninitialized]
  rinterface.c:8441:59: warning: variable 'c_outstream' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10886:33: warning: variable 'c_a' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10886:38: warning: variable 'c_b' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10886:43: warning: variable 'c_eps' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10910:31: warning: variable 'c_a' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10910:36: warning: variable 'c_b' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10910:41: warning: variable 'c_eps' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10917:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11610:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11632:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11646:28: warning: variable 'c_igraph_errno' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11653:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11761:31: warning: variable 'version_string' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11762:31: warning: variable 'major' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11763:31: warning: variable 'minor' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11764:31: warning: variable 'subminor' is uninitialized when used here [-Wuninitialized]

Is this dead code? We can remove in rinterface.c and reconcile later, we have drift anyway.

There are more failures on Windows.

Can you please push to this branch?

@Antonov548
Copy link
Contributor

@Antonov548: We now have compilation warnings on a few platforms only, e.g., on macOS:

  rinterface.c:6349:84: warning: variable 'c_outfile' is uninitialized when used here [-Wuninitialized]
  rinterface.c:8381:58: warning: variable 'c_instream' is uninitialized when used here [-Wuninitialized]
  rinterface.c:8441:59: warning: variable 'c_outstream' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10886:33: warning: variable 'c_a' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10886:38: warning: variable 'c_b' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10886:43: warning: variable 'c_eps' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10910:31: warning: variable 'c_a' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10910:36: warning: variable 'c_b' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10910:41: warning: variable 'c_eps' is uninitialized when used here [-Wuninitialized]
  rinterface.c:10917:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11610:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11632:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11646:28: warning: variable 'c_igraph_errno' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11653:10: warning: variable 'r_result' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11761:31: warning: variable 'version_string' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11762:31: warning: variable 'major' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11763:31: warning: variable 'minor' is uninitialized when used here [-Wuninitialized]
  rinterface.c:11764:31: warning: variable 'subminor' is uninitialized when used here [-Wuninitialized]

Is this dead code? We can remove in rinterface.c and reconcile later, we have drift anyway.

There are more failures on Windows.

Can you please push to this branch?

Would we like to keep synchronized generated code with functions.yml?

@krlmlr
Copy link
Contributor

krlmlr commented Jan 12, 2024 via email

@szhorvat
Copy link
Member

Beware that most of these "uninitialized when used here" warning indicate actual bugs! If the affected function is used, that's a problem we need to fix now. Hopefully none of them are used?

@krlmlr
Copy link
Contributor

krlmlr commented Jan 13, 2024

Now there's only Windows and macOS failing, for good reason, I think.

@Antonov548
Copy link
Contributor

Now there's only Windows and macOS failing, for good reason, I think.

Yes, checking

Comment on lines 76 to 77
igraph_errorf("Expecting a scalar integer but received a vector of length %zu.",
__FILE__, __LINE__, IGRAPH_EINVAL, (size_t) Rf_xlength(value));
igraph_errorf("Expecting a scalar integer but received a vector of length %d.",
__FILE__, __LINE__, IGRAPH_EINVAL, Rf_xlength(value));
Copy link
Member

@szhorvat szhorvat Jan 13, 2024

Choose a reason for hiding this comment

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

@Antonov548 Why did you make this change? %d is only for int, and the return type of Rf_xlength() is system-dependent (may not be compatible with int!), but always fits in size_t. I chose %zu and a cast to size_t on purpose.

Copy link
Contributor

Choose a reason for hiding this comment

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

zu is not compatible with some versions of compiler. Maybe good solution will be to use lu?

Copy link
Member

Choose a reason for hiding this comment

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

What specific compiler is it not compatible with?

Copy link
Member

Choose a reason for hiding this comment

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

zu is standard in both C99 and C++11. Could it be that the proper standard is not set? I'd be very surprised to see any still-relevant compiler not support it.

Copy link
Member

@szhorvat szhorvat Jan 13, 2024

Choose a reason for hiding this comment

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

According to tests wit Godbolt, works with Clang 3.4 and GCC 4.8. igraph itself wouldn't support anything earlier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@szhorvat szhorvat Jan 15, 2024

Choose a reason for hiding this comment

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

What that SO answer is saying is that it does actually work but MinGW's GCC incorrectly warns about it. That is very disappointing.

You should be aware that on Windows the long type is 32-bit wide. Using long here is actually wrong. Can't we just use -Wno-format specifically on Windows?

Copy link
Member

@szhorvat szhorvat Jan 15, 2024

Choose a reason for hiding this comment

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

@Antonov548 Can you try to use PRIuPTR instead? Here is an example:

https://godbolt.org/z/jcWrvWo9b

PRIuPTR should be defined to a string that is the appropriate format specifier for uintptr_t (which should fit size_t). I'm curious to see what this is with MinGW.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems uintptr_t works well. Let's see in ci.
I guess it's better to leave all warning enabled.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it's better to leave warnings enabled on all platforms.

Someone just told me about the __USE_MINGW_ANSI_STDIO macro. Defining this to either 1 or 0 may help (unclear).

But if PRIuPTR works, let's just stick to that, as it is standard.

@maelle
Copy link
Contributor Author

maelle commented Jan 15, 2024

@Antonov548 thanks! What are the windows and sanitizer failures?

@maelle
Copy link
Contributor Author

maelle commented Jan 15, 2024

I see #1110

@Antonov548
Copy link
Contributor

@Antonov548 thanks! What are the windows and sanitizer failures?

On windows there is warning in vendor folder, precise in core igraph. Not sure why the are not ignored. I though that vendor folder is ignored.

@maelle
Copy link
Contributor Author

maelle commented Jan 15, 2024

True, ^vendor$ is listed in .Rbuildignore so they should be ignored 🤔

@szhorvat
Copy link
Member

@Antonov548 As a general rule, never use long in igraph code. long has an unpredictable width, and will cause trouble on Windows (where it is 32-bit).

@krlmlr krlmlr removed the blocked label Jan 16, 2024
@aviator-app aviator-app bot merged commit 4b5be17 into main Jan 16, 2024
14 checks passed
@aviator-app aviator-app bot deleted the maelle-patch-1 branch January 16, 2024 08:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning from R CMD check
4 participants