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

Build fail on Windows #15

Open
miku1958 opened this issue Jul 16, 2023 · 4 comments
Open

Build fail on Windows #15

miku1958 opened this issue Jul 16, 2023 · 4 comments
Assignees

Comments

@miku1958
Copy link

miku1958 commented Jul 16, 2023

I try to use swift-foundtion in my package on Windows, and it give me these errors:

C:\script\.build\checkouts\swift-foundation-icu\icuSources\common\putil.cpp:650:12: error: use of undeclared identifier 'timezone'; did you mean '__timezone'?
    return U_TIMEZONE;
           ^~~~~~~~~~
           __timezone
<command line>:8:20: note: expanded from macro 'U_TIMEZONE'
#define U_TIMEZONE timezone
                   ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\time.h:78:24: note: '__timezone' declared here
_ACRTIMP long* __cdecl __timezone(void);
                       ^
C:\script\.build\checkouts\swift-foundation-icu\icuSources\common\putil.cpp:650:12: error: cannot initialize return object of type 'int32_t' (aka 'int') with an lvalue of type 'long *() __attribute__((cdecl))'
    return U_TIMEZONE;
           ^~~~~~~~~~
<command line>:8:20: note: expanded from macro 'U_TIMEZONE'
#define U_TIMEZONE timezone
                   ^~~~~~~~
C:\script\.build\checkouts\swift-foundation-icu\icuSources\common\putil.cpp:1557:15: error: use of undeclared identifier 'tzdirbuf'
        dir = tzdirbuf;
              ^
3 errors generated.
[413/478] Compiling ICUCommon putil.cpp

My envrioments:
OS: Windows 10 19045.3208
Windows sdk: Windows 10.0.19041.0/10.0.20348.0
Complier: MSVC v143 vs2022
VSCode version: 1.80.1
CodeLLDB version: v1.9.2
Compiler: swift-clang
Debuggee: x86_64-windows-msvc
compnerd.org Swift version: 5.8.1 (swift-5.8.1-RELEASE)

@compnerd
Copy link
Member

This is a regression due to the 72.1 upgrade. I've filed swiftlang/swift#70029 to track enabling CI for Windows. I don't see how to fix this. The changes have hardcoded a dependency on oslog. It is unclear to me how this builds on Linux.

@itingliu
Copy link

Thanks. I think @iCharlesHu was looking into similar failures on Linux

compnerd added a commit to compnerd/swift-foundation that referenced this issue Mar 29, 2024
This was obscuring the current foundation blocker for Windows: ICU. The
last update to ICU broke the Windows build and there does not seem to be
a clear repair for that. See swiftlang/swift-foundation-icu#15 for more
details on the ICU failure. In the meantime, repair the `environ`
handling for Windows. `unistd.h` is the Unix standard header which must
be available when `__unix__` is defined. Add an explicit check for that
to avoid including the header on other platforms.
parkera pushed a commit to swiftlang/swift-foundation that referenced this issue Mar 29, 2024
This was obscuring the current foundation blocker for Windows: ICU. The
last update to ICU broke the Windows build and there does not seem to be
a clear repair for that. See swiftlang/swift-foundation-icu#15 for more
details on the ICU failure. In the meantime, repair the `environ`
handling for Windows. `unistd.h` is the Unix standard header which must
be available when `__unix__` is defined. Add an explicit check for that
to avoid including the header on other platforms.
@compnerd
Copy link
Member

compnerd commented Apr 1, 2024

@parkera, @iCharlesHu, @itingliu - any chance of getting a release with the changes to allow a bump in apple/swift-foundation? That should help get the Windows CI on track.

@iCharlesHu
Copy link
Contributor

@compnerd we tagged 0.0.6: https://github.com/apple/swift-foundation-icu/releases/tag/0.0.6

swift-foundation has also been updated.

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

No branches or pull requests

5 participants