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

Source/Common/Platform: Explicitly include <cstdint> #387

Merged
merged 5 commits into from
Sep 1, 2024

Conversation

csfore
Copy link

@csfore csfore commented Aug 9, 2024

GCC 15 will no longer include <cstdint> by default, resulting in build failures in projects that do not explicitly include it.

Errors:

Source/Common/Platform/NMR_EncryptionHeader.cpp:
In member function ‘size_t NMR::CEncryptionHeader::readFrom(NMR::PImportStream)’: Source/Common/Platform/NMR_EncryptionHeader.cpp:35:52: error: ‘uint64_t’ was not declared in this scope
   35 |                 if (header.Header.Length.length < (uint64_t) headerSize)
      |                                                    ^~~~~~~~
Source/Common/Platform/NMR_EncryptionHeader.cpp:12:1:
note: ‘uint64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   11 | #include <cstring>
  +++ |+#include <cstdint>
   12 |
Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp: In member function ‘virtual const NMR::nfByte* NMR::CImportStream_Unique_Memory::getAt(NMR::nfUint64)’: Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:128:35: error: ‘uint64_t’ was not declared in this scope
  128 |                 if (nPosition >= (uint64_t) m_Buffer.size())
      |                                   ^~~~~~~~
Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:37:1:
note: ‘uint64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   36 | #include "Common/NMR_Exception_Windows.h"
  +++ |+#include <cstdint>
   37 |

Test results:

Test project lib3mf/build
    Start 1: Test_CPP_Bindings
1/1 Test #1: Test_CPP_Bindings ................   Passed    0.39 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.39 sec

Gentoo bug: https://bugs.gentoo.org/937423
See-also: https://gcc.gnu.org/pipermail/gcc-cvs/2024-August/407124.html

martinweismann and others added 3 commits April 2, 2024 17:12
* skipping leading whitespaces

* Update CMakeLists.txt to ignore cmake_osx_architecture in TESTS

Previously libreSSL could not be built on arm64 machines, so there was a flag to build the test only for intel x86_64 machines. 

After updating the libreSSL library, it might not be the case anymore. So removing the CMAKE_OSX_ARCHITECTURE flag.

* First batch of python examples

* Update 3mf copyright based on existing template

* Modify python imports to work with SDK package too (Even if lib3mf is not installed through PyPI, the examples would work as long as the SDK structure is maintained)

* Integration tests (3MFConsortium#367)

* Added CMake and CPack configuration for building and packaging lib3mf across all platforms, including Debian and RPM builds + VCPKG.
* Updated and debugged workflows, .gitignore, and integration tests, ensuring smooth deployment and artifact handling.
* Fixed paths and linking issues across Windows, macOS, and Linux, including handling symlinks and double zipping problems.    
* Enhanced SDK generation and included examples for various build variants, ensuring compatibility and thorough testing.    
* Cleaned up and finalized actions, environment variables, and documentation for consistent and efficient builds and deployments.

* Integration tests (3MFConsortium#367) + CMake Refactoring + CPack based Packaging introduction + CI / CD action improvements

* Added CMake and CPack configuration for building and packaging lib3mf across all platforms, including Debian and RPM builds + VCPKG.
* Updated and debugged workflows, .gitignore, and integration tests, ensuring smooth deployment and artifact handling.
* Fixed paths and linking issues across Windows, macOS, and Linux, including handling symlinks and double zipping problems.
* Enhanced SDK generation and included examples for various build variants, ensuring compatibility and thorough testing.
* Cleaned up and finalized actions, environment variables, and documentation for consistent and efficient builds and deployments.

* Issue-363: changing int to long long for putDoubleFactor

* fixing stringRepResenationsDiffer to use long long putFactor

* Include a additional entry to build.yml to pack source code + submodules (3MFConsortium#372)

* Include an additional artifact that packs the code with submodules

* exclude unnecessary stuff

* avoid recursion

* avoid zip.zip

* Included a new script to automatically update lib3mf version in all the required places

* Include some rudimentary documentation in lib3mf_version_update.py

* updating zlib 1.3.1

* updating zlib 1.3.1 version file

* Update README.md

* Modify integration tests

* Fix some mistakes in integration tests

* Accidentally reverted zlib version. Switching back

* Include total must pass and must fail in all integration test outputs

* There's multiple release artifacts with .zip extension. Some adjustments are required

* Fix the issue in 2 integration test workflows. Only 1 must fail now

* Attempting to fix the last two releases action

* Cleaned a little more. All Integration tests should pass now.

* Introduce some more generics in actions (Integration test suite url is not hard coded anymore)

* Make test suite url fetching local to the test jobs

* Switch to hard coded urls for now. Can switch in the next release

* Weird osx build error fix in .yml and .sh

---------

Co-authored-by: Martin Weismann <[email protected]>
Co-authored-by: Vijai Kumar S <[email protected]>
Co-authored-by: Vijai Kumar S <[email protected]>
GCC 15 will no longer include <cstdint> by default, resulting in build
failures in projects that do not explicitly include it.

Errors:

Source/Common/Platform/NMR_EncryptionHeader.cpp:
In member function ‘size_t NMR::CEncryptionHeader::readFrom(NMR::PImportStream)’:
Source/Common/Platform/NMR_EncryptionHeader.cpp:35:52:
error: ‘uint64_t’ was not declared in this scope
   35 |                 if (header.Header.Length.length < (uint64_t) headerSize)
      |                                                    ^~~~~~~~
Source/Common/Platform/NMR_EncryptionHeader.cpp:12:1:
note: ‘uint64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   11 | #include <cstring>
  +++ |+#include <cstdint>
   12 |

Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:
In member function ‘virtual const NMR::nfByte* NMR::CImportStream_Unique_Memory::getAt(NMR::nfUint64)’:
Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:128:35:
error: ‘uint64_t’ was not declared in this scope
  128 |                 if (nPosition >= (uint64_t) m_Buffer.size())
      |                                   ^~~~~~~~
Source/Common/Platform/NMR_ImportStream_Unique_Memory.cpp:37:1:
note: ‘uint64_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   36 | #include "Common/NMR_Exception_Windows.h"
  +++ |+#include <cstdint>
   37 |

Test results:

Test project lib3mf/build
    Start 1: Test_CPP_Bindings
1/1 Test 3MFConsortium#1: Test_CPP_Bindings ................   Passed    0.39 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.39 sec

Gentoo bug: https://bugs.gentoo.org/937423
See-also: https://gcc.gnu.org/pipermail/gcc-cvs/2024-August/407124.html
Signed-off-by: Christopher Fore <[email protected]>
csfore added a commit to csfore/gentoo that referenced this pull request Aug 9, 2024
- Tests pass
- Patched file is not an installed header

Note: Upstream PR fixes an additional file that does not error on 2.2.0
Upstream: 3MFConsortium/lib3mf#387
Closes: https://bugs.gentoo.org/937423
Signed-off-by: Christopher Fore <[email protected]>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Aug 9, 2024
- Tests pass
- Patched file is not an installed header

Note: Upstream PR fixes an additional file that does not error on 2.2.0
Upstream: 3MFConsortium/lib3mf#387
Closes: https://bugs.gentoo.org/937423
Signed-off-by: Christopher Fore <[email protected]>
Closes: #38030
Signed-off-by: Sam James <[email protected]>
@vijaiaeroastro vijaiaeroastro changed the base branch from master to develop August 12, 2024 15:17
@gangatp
Copy link
Collaborator

gangatp commented Aug 16, 2024

Hi @csfore, Thanks for the PR to fix linux builds. Can you rebase/merge current develop to your branch csfore:include-cstdint and update the branch. Since we have changed the base brach to develop there are so many outdated changes in this PR.

@csfore
Copy link
Author

csfore commented Aug 26, 2024

Sorry for the slow reply! I think I've merged it properly but I'm not entirely sure.

@vijaiaeroastro
Copy link
Collaborator

@csfore Thanks for your contribution.
@gangatp Please don't approve this PR until our next meetup. I see some strange issues in Integration tests.

@vijaiaeroastro vijaiaeroastro self-assigned this Aug 27, 2024
@vijaiaeroastro
Copy link
Collaborator

vijaiaeroastro commented Sep 1, 2024

@gangatp Checked the actions issues. All good. The code coverage upload failure only happens with this job. I am modifying it to avoid failures.

@vijaiaeroastro vijaiaeroastro merged commit 5abad20 into 3MFConsortium:develop Sep 1, 2024
20 checks passed
@vijaiaeroastro
Copy link
Collaborator

@csfore Thanks once again for your contribution. They have been approved and merged now.

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.

4 participants