Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dsp-testing/codeql-swift-artifacts
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: swift-5.9.2-RELEASE.281
Choose a base ref
...
head repository: dsp-testing/codeql-swift-artifacts
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 11 commits
  • 4 files changed
  • 3 contributors

Commits on Feb 13, 2024

  1. Copy the full SHA
    6b1015b View commit details

Commits on Feb 19, 2024

  1. Merge pull request #21 from dsp-testing/redsun82/remove-toolchain

    Remove unneeded toolchain options
    redsun82 authored Feb 19, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a331351 View commit details
  2. Remove unneeded sdk

    redsun82 committed Feb 19, 2024
    Copy the full SHA
    ac5e8bd View commit details
  3. Merge pull request #22 from dsp-testing/redsun82/remove-toolchain

    Remove unneeded sdk
    redsun82 authored Feb 19, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    099b557 View commit details

Commits on Mar 19, 2024

  1. Swift: this patch was upstreamed

    Alex Denisov committed Mar 19, 2024
    Copy the full SHA
    4f48027 View commit details
  2. Swift: remove unsupported argument

    Alex Denisov committed Mar 19, 2024
    Copy the full SHA
    ca25dc3 View commit details
  3. Fix CMake setup

    Alex Denisov committed Mar 19, 2024
    Copy the full SHA
    b3495a5 View commit details

Commits on Mar 21, 2024

  1. Merge pull request #23 from dsp-testing/alexdenisov/swift-5.10

    Swift 5.10
    AlexDenisov authored Mar 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    efacbc9 View commit details

Commits on Oct 7, 2024

  1. Allow -pthread in link.txt

    Paolo Tranquilli committed Oct 7, 2024
    Copy the full SHA
    602dde5 View commit details
  2. Use hosttools bootstrapping for mac as well

    Paolo Tranquilli committed Oct 7, 2024
    Copy the full SHA
    f5788f7 View commit details

Commits on Oct 14, 2024

  1. Revert using hosttools for macOS, add other options

    Paolo Tranquilli committed Oct 14, 2024
    Copy the full SHA
    12a2975 View commit details
Showing with 16 additions and 41 deletions.
  1. +4 −0 CMakeLists.txt
  2. +0 −15 patches/swift/expose-swift-version.patch
  3. +2 −21 pkg_swift_llvm.py
  4. +10 −5 swift-build-presets
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@ find_package(Clang REQUIRED CONFIG)
find_package(Swift REQUIRED CONFIG)
find_package(SwiftSyntax REQUIRED CONFIG)

set(THREADS_PREFER_PTHREAD_FLAG YES)
include(FindThreads)

message("Using LLVM_CONFIG: ${Swift_CONFIG}")
message("Using Clang_CONFIG: ${LLVM_CONFIG}")
message("Using Swift_CONFIG: ${Clang_CONFIG}")
@@ -17,6 +20,7 @@ set (CODEQL_SWIFT_VERSION_MAJOR ${SWIFT_VERSION_MAJOR})
set (CODEQL_SWIFT_VERSION_MINOR ${SWIFT_VERSION_MINOR})
set (CODEQL_SWIFT_VERSION_PATCH ${SWIFT_VERSION_PATCH})

# TODO: these are now upstreamed
configure_file(${CMAKE_SOURCE_DIR}/CodeQLSwiftVersion.h.in
${SWIFT_BINARY_DIR}/include/swift/CodeQLSwiftVersion.h)

15 changes: 0 additions & 15 deletions patches/swift/expose-swift-version.patch

This file was deleted.

23 changes: 2 additions & 21 deletions pkg_swift_llvm.py
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ def get_libs(configured):
ret.static.append((configured / l).absolute())
elif l.endswith(".so") or l.endswith(".tbd") or l.endswith(".dylib"):
ret.shared.append((configured / l).absolute())
elif l.startswith(("-L", "-Wl", "-l")):
elif l.startswith(("-L", "-Wl", "-l")) or l == "-pthread":
ret.linker_flags.append(l)
else:
raise ValueError(f"cannot understand link.txt: " + l)
@@ -119,23 +119,6 @@ def copy_includes(src, tgt):
tgtfile.parent.mkdir(parents=True, exist_ok=True)
shutil.copy(srcfile, tgtfile)


def export_sdk(tgt, swift_source_tree, swift_build_tree):
print("assembling sdk")
srcdir = swift_build_tree / "lib" / "swift"
tgtdir = tgt / "usr" / "lib" / "swift"
if get_platform() == "linux":
srcdir /= "linux"
tgtdir /= "linux/x86_64"
else:
srcdir /= "macosx"
for mod in srcdir.glob("*.swiftmodule"):
shutil.copytree(mod, tgtdir / mod.name)
shutil.copytree(swift_source_tree / "stdlib" / "public" / "SwiftShims" / "swift" / "shims",
tgt / "usr" / "lib" / "swift" / "shims",
ignore=shutil.ignore_patterns('CMakeLists.txt'))


def export_stdlibs(exported_dir, swift_build_tree):
ext = 'dylib'
platform = 'linux' if get_platform() == 'linux' else 'macosx'
@@ -190,16 +173,14 @@ def main(opts):
os.mkdir(tmp)
llvm_build_tree = next(opts.build_tree.glob("llvm-*"))
swift_build_tree = next(opts.build_tree.glob("swift-*"))
earlyswiftsyntax_build_tree = next(opts.build_tree.glob("earlyswiftsyntax-*"))
configured = configure_dummy_project(tmp, prefixes=[llvm_build_tree, swift_build_tree,
earlyswiftsyntax_build_tree / "cmake" / "modules"])
swift_build_tree / 'cmake' / 'modules'])
libs = get_libs(configured)

exported = tmp / "exported"
exported.mkdir()
export_libs(exported, libs, swift_build_tree)
export_headers(exported, opts.swift_source_tree, llvm_build_tree, swift_build_tree)
export_sdk(exported / "sdk", opts.swift_source_tree, swift_build_tree)

zip_dir(exported, opts.output)

15 changes: 10 additions & 5 deletions swift-build-presets
Original file line number Diff line number Diff line change
@@ -11,10 +11,13 @@ skip-test-sourcekit-lsp
skip-test-playgroundsupport
skip-test-skstresstester
skip-test-swiftformat
skip-test-swiftevolve
skip-test-toolchain-benchmarks
skip-test-swift-inspect
skip-test-swift
skip-build-xros
skip-test-xros
skip-test-xros-host
skip-test-xros-simulator

skip-build-clang-tools-extra
skip-build-benchmarks
@@ -26,8 +29,14 @@ no-assertions
reconfigure

install-swift
install-swiftsyntax
install-swift-testing
install-swift-testing-macros
install-prefix=/codeql-toolchain

swift-testing
swift-testing-macros

[preset: codeql-release]
mixin-preset=codeql-baseline
release
@@ -39,10 +48,6 @@ bootstrapping=hosttools

[preset: codeql-macOS]
mixin-preset=codeql-release
ios
tvos
watchos
maccatalyst
bootstrapping=bootstrapping

[preset: codeql-debug]