Skip to content

build-script: add missing DocC dependency #61492

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
Oct 10, 2022
Merged

Conversation

MaxDesiatov
Copy link
Contributor

Without this dependency, passing both --swiftdocc and --install-swiftdocc to build-script causes it to crash with this stack trace:

Traceback (most recent call last):
  File "./swift/utils/build-script", line 789, in <module>
    exit_code = main()
  File "./swift/utils/build-script", line 784, in main
    return main_normal()
  File "./swift/utils/build-script", line 740, in main_normal
    invocation.execute()
  File "./swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 670, in execute
    (self.impl_env, self.impl_args) = self.convert_to_impl_arguments()
  File "./swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 147, in convert_to_impl_arguments
    for product_class in sum(list(self.compute_product_pipelines()[0]), []):
  File "./swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 664, in compute_product_pipelines
    return builder.finalize(shouldInfer=self.args.infer_dependencies)
  File "./swift/utils/swift_build_support/swift_build_support/productpipeline_list_builder.py", line 198, in finalize
    result = self.infer()
  File "./swift/utils/swift_build_support/swift_build_support/productpipeline_list_builder.py", line 157, in infer
    build_graph.produce_scheduled_build(enabled_pipeline)[0]
  File "./swift/utils/swift_build_support/swift_build_support/build_graph.py", line 150, in produce_scheduled_build
    dag.set_root(entry)
  File "./swift/utils/swift_build_support/swift_build_support/build_graph.py", line 95, in set_root
    assert self.root is None
AssertionError

Apparently, the absence of this explicit dependency makes build_graph.py code think that SwiftDocCRender and SwiftDocC are independent root targets, which it can't handle. Making one a dependency of the other resolves the issue.

Without this dependency, passing both `--swiftdocc` and `--install-swiftdocc` to `build-script` causes it to crash with this stack trace:

```
Traceback (most recent call last):
  File "./swift/utils/build-script", line 789, in <module>
    exit_code = main()
  File "./swift/utils/build-script", line 784, in main
    return main_normal()
  File "./swift/utils/build-script", line 740, in main_normal
    invocation.execute()
  File "./swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 670, in execute
    (self.impl_env, self.impl_args) = self.convert_to_impl_arguments()
  File "./swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 147, in convert_to_impl_arguments
    for product_class in sum(list(self.compute_product_pipelines()[0]), []):
  File "./swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 664, in compute_product_pipelines
    return builder.finalize(shouldInfer=self.args.infer_dependencies)
  File "./swift/utils/swift_build_support/swift_build_support/productpipeline_list_builder.py", line 198, in finalize
    result = self.infer()
  File "./swift/utils/swift_build_support/swift_build_support/productpipeline_list_builder.py", line 157, in infer
    build_graph.produce_scheduled_build(enabled_pipeline)[0]
  File "./swift/utils/swift_build_support/swift_build_support/build_graph.py", line 150, in produce_scheduled_build
    dag.set_root(entry)
  File "./swift/utils/swift_build_support/swift_build_support/build_graph.py", line 95, in set_root
    assert self.root is None
AssertionError
```

Apparently, the absence of this explicit dependency makes `build_graph.py` code think that `SwiftDocCRender` and `SwiftDocC` are independent root targets, which it can't handle. Making one a dependency of the other resolves the issue.
@MaxDesiatov

This comment was marked as outdated.

1 similar comment
@MaxDesiatov
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -6,5 +6,5 @@ structures used by the Swift build script.
You may run unit tests for `swift_build_support` from the command line:

```sh
$ python utils/swift_build_support/run_tests.py
Copy link
Member

Choose a reason for hiding this comment

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

While a reasonable fix, this change looks unrelated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense, I'll submit it as a separate PR

@MaxDesiatov MaxDesiatov force-pushed the maxd/docc-missing-deps branch from ec871f0 to f6411c3 Compare October 10, 2022 16:04
@MaxDesiatov
Copy link
Contributor Author

@swift-ci please smoke test and merge

@MaxDesiatov
Copy link
Contributor Author

@swift-ci please test Windows

@swift-ci swift-ci merged commit d665ae0 into main Oct 10, 2022
@swift-ci swift-ci deleted the maxd/docc-missing-deps branch October 10, 2022 18:30
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.

4 participants