Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Nov 1, 2019

We don’t need to fetch the dependencies from GitHub if they are already checked out.

To do this, we tell SwiftSyntax that we are building in a build script environment by passing the environment variable SWIFT_BUILD_SCRIPT_ENVIRONMENT. This causes us to link against the dylib instead of the static library.

Linking against dylibs of other packages does not currently work, because SwiftPM is not setting the correct rpath, hence we need to manually specify these rpaths as @loader_path/../../../

CI doesn't need to fetch the master dependencies from GitHub when it has
already checked out the sources beforehand.
@ahoppen ahoppen force-pushed the local-dependencies branch from f9ec6bf to b2a871b Compare November 1, 2019 16:02
@ahoppen
Copy link
Member Author

ahoppen commented Nov 1, 2019

CI testing passed: https://ci.swift.org/job/swift-PR-osx-preset/77

check_call(args, verbose=verbose)

# Tell SwiftSyntax that we are building in a CI environment so that it does
# not need to rebuilt if it has already been built bevore.
Copy link

Choose a reason for hiding this comment

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

typo: "not need to be rebuilt if it has already been built before".

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Specify the environment variable SWIFT_SYNTAX_CI_ENVIRONMENT to build
SwiftSyntax with the same compiler options as it is being built before
in CI. This allows us to later use a unified build for the two projects,
and thus avoiding to build SwiftSyntax twice.
SwiftPM does not get the rpath for XCTests in multiroot packages right
(rdar://56793593).
As a temporary workaround we just add the correct rpath as an unsafe
linker flag.
@ahoppen ahoppen force-pushed the local-dependencies branch from 1a91b29 to 5be177f Compare November 1, 2019 17:36
@ahoppen ahoppen merged commit c68cf3b into swiftlang:master Nov 1, 2019
@ahoppen ahoppen deleted the local-dependencies branch November 5, 2019 21:57
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.

2 participants