jar task throws java.lang.IllegalArgumentException: Unrecognized calling convention: 4


(Zsolt Kúti) #1

Changing to rc3 for a simple project I get the error below. Despite the report the manifest file is copied there, its permission seem OK (u + rw) and its content can be controlled.

  • What went wrong: Could not copy MANIFEST.MF to ‘/usr/home/kuti/projekt/gradle-trial/modA/build/tmp/jar/MANIFEST.MF’.

  • Try: Run with --info or --debug option to get more log output.

  • Exception is: org.gradle.api.GradleException: Could not copy MANIFEST.MF to ‘/usr/home/kuti/projekt/gradle-trial/modA/build/tmp/jar/MANIFEST.MF’.

at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:68)

at org.gradle.api.internal.file.collections.MapFileTree$FileVisitDetailsImpl.getFile(MapFileTree.java:133)

at org.gradle.api.internal.file.AbstractFileTree$1.visitFile(AbstractFileTree.java:39)

at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree$1.visitFile(AbstractFileTree.java:145)

at org.gradle.api.internal.file.collections.MapFileTree$Visit.visit(MapFileTree.java:103)

at org.gradle.api.internal.file.collections.MapFileTree.visit(MapFileTree.java:70)

at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:96)

at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTree.visit(AbstractFileTree.java:136)

at org.gradle.api.internal.file.AbstractFileTree.getFiles(AbstractFileTree.java:37)

at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:39)

at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:60)

at org.gradle.api.internal.changedetection.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:42)

at org.gradle.api.internal.changedetection.InputFilesChangedUpToDateRule.create(InputFilesChangedUpToDateRule.java:35)

at org.gradle.api.internal.changedetection.CompositeUpToDateRule.create(CompositeUpToDateRule.java:35)

at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.calcCurrentState(DefaultTaskArtifactStateRepository.java:80)

at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$HistoricExecution.isUpToDate(DefaultTaskArtifactStateRepository.java:88)

at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:128)

at org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository$ShortCircuitArtifactState.isUpToDate(ShortCircuitTaskArtifactStateRepository.java:77)

at org.gradle.api.internal.changedetection.FileCacheBroadcastTaskArtifactStateRepository$1.isUpToDate(FileCacheBroadcastTaskArtifactStateRepository.java:37)

at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:44)

at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)

at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)

at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)

at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)

at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)

at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247)

at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)

at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)

at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)

at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)

at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)

at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)

at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)

at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)

at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)

at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109)

at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103)

at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)

at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)

at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)

at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)

at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)

at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)

at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)

at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)

at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)

at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)

at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31)

at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20)

at org.gradle.launcher.Main.doAction(Main.java:48)

at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45)

at org.gradle.launcher.Main.main(Main.java:39)

at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)

at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32)

at org.gradle.launcher.GradleMain.main(GradleMain.java:24) Caused by: java.lang.IllegalArgumentException: Unrecognized calling convention: 4

at com.sun.jna.Function.invokeInt(Native Method)

at com.sun.jna.Function.invoke(Function.java:344)

at com.sun.jna.Function.invoke(Function.java:276)

at com.sun.jna.Library$Handler.invoke(Library.java:216)

at $Proxy0.chmod(Unknown Source)

at org.gradle.internal.nativeplatform.filesystem.FilePermissionHandlerFactory$LibcChmod.chmod(FilePermissionHandlerFactory.java:67)

at org.gradle.internal.nativeplatform.filesystem.ComposableFilePermissionHandler.chmod(ComposableFilePermissionHandler.java:38)

at org.gradle.internal.nativeplatform.filesystem.GenericFileSystem.chmod(GenericFileSystem.java:64)

at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:65)

… 62 more


My actual system is:

Gradle 1.0-rc-3

Gradle build time: 2012. április 29. 23:51:52 UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.2 compiled on December 20 2010 Ivy: 2.2.0 JVM: 1.6.0_30 (Sun Microsystems Inc. 20.0-b12) OS: FreeBSD 8.2-RELEASE-p1 i386


(Peter Niederwieser) #2

Looks like a problem between the JNA library and your version of FreeBSD that occurs when setting permissions.


(Zsolt Kúti) #3

Just a quick report. Seeing this thread I wonder how this can happen: http://gradle.1045684.n5.nabble.com/unknown-os-support-td5538146.html

Installed a version from FreeBSD ports and replaced those in gradle, to no avail. There are jna-3.2.7.jar and jna-platform.jar. While the former replaceable, the latter not, because jna-posix is required. I am trying to figure out how to resolve it.

Thanks for your comment.


(Zsolt Kúti) #4

An answer from jna list[*] and my tests made it clear that the error is not in the jna lib itself. I can set permissions both using directly jna and code from FilePermissionHandlerFactory. I guess wrong int parameter value is passed to chmod and that it somehow results in failing in Function.invoke( at 344) by calling a native method. Unfortunately I can’t see more.

It beyond my possibilities to debug gradle itself. If I knew the value actually passed I could test that directly on my platform to see how that works here.

Any other idea?

[*] http://groups.google.com/group/jna-users/browse_thread/thread/b203ea101abc8dc5/c53406d48ce403ce#c53406d48ce403ce


(Peter Niederwieser) #5

It would help if you posted the relevant parts of your build script.


(Zsolt Kúti) #6

Finally figured it out.

The jna-jar shipped with gradle contains a libjnidispatch.so under freebsd-i386 that does not work on my system. If I compile jna on my system and use that libjnidispatch.so everything is OK.

Reported on jna list.