wails: mac wails build error

Description

wails build error tips:Wails CLI v2.3.1

Build Options

Platform(s) | darwin/amd64
Compiler | /usr/local/go/bin/go
Skip Bindings | false
Build Mode | production
Frontend Directory | /*******/frontend Obfuscated | false
Skip Frontend | false
Compress | false
Package | true
Clean Bin Dir | false
LDFlags |
Tags | []
Race Detector | false
Warning: go.mod is using Wails ‘2.1.0’ but the CLI is ‘v2.3.1’. Consider updating your project’s go.mod file.

Building target: darwin/amd64

• Generating bindings: ERROR
# algo-benchmark /usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 ld: warning: -no_pie is deprecated when targeting new OS versions ld: warning: non-standard -pagezero_size is deprecated when targeting macOS 13.0 or later ld: file too small (length=0) file ‘/var/folders/q2/867r3wd554s8dv7bg9gmzf640000gn/T/go-link-3393189677/000000.o’ for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

      exit status 2

ERROR
# algo-***** /usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 ld: warning: -no_pie is deprecated when targeting new OS versions ld: warning: non-standard -pagezero_size is deprecated when targeting macOS 13.0 or later ld: file too small (length=0) file ‘/var/folders/q2/867r3wd554s8dv7bg9gmzf640000gn/T/go-link-3393189677/000000.o’ for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

      exit status 2

♥ If Wails is useful to you or your company, please consider sponsoring the project:

To Reproduce

  1. first:sudo wails build -platform windows/arm64 -o algo.exe
  2. then:tips no platform
  3. sudo wails build -platform windows -o algo.exe

Expected behaviour

wails build success

Screenshots

No response

Attempted Fixes

No response

System Details

Wails CLI v2.3.1

Scanning system - Please wait (this may take a long time)...Done.

# System

OS           | MacOS
Version      | 13.0.1
ID           | 22A400
Go Version   | go1.18.3
Platform     | darwin
Architecture | amd64

# Wails

Version | v2.3.1

# Dependencies

Dependency                | Package Name | Status    | Version
Xcode command line tools  | N/A          | Installed | 2396
npm                       | N/A          | Installed | 8.11.0
*Xcode                    | N/A          | Available |
*upx                      | N/A          | Available |
*nsis                     | N/A          | Available |
* - Optional Dependency

# Diagnosis

Your system is ready for Wails development!
Optional package(s) installation details:
  - Xcode: Available at https://apps.apple.com/us/app/xcode/id497799835
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (2 by maintainers)

Most upvoted comments

I JUST noticed that after walis build -clean -platform=windows/amd64, there’s a new file xxx-res.syso appended to project root.

I DELETED this new file and tried it again, guess what?

# Building target: windows/amd64

  • Generating bindings: Done.
  • Installing frontend dependencies: Done.
  • Compiling frontend: Done.
  • Generating application assets: Done.
  • Compiling application: Done.
 INFO  Wails is now using the new Go WebView2Loader. If you encounter any issues with it, please report them to https://github.com/wailsapp/wails/issues/2004. You could also use the old legacy loader with `-tags native_webview2loader`, but keep in mind this will be deprecated in the near future.
Built '/Users/barat/Codes/GoCodes/wailsd/build/bin/wailsd.exe' in 6.305s.

Nice investigation both. Deleting that file before build should be fine, though I’m amazed this affects Mac builds to the point where I think it might be a bug in the compiler…

We can improve this and delete it after a failed build. But I think we should also remove that file if it exists before doing a build. Just in case someone has it there for some reason.

Thanks for all the amazing job u guys did.

Thank you so much

@liyz404 do you also have that file in your folder? Does deleting the xxx-res.syso solve it for you as well?

Yes, after delete this file, can I continue to build windows app?