forked from 3MFConsortium/lib3mf
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix macOS build failure: Add unistd.h include to zlib's gzguts.h #1
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
Draft
Copilot
wants to merge
28
commits into
3djan/FixResourceOrder
Choose a base branch
from
copilot/fix-lseek-undeclared-error
base: 3djan/FixResourceOrder
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Fix macOS build failure: Add unistd.h include to zlib's gzguts.h #1
Copilot
wants to merge
28
commits into
3djan/FixResourceOrder
from
copilot/fix-lseek-undeclared-error
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Release/2.3.1 into master
* 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]>
…ter_with_2.4.1 Merge 2.4.1 into master
…tforms Co-authored-by: 3dJan <[email protected]>
Copilot
AI
changed the title
[WIP] Fix lseek undeclared error in gzlib.c for macOS
Fix macOS build failure: Add unistd.h include to zlib's gzguts.h
Oct 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The build on macOS was failing with an error that
lseekis undeclared inLibraries/zlib/Source/gzlib.c, which is part of the vendored zlib dependency.The issue occurs because
gzlib.cuses theLSEEKmacro which expands tolseekon non-Windows platforms:However, the
lseekfunction is declared in<unistd.h>on Unix-like systems (including macOS), and this header was not being included bygzguts.h.Solution
Added a conditional include of
<unistd.h>toLibraries/zlib/Include/gzguts.hfor non-Windows platforms:This ensures:
unistd.his included, providing declarations forlseek,lseek64, and other POSIX functions<io.h>include continues to provide the Windows-specific_lseeki64functionTesting
gzlib.cwith the fix appliedunistd.hon Windows (where it doesn't exist)This is a minimal, surgical fix that resolves the macOS build failure without affecting other platforms.
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.