JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.86k stars 1.15k forks source link

Codesign error during the creation of the package release distributable on macOs BigSur #4158

Open N7ghtm4r3 opened 7 months ago

N7ghtm4r3 commented 7 months ago

Describe the bug

Run the packageReleaseDistributionForCurrentOS command on macOs the build failed with the error:

Command: [/usr/bin/codesign, -vvvv, --remove-signature, /compose/tmp/sign/libsodium.dylib]

/Library/Developer/CommandLineTools/usr/bin/codesign_allocate: fatal error: file not in an order that can be processed (function starts data out of place): /Users/user/IdeaProjects/appname/build/compose/tmp/sign/libsodium.dylib

/Users/user/IdeaProjects/appname/build/compose/tmp/sign/libsodium.dylib: the codesign_allocate helper tool cannot be found or > used

Affected platforms Select one of the platforms below:

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. Download before the main library here
  2. Then publish to maven local in your machine
  3. After you need to install the desktop version
  4. Run the packageReleaseDistributionForCurrentOS command
  5. See error in the console

Expected behavior After run that command should be created the package in the .pkg format for the release distributable

elijah-semyonov commented 7 months ago

This message is suspicious:

the codesign_allocate helper tool cannot be found or > used

Can you type codesign_allocate in your terminal and ensure that it's installed (should be shipped with Xcode)?

N7ghtm4r3 commented 7 months ago

Hi, sorry for the delay for the reply, I tried to execute the command you suggest and this is the response:

user@xxx ~ % codesign_allocate
Usage: /Library/Developer/CommandLineTools/usr/bin/codesign_allocate -i input [[-a <arch> <size>]... [-A <cputype> 
<cpusubtype> <size>]... | -r] [-p] -o output

so I don't now if is effectively intalled, have you some tips about? Thanks for the help anyway

elijah-semyonov commented 7 months ago

It's installed, but the Gradle task can't resolve it for some reason, we'll investigate that.

N7ghtm4r3 commented 7 months ago

Yes, thanks you for the help!

elijah-semyonov commented 7 months ago

I couldn't reproduce it.

BUILD SUCCESSFUL in 1m 47s
9 actionable tasks: 9 executed
14:54:50: Execution finished 'packageReleaseDistributionForCurrentOS'.

It seems like there is some problem with your environment.

N7ghtm4r3 commented 7 months ago

Did you run It on a macOs enviroment? Because in the other works correctly

elijah-semyonov commented 7 months ago

Yes. I'm running Sonoma though.

Please, add this to build.gradle.kts in your desktop sources:

tasks.all {
    if (name == "packageReleaseDistributionForCurrentOS") {
        doFirst {
            println("Current PATH: " + System.getenv("PATH"))
        }
    }
}

Then check that your resolved PATH contains folder where codesign_allocate resides. You can look up this folder using locate codesign_allocate.

N7ghtm4r3 commented 7 months ago

Thank you, I try right now

N7ghtm4r3 commented 7 months ago

Sorry I cannot execute the task, where I need to place that snippet?

elijah-semyonov commented 7 months ago

In the end of your build.gradle.kts in Pandoro-Desktop.

N7ghtm4r3 commented 7 months ago

Okay thanks

N7ghtm4r3 commented 7 months ago

Maybe I wrong, but the task is not executed the gradle make only the task of the main task

N7ghtm4r3 commented 7 months ago

I can executing the tesk, the result is:

Current PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

The result instead of the locate codesign_allocate is:

/usr/bin/codesign_allocate
/usr/libexec/DeveloperTools/codesign_allocate

Do I have to change the project path?

elijah-semyonov commented 7 months ago

No, there is /usr/bin in your PATH, and that's where codesign_allocate is contained. I have no idea why you are getting the message about missing executable.

elijah-semyonov commented 7 months ago

@igordmn can you have a look?

N7ghtm4r3 commented 7 months ago

Okay understood, sorry for the request but are days that I try to figure out with this. Again thank you for the help

N7ghtm4r3 commented 7 months ago

Hi, any updates about?

N7ghtm4r3 commented 5 months ago

Hi, nothing yet?

N7ghtm4r3 commented 4 months ago

Sorry I really need build version also for MacOS and that problem is still occurs, what I need to do to build correctly?

okushnikov commented 1 week ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.