compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

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

Open N7ghtm4r3 opened this issue 2 years ago • 19 comments

Describe the bug

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

  • Error in the console:

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

  • Error in the log file created:

/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:

  • Desktop

Versions

  • Kotlin version: 1.8.0
  • Compose Multiplatform version: 1.4.2
  • OS version(s): macOs BigSur
  • OS architecture: x86
  • JDK (for desktop issues): 18

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

N7ghtm4r3 avatar Jan 22 '24 15:01 N7ghtm4r3

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)?

elijah-semyonov avatar Jan 23 '24 09:01 elijah-semyonov

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

N7ghtm4r3 avatar Jan 23 '24 13:01 N7ghtm4r3

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

elijah-semyonov avatar Jan 23 '24 13:01 elijah-semyonov

Yes, thanks you for the help!

N7ghtm4r3 avatar Jan 23 '24 13:01 N7ghtm4r3

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.

elijah-semyonov avatar Jan 23 '24 14:01 elijah-semyonov

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

N7ghtm4r3 avatar Jan 23 '24 14:01 N7ghtm4r3

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.

elijah-semyonov avatar Jan 23 '24 14:01 elijah-semyonov

Thank you, I try right now

N7ghtm4r3 avatar Jan 23 '24 14:01 N7ghtm4r3

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

N7ghtm4r3 avatar Jan 23 '24 14:01 N7ghtm4r3

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

elijah-semyonov avatar Jan 23 '24 14:01 elijah-semyonov

Okay thanks

N7ghtm4r3 avatar Jan 23 '24 14:01 N7ghtm4r3

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

N7ghtm4r3 avatar Jan 23 '24 14:01 N7ghtm4r3

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?

N7ghtm4r3 avatar Jan 23 '24 14:01 N7ghtm4r3

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 avatar Jan 23 '24 16:01 elijah-semyonov

@igordmn can you have a look?

elijah-semyonov avatar Jan 23 '24 16:01 elijah-semyonov

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

N7ghtm4r3 avatar Jan 23 '24 16:01 N7ghtm4r3

Hi, any updates about?

N7ghtm4r3 avatar Jan 30 '24 08:01 N7ghtm4r3

Hi, nothing yet?

N7ghtm4r3 avatar Mar 27 '24 09:03 N7ghtm4r3

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

N7ghtm4r3 avatar Apr 26 '24 13:04 N7ghtm4r3