Skip to content

build: make libxml2 handling explicit and use in tests #21832

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
Mar 23, 2019

Conversation

compnerd
Copy link
Member

Address the TODO in the build and unify the libxml2 handling with
LLVM/clang. Use the information now and propagate this into the lit
configuration so that tests can be made aware of libxml2 status.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

CC: @gottesmm @Rostepher

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2a7f6eaac6c898e7abd4a7107b111b74081f9f04

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2a7f6eaac6c898e7abd4a7107b111b74081f9f04

CMakeLists.txt Outdated
if(LLVM_ENABLE_LIBXML2)
set(LIBXML2_FOUND NO)
find_package(LibXml2)
if(LIBXML2_FOUND)
Copy link
Contributor

Choose a reason for hiding this comment

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

I took a quick look in clang/llvm to understand this a bit better.

This is in clang:

  set (LIBXML2_FOUND 0)
  find_package(LibXml2 2.5.3 QUIET)
  if (LIBXML2_FOUND)
    set(CLANG_HAVE_LIBXML 1)
  endif()

Should we require a version like that as well? Also, maybe this bug is asking to hoist this into a macro in LLVM. (Just trying to understand).

Copy link
Member Author

Choose a reason for hiding this comment

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

The version request only makes sense if there is a dependency on an API that was introduced after the initial release. I don't know if that is the case. I don't see any harm in requesting the minimum version to be the same as what is shipped on macOS just to ensure that we have the same base line of support. The problem is, I don't know what the version on macOS is :-p.

I don't really see there being a benefit to the 2 lines being in LLVM.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I just wasn't sure what the comment was asking for (in terms of the 2 lines).

@jrose-apple do you know the version of libxml we should require here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ping! I want to get this handled as I'm trying to handle the last of the failures on Windows.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, I must have missed this the first time around. We use libxml for doc comment processing, so @nkcsgexi would probably know what our dependencies are.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jrose-apple, yeah, which has some tests which should be conditional on whether we built with libxml2 or not.

@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

@jrose-apple - any thoughts on whether LibXml2 should be required on Linux or make it optional?

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 10f0e3139aac7c6f3b8aab29e0dde28cf002de36

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 10f0e3139aac7c6f3b8aab29e0dde28cf002de36

@jrose-apple
Copy link
Contributor

Again, that's a question for the SourceKit / source tooling folks rather than me.

Address the TODO in the build and unify the libxml2 handling with
LLVM/clang. Use the information now and propagate this into the lit
configuration so that tests can be made aware of libxml2 status.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd
Copy link
Member Author

I'm going to merge this since this is needed for the Windows test suite. This is no worse than the status quo, and we can add the versioning in a follow up. This effectively makes -DLLVM_ENABLE_LIBXML2 a knob the user can use to ensure that libxml2 support is present, otherwise it falls back to the auto-detect as it was previously.

@compnerd compnerd merged commit a985f7b into swiftlang:master Mar 23, 2019
@compnerd compnerd deleted the xml branch March 23, 2019 16:48
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