Skip to content

Simplify ICU package resolution not to require PkgConfig and to be more user configurable. #6461

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

Merged
merged 1 commit into from
Jan 11, 2017

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Dec 22, 2016

If you don't have PkgConfig, you'll need to pass the following to CMake:

 -DICU_UC_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
 -DICU_UC_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
 -DICU_I18N_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
 -DICU_I18N_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
 -DICU_UC_LIB_NAME="icuuc"^
 -DICU_I18N_LIB_NAME="icuin"

I moved the find_package logic to CMakeLists.txt. This is because I get linker errors for no such ICU functions when linking on Windows, because a library needs ICU, but ICU has not been resolved yet until stdlib/public/core/CMakeLists.txt

Extracted from #5904

# Find required dependencies.
#

find_package(ICU REQUIRED COMPONENTS uc i18n)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, this seems a bit odd, since Darwin doesn't need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, my bad - I've changed the conditions to match the old ones

@compnerd
Copy link
Member

@swift-ci please test

@compnerd
Copy link
Member

CC: @llvm-beanz

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 1ea9850a7178319e76397eb37cdc9b0c179cf5b3
Test requested by - @compnerd

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 1ea9850a7178319e76397eb37cdc9b0c179cf5b3
Test requested by - @compnerd

@@ -795,6 +795,13 @@ message(STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEA
message(STATUS "")

#
# Find required dependencies.
#
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AMD "${SWIFT_PATH_TO_LIBICU_BUILD}" STREQUAL "")
Copy link
Member

Choose a reason for hiding this comment

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

AMD -> AND?

Copy link
Contributor Author

@hughbe hughbe Dec 23, 2016

Choose a reason for hiding this comment

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

Yeah, I realised this as I was doing my local build - derp

Thanks, though!

@compnerd
Copy link
Member

@swift-ci please test

…re user configurable.

If you don't have PkgConfig, you'll need to pass the following to CMake:
```
 -DICU_UC_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
 -DICU_UC_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
 -DICU_I18N_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
 -DICU_I18N_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
 -DICU_UC_LIB_NAME="icuuc"^
 -DICU_I18N_LIB_NAME="icuin"
```

icu
@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor

@compnerd @erg Does this look good to merge?

@slavapestov slavapestov self-assigned this Jan 11, 2017
@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - c66b72c
Test requested by - @slavapestov

@hughbe
Copy link
Contributor Author

hughbe commented Jan 11, 2017

@slavapestov could you retrigger Swift Test OSX Platform, seems like it failed any tests failing!

@CodaFi
Copy link
Contributor

CodaFi commented Jan 11, 2017

@swift-ci please test OS X platform

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - c66b72c
Test requested by - @CodaFi

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I think that this isn't any worse than the status quo. The changes to the FindICUPackage are an improvement. I'm not sure that I see a good way to handle cross compiling on Darwin in the current state. But since overall its about the same...

# Find required dependencies.
#
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND "${SWIFT_PATH_TO_LIBICU_BUILD}" STREQUAL "")
find_package(ICU REQUIRED COMPONENTS uc i18n)
Copy link
Member

Choose a reason for hiding this comment

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

Technically, this won't work with a Darwin + cross compile scenario.

@hughbe
Copy link
Contributor Author

hughbe commented Jan 11, 2017

Hmm, im no expert at the cross-compilation stuff. I'm fairly sure the FreeBSD port that got merged yesterday solved a similar case.
Either we could merge this in then use the technique the FreeBSD port did in a future PR that's dedicated to making cross compilation work?

@hughbe
Copy link
Contributor Author

hughbe commented Jan 11, 2017

Also, not sure if I'm breaking the OSX tests or they just keep failing - it says 0 failures but something seems to be going wrong?

@CodaFi
Copy link
Contributor

CodaFi commented Jan 11, 2017

I think @aschwaighofer reverted the change that caused this (it's failing in some Playground Logger tests)

@swift-ci please test OS X platform.

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - c66b72c
Test requested by - @CodaFi

@slavapestov
Copy link
Contributor

@CodaFi Unfortunately reverting that change did not fix the playground test failure, it looks like it was unrelated. The test has been disabled in master so I'm kicking off another PR test run.

@slavapestov
Copy link
Contributor

Actually, the smoke test passed so we can just merge.

@slavapestov slavapestov merged commit 75b4be6 into swiftlang:master Jan 11, 2017
@hughbe hughbe deleted the icu-windows branch January 20, 2017 10:21
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.

6 participants