Skip to content

Swift: Xcode 16.2 - could not build module #19284

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

Open
stefanrenne opened this issue Apr 11, 2025 · 9 comments
Open

Swift: Xcode 16.2 - could not build module #19284

stefanrenne opened this issue Apr 11, 2025 · 9 comments
Labels
question Further information is requested

Comments

@stefanrenne
Copy link

ADO pipelines using codeql bundle 2.21.0 with Xcode 16.2 and the following task configuration block me to compile a swift project. It fails on could not build module related errors.

Pipeline:

 - task: AdvancedSecurity-Codeql-Init@1
  inputs:
    enableAutomaticCodeQLInstall: true
    languages: swift
    querysuite: security-and-quality
- task: Xcode@5
  displayName: 'Build and archive'
  inputs:
    configuration: 'ANONYMISED'
    sdk: iphoneos
    xcWorkspacePath: ANONYMISED.xcodeproj
    scheme: 'ANONYMISED'
    xcodeVersion: specifyPath
    xcodeDeveloperDir: '/Applications/Xcode_$(xcodeVersion).app/Contents/Developer'
    packageApp: true
    archivePath: 'output/release'
    exportPath: 'output/release'
    exportOptions: plist
    exportOptionsPlist: 'Signing/$(buildType)/exportOptions.plist'
    signingOption: default

Output:
logging.txt

@aibaars
Copy link
Contributor

aibaars commented Apr 14, 2025

This line in the logs looks worrying:

2025-04-07T09:45:08.3797660Z   fatalError
2025-04-07T09:45:08.3798290Z   Cyclic dependency in module 'DarwinFoundation': DarwinFoundation -> _stddef -> DarwinFoundation

Have you tried running the same build commands in ADO, but without CodeQL? If the same build command runs fine without CodeQL then CodeQL's analyzer is somehow interfering and causing a failure.

@stefanrenne
Copy link
Author

@aibaars of course, without the AdvancedSecurity-Codeql-Init@1 task everything works fine :)

@aibaars
Copy link
Contributor

aibaars commented Apr 14, 2025

@aibaars of course, without the AdvancedSecurity-Codeql-Init@1 task everything works fine :)

Thanks for confirming.

@aibaars
Copy link
Contributor

aibaars commented Apr 14, 2025

It would be very helpful if you could attach the detailed CodeQL log file, in particular the build-tracer.log file. I'm afraid I'm not familiar with ADO pipelines, and do not know how to obtain such log file from an ADO run. For GitHub Actions the github/codeql-action/init step has a debug: true property to enable debug mode, which uploads a debug artifact with logs and much more. I'm not sure if the ADO task has a similar feature.

I could not find many other reports of Cyclic dependency in module 'DarwinFoundation': DarwinFoundation -> _stddef -> DarwinFoundation. I found the following, but no suggestions on how to fix the problem other than running a clean build:
https://www.reddit.com/r/flutterhelp/comments/1i7h270/vs_code_template_flutter_project_cycling/

@aibaars
Copy link
Contributor

aibaars commented Apr 15, 2025

Here are some instructions to obtain debug artifacts. Note that the debug artifacts contain sensitive information such as the contents of analyzed files. If your repository is private then it is probably best to create an enterprise support ticket and move this conversation there.

@stefanrenne
Copy link
Author

@aibaars I have been trying this but I keep on getting a error

Artifact name input: codeql-artifact
##[error]Path does not exist: /Users/runner/work/_temp\advancedsecurity.codeql\d\swift

Which is probably because the whole compiling is broken?

@aibaars
Copy link
Contributor

aibaars commented Apr 29, 2025

##[error]Path does not exist: /Users/runner/work/_temp\advancedsecurity.codeql\d\swift

That looks really strange indeed. It looks like a mixup of Windows and Unix paths. Do you have any idea where the \advancedsecurity.codeql\d\ part comes from?

@stefanrenne
Copy link
Author

@aibaars oke my bad, used the slash in the wrong direction. Attached the build tracer log, I will provide all other logging to our GitHub person of contact.

build-tracer.log

@redsun82
Copy link
Contributor

The Error: Environment variable SEMMLE_PRELOAD_libtrace is not set (or empty), but it should be set messages indeed look quite suspicious. However in the worst case that should impede analysis, not the build itself.

By the way, on Github actions that environment variable is set by github/codeql-action/init in case of a traced language. Shouldn't that variable be set by AdvancedSecurity-Codeql-Init@1 then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants