Skip to content

Clean ups to the swift-syntax-dev-utils and Package.swift #2200

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 3 commits into from
Sep 19, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Sep 14, 2023

  • Move the environment variables that we check for in Package.swift to the top and add documentation to them
  • Perform some clean-ups in Package.swift
    • Don’t set SWIFTSYNTAX_NO_OSLOG_DEPENDENCY because it’s not needed
    • Use the Swift settings of a target also for the corresponding test target. That’s what we already did for SwiftParser and SwiftParserTests. We should be consistent here.
  • Don’t set --verbose twice when invoking SwiftPM from swift-syntax-dev-utils
    • invokeSwiftPM already sets --verbose. No need to pass it again in the additionalArguments.
  • Remove --disable-sandbox. This flag wasn’t used anywhere.

Comment on lines 518 to 519
ValidationFailure(node: .editorPlaceholderPattern, message: "could conform to trait 'MissingNode' but does not"),
ValidationFailure(node: .editorPlaceholderType, message: "could conform to trait 'MissingNode' but does not"),
Copy link
Contributor

Choose a reason for hiding this comment

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

After rebase those should not be needed anymore

…the top and add documentation to them

Also, make some easy clean-ups:
- Don’t set `SWIFTSYNTAX_NO_OSLOG_DEPENDENCY` because it’s not needed
- Use the Swift settings of a target also for the corresponding test target. That’s what we already did for SwiftParser and SwiftParserTests. We should be consistent here.
`invokeSwiftPM` already sets `--verbose`. No need to pass it again in the `additionalArguments`.
@ahoppen ahoppen force-pushed the ahoppen/build-cleanup branch from 24bf776 to 77819b7 Compare September 18, 2023 19:40
@ahoppen
Copy link
Member Author

ahoppen commented Sep 18, 2023

@swift-ci Please test

@ahoppen ahoppen requested a review from bnbarham September 18, 2023 19:40
Package.swift Outdated
Comment on lines 17 to 18
/// - Enables raw syntax validation (ie. implies `SWIFTSYNTAX_ENABLE_RAWSYNTAX_VALIDATION`)
/// - Enables alternate token introspection (ie. implies `SWIFTPARSER_ENABLE_ALTERNATE_TOKEN_INTROSPECTION`)
Copy link
Contributor

Choose a reason for hiding this comment

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

As written, neither of these are true. Both of these are only enabled if the environment variable is set.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, damn. That was still from an earlier version of the PR.

@@ -153,10 +181,11 @@ let package = Package(

.testTarget(
name: "SwiftSyntaxTest",
dependencies: ["_SwiftSyntaxTestSupport", "SwiftSyntax", "SwiftSyntaxBuilder"]
dependencies: ["_SwiftSyntaxTestSupport", "SwiftSyntax", "SwiftSyntaxBuilder"],
swiftSettings: swiftSyntaxSwiftSettings
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of interest, was this causing rebuilds of the other targets?

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 flag wasn’t used anywhere.
@ahoppen ahoppen force-pushed the ahoppen/build-cleanup branch from 77819b7 to e2f928d Compare September 18, 2023 20:31
@ahoppen
Copy link
Member Author

ahoppen commented Sep 18, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Sep 19, 2023

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge September 19, 2023 01:04
@ahoppen ahoppen merged commit e0fa85f into swiftlang:main Sep 19, 2023
@ahoppen ahoppen deleted the ahoppen/build-cleanup branch September 19, 2023 20:35
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.

3 participants