Investigate why app & system extension shared dependencies fail to embed

Aberta
#149 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
30/100
Tipo de issue
Bug
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Stack de tecnologia
swift
Domínio
build-system, desktop

Direção de pesquisa

Comece reproduzindo as falhas do build de release descritas nas issues #145, #98 e #143, concentrando-se nas dependências compartilhadas pelos targets de extensão do sistema do App e da VPN. Prepare um exemplo mínimo reproduzível que mostre o framework incorporado ausente e, em seguida, documente o resultado para os Apple Developer Forums e o Feedback Assistant conforme descrito na issue.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

In both #145 and #98, I've encountered an issue with release builds of the app. These issues arose when a dependency was required by both the App target (or any of it's dependencies), and the system extension target (and any of it's dependencies).

In #98, the issue occurred when protobuf definitions were added directly to the app target, or a new framework target that would be depended on by the app target. They were previously working fine being depended on by just VPNLib (which the system extension depends on).
In the first case, the network extension would crash. In the second case, the app would crash.
The crash reason was:

Library not loaded: @rpath/SwiftProtobuf.framework/Versions/A/SwiftProtobuf

Other users have reported this issue https://github.com/apple/swift-protobuf/issues/1506#issuecomment-2435125065

In #143, the issue occured when InternalCollectionsUtilities was depended on by both the App target, and the VPN target (via another framework, VPNLib). When a library that depended on swift-collections was added to the app target, the network extension would crash on startup with the error:

Library not loaded: @rpath/InternalCollectionsUtilities.framework/Versions/A/InternalCollectionsUtilities

FWICT, xcode is making some form of optimisation where it constructs a framework for code shared between two different targets. This poses an issue with a system extension, which is copied and executed outside of the app bundle. A copy of the system extension always lives in the app bundle, so it's trivial for the app to depend on a framework present within the system extension bundle (we already do this), but not the other way around. If there was some way to tell xcode to embed this new framework within the system extension bundle, we wouldn't have this issue.

Instead, the workaround we've gone with is to simply put everything that would cause this issue in VPNLib, as to minimise the number of times we depend on any one package.

This issue doesn't require immediate action, and is more so for book-keeping. It would be good to post this alongside an MRE on the Apple developer forums and in Apple feedback assistant.

Linguagem predominante
Swift
Estrelas
29
Forks
9
Merge médio
1d 17h
PRs com merge (30d)
5

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de coder/coder-desktop-macos

Todas as issues de coder/coder-desktop-macos

Issues semelhantes

Mais issues de Swift

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.