Skip to content

[Build] Enable building the early Swift Driver on linux with the prebuilt host toolchain #69564

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
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/Driver/Dependencies/only-skip-once.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// XFAIL: OS=linux-gnu, OS=openbsd, OS=windows-msvc, OS=linux-android, OS=linux-androideabi
// XFAIL: OS=openbsd, OS=windows-msvc

// RUN: %empty-directory(%t)
// RUN: cp -r %S/Inputs/only-skip-once/* %t
Expand All @@ -9,7 +9,7 @@
// CHECK-INITIAL: {{(Job finished: {compile: main.o <= main.swift}|Finished Compiling main.swift)}}
// CHECK-INITIAL: {{(Job finished: {compile: file1.o <= file1.swift}|Finished Compiling file1.swift)}}
// CHECK-INITIAL: {{(Job finished: {compile: file2.o <= file2.swift}|Finished Compiling file2.swift)}}
// CHECK-INITIAL: {{(Job finished: {link: main <= main.o file1.o file2.o}|Finished Linking main)}}
// CHECK-INITIAL: {{(Job finished: {link: main <= main.o file1.o file2.o|Finished Linking main)}}
Copy link
Member Author

Choose a reason for hiding this comment

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

This test now passes on linux as part of the early swift driver tests, so I enabled it, but it then failed with the old C++ Driver.

The issue is that these two lines don't expect another autolink file to be added on macOS, but that is needed on linux, which outputs this instead:

Job finished: {link: main <= main.o file1.o file2.o ... 1 more}

Omitting the closing brace here and below should get this test to work on both Mac and linux.


// RUN: touch -t 201401240006 %t/file2.swift
// RUN: cd %t && %target-swiftc_driver -driver-show-job-lifecycle -output-file-map %t/output-file-map.json -incremental main.swift file1.swift file2.swift -j1 2>&1 | %FileCheck -check-prefix=CHECK-REBUILD %s
Expand All @@ -18,5 +18,5 @@
// CHECK-REBUILD-DAG: {{(Job finished: {compile: file2.o <= file2.swift}|Finished Compiling file2.swift)}}
// CHECK-REBUILD-DAG: {{(Job skipped: {compile: main.o <= main.swift}|Skipped Compiling main.swift)}}
// CHECK-REBUILD-DAG: {{(Job skipped: {compile: file1.o <= file1.swift}|Skipped Compiling file1.swift)}}
// CHECK-REBUILD-DAG: {{(Job finished: {link: main <= main.o file1.o file2.o}|Finished Linking main)}}
// CHECK-REBUILD-DAG: {{(Job finished: {link: main <= main.o file1.o file2.o|Finished Linking main)}}
// CHECK-REBUILD-NOT: {{(Job skipped:|Skipped)}}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# ----------------------------------------------------------------------------

import os
import sys

from . import product
from .. import shell
Expand Down Expand Up @@ -42,11 +41,6 @@ def is_before_build_script_impl_product(cls):
return True

def should_build(self, host_target):
# Temporarily disable for non-darwin since this build never works
# outside of that case currently.
if sys.platform != 'darwin':
return False

if self.is_cross_compile_target(host_target):
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RUN: mkdir -p %t
# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --verbose-build --dry-run --infer --swiftpm --cmake %cmake 2>&1 | %FileCheck %s

# REQUIRES: standalone_build, OS=macosx
# REQUIRES: standalone_build

# Just make sure we compute the build graph/emit output.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# REQUIRES: standalone_build, OS=macosx
# REQUIRES: standalone_build

# RUN: %empty-directory(%t)
# RUN: mkdir -p %t
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# REQUIRES: standalone_build, OS=macosx
# REQUIRES: standalone_build

# RUN: %empty-directory(%t)
# RUN: mkdir -p %t
Expand Down