Skip to content

feat: Windows support#181

Merged
pepicrft merged 10 commits intomainfrom
build-on-windows
Feb 20, 2025
Merged

feat: Windows support#181
pepicrft merged 10 commits intomainfrom
build-on-windows

Conversation

@pepicrft
Copy link
Copy Markdown
Contributor

We might support non-Apple ecosystems in the future (e.g. React Native, Flutter, or Android), where we can't assume development is happening from a macOS environment. Therefore, we should start taking steps to support Linux and Windows environments. This PR ensures this package builds and runs on Windows and Linux.

@pepicrft pepicrft self-assigned this Jan 22, 2025
@pepicrft pepicrft marked this pull request as ready for review January 28, 2025 16:43
@pepicrft
Copy link
Copy Markdown
Contributor Author

Foundation.Process blows up in Linux with the following stack trace. I'm unsure if it's Process itself or our usage:

*** Signal 11: Backtracing from 0xffff95ca1a88... done ***

*** Program crashed: Bad pointer dereference at 0x0000ffff7c3a4000 ***

Thread 0 crashed:

0                  0x0000ffff95ca1a88 findMaximumOpenFromProcSelfFD() + 208 in libFoundation.so
1 [ra]             0x0000ffff95dab684 Process.run() + 6231 in libFoundation.so
2 [ra]             0x0000aaaac59e02b0 closure #1 in closure #1 in CommandRunner.run(arguments:environment:workingDirectory:) + 3479 in CommandPackageTests.xctest at /package/Sources/Command/CommandRunner.swift:208:33
3 [async] [thunk]  0x0000aaaac59e4fd8 partial apply for closure #1 in closure #1 in CommandRunner.run(arguments:environment:workingDirectory:) in CommandPackageTests.xctest at //<compiler-generated>
4 [async] [thunk]  0x0000aaaac59de658 thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) in CommandPackageTests.xctest at //<compiler-generated>
5 [async] [thunk]  0x0000aaaac59e5190 partial apply for thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) in CommandPackageTests.xctest at //<compiler-generated>
6 [async] [system] 0x0000ffff96416534 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) in libswift_Concurrency.so

Thread 1:

0  0x0000000000000000


Registers:

 x0 0x0000ffff7c3a3f13  31 33 35 36 00 eb 16 04 00 00 00 00 00 50 05 00  1356·ë·······P··
 x1 0x0000000000000000  0
 x2 0x000000000000054f  1359
 x3 0x0000000000000018  24
 x4 0x00000000000000f8  248
 x5 0x0000000000000004  4
 x6 0x0000ffff7c00088c  ff ff 00 00 34 14 04 00 00 00 00 00 02 00 00 00  ÿÿ··4···········
 x7 0x0000000000000004  4
 x8 0x0000000000000000  0
 x9 0x0000ffff83ffdcf4  00 00 00 00 00 00 00 00 00 00 00 00 c0 bb 39 7c  ············À»9|
x10 0x0000000000000005  5
x11 0x0000000000000546  1350
x12 0x0000000035000000  889192448
x13 0x0000ffff83ffdd14  00 eb 16 04 00 00 00 00 00 50 05 00 00 00 00 00  ·ë·······P······
x14 0x0000000000000018  24
x15 0x0000000000000040  64
x16 0x0000000000000001  1
x17 0x0000ffff950143c0  fd 7b bb a9 21 00 80 52 fd 03 00 91 f7 63 03 a9  ý{»©!··Rý···÷c·©
x18 0x000000000000200d  8205
x19 0x0000ffff7c39bf80  6f 05 00 00 00 00 00 00 00 80 00 00 00 00 00 00  o···············
x20 0xe400000000000000  16429131440647569408
x21 0x0000000000000000  0
x22 0x000000000000054b  1355
x23 0x000000000000054b  1355
x24 0x0000ffff83ffdcf2  35 35 00 00 00 00 00 00 00 00 00 00 00 00 c0 bb  55············À»
x25 0x0000ffff83ffdcf3  35 00error: Exited with unexpected signal code 11
 00 00 00 00 00 00 00 00 00 00 00 c0 bb 39  5············À»9
x26 0x0000ffff83ffdd11  33 35 36 00 eb 16 04 00 00 00 00 00 50 05 00 00  356·ë·······P···
x27 0x000000000000000a  10
x28 0x0000000000000000  0
 fp 0x0000ffff83ffde20  50 e1 ff 83 ff ff 00 00 84 b6 da 95 ff ff 00 00  Páÿ·ÿÿ···¶Ú·ÿÿ··
 lr 0x0000ffff95ca1a4c  a0 16 00 b4 00 3c c1 3c 01 88 40 ad e1 03 1f aa   ··´·<Á<··@­á··ª
 sp 0x0000ffff83ffdcf0  31 33 35 35 00 00 00 00 00 00 00 00 00 00 00 00  1355············
 pc 0x0000ffff95ca1a88  00 8c 46 ad e2 03 07 ad 01 3c c0 3d e8 83 40 39  ··F­â··­·<À=è·@9


Images (19 omitted):

0x0000aaaac59c0000–0x0000aaaac5b969d0 <no build ID>                            CommandPackageTests.xctest /package/.build/linux/aarch64-unknown-linux-gnu/debug/CommandPackageTests.xctest
0x0000ffff95a80000–0x0000ffff95f0fa70 f787f432bedc30728871de07ac0b6294fbe4729b libFoundation.so           /usr/lib/swift/linux/libFoundation.so
0x0000ffff963b0000–0x0000ffff9642ecb0 debaf615e42671bb362c9e24b5b4bdda6fa66f8f libswift_Concurrency.so    /usr/lib/swift/linux/libswift_Concurrency.so

@pepicrft
Copy link
Copy Markdown
Contributor Author

In the process of investigating what the issue could be, I came across this other package, which made me think it might not make sense for us to continue maintaining this package, considering there's also an official solution by Apple coming.

@pepicrft pepicrft merged commit 4d131a1 into main Feb 20, 2025
@pepicrft pepicrft deleted the build-on-windows branch February 20, 2025 13: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.

1 participant