swiftlang / swift-corelibs-xctest

The XCTest Project, A Swift core library for providing unit test support
swift.org
Apache License 2.0
1.15k stars 267 forks source link

[5.10] Guard `parse_version` #489

Closed etcwilde closed 6 months ago

etcwilde commented 6 months ago

The most recent versions of parse_version throw an exception if the version is empty. The version passed in is only set on Darwin (call to mac_ver(), so it's causing test failures on newer versions of Linux since the test suite can't even start.

Now, the only reason for the version parse is because the tests are looking at whether or not concurrency is available on the OS. This is only a limitation if we're working with Darwin. Swift 5.10 on Windows and Linux always have a Swift 5.10 concurrency runtime, so we don't even need to check for a version.

rdar://128502662

https://ci.swift.org/view/Swift%205.10/job/oss-swift-5.10-package-debian-12/9/console

 llvm-lit: /home/build-user/llvm-project/llvm/utils/lit/lit/TestingConfig.py:138: fatal: unable to parse config file '/home/build-user/swift-corelibs-xctest/Tests/Functional/lit.cfg', traceback: Traceback (most recent call last):
  File "/home/build-user/llvm-project/llvm/utils/lit/lit/TestingConfig.py", line 127, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/home/build-user/swift-corelibs-xctest/Tests/Functional/lit.cfg", line 148, in <module>
    macOS_version_is_recent_enough = parse_version(run_vers) >= parse_version('12.0')
                                     ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/version.py", line 266, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: ''
etcwilde commented 6 months ago

@swift-ci please test

etcwilde commented 6 months ago

Likely, once I get to moving those branches onto the newer distro releases.

etcwilde commented 6 months ago

macOS failure:

$ "/Users/ec2-user/jenkins/workspace/swift-corelibs-xctest-PR-macos/branch-release/5.10/swift-corelibs-xctest/Tests/Functional/Observation/Selected/Output/Selected" "Selected.ExecutedTestCase/test_executed"
# command stderr:
dyld[97367]: Symbol not found: _swift_getTypeByMangledNameInContext2
  Referenced from: <487437FE-2357-335F-AD9D-FEA3D59ECD46> /Users/ec2-user/jenkins/workspace/swift-corelibs-xctest-PR-macos/branch-release/5.10/swift-corelibs-xctest/Tests/Functional/Observation/Selected/Output/Selected (built for macOS 14.2 which is newer than running OS)
  Expected in:     <087DADAD-D590-35EA-AC4D-7B0E966804EB> /usr/lib/swift/libswiftCore.dylib

This is the same thing we're seeing with 5.10 and the macOS bot on corelibs-Foundation. https://github.com/apple/swift-corelibs-foundation/pull/4953#issuecomment-2106646787