3

I am now trying to use WireGuardKit, where it asks to create an "External Build System" and fill in the Directory with ${BUILD_DIR}/... /... /SourcePackages/checkouts/wireguard/Sources/WireGuardKitGo (this path has been modified and I guarantee that this path will allow me to pass the compilation).

However, when I execute archive, Xcode reports an error unable to spawn process '/usr/bin/make' (No such file or directory).

I suspect that $(BUILD_DIR) doesn't have a value when the compilation is executed, or I can't use this environment variable at this stage. Because when I don't use relative paths and use absolute paths to assign values to Directory, the project is able to archive successfully.

So my question is, when I execute the archive, how do I get the path of the package I inherited using SPM? Or can I use $(BUILD_DIR) environment variable when I execute archive? Why is it different from when compiling?

UPDATE:

I learned that $(BUILD_DIR) uses $() within it and when I try to use $() directly, it still reports an error, I also tried variables like $(BUILD_PATH), $(BUILD_ROOT), $(BUILT_PRODUCTS_DIR), but none of them work.

So could it be a problem with $(), an environment variable that has no value when the archive is executed?

How do I get the SPM directory when executing the archive?

Rakuyo
  • 390
  • 3
  • 15

1 Answers1

0

I was able to solve this issue with an alternative configuration for External Build System

Here is a tutorial (see section "Manual Xcode steps")

The main idea is to use build_wireguard_go_bridge.sh script in your External Build System configuration:

Build Tool: $(PROJECT_DIR)/Scripts/build_wireguard_go_bridge.sh

Arguments: $(ACTION)

Directory: <empty>

max
  • 21
  • 2
  • I changed the external build system like you said, but I get an error: unable to spawn process '.../wireguard-apple/Scripts/build_wireguard_go_bridge.sh' (Permission denied). Any idea why permission would be denied? – shirefriendship Apr 11 '23 at 04:32
  • 1
    @shirefriendship try chmod +x build_wireguard_go_bridge.sh – Issac Kelly Apr 11 '23 at 22:26