← Back to issue list

gradle plugin gradlew test fails on architectures other than amd64 and arm64

View original Github issue

Metadata

Project
craft-parts
Number
#1280
Type
issue
State
open
Author
lengau
Labels
Type: Bug
Created
2025-09-10 03:24:51+00:00
Updated
2025-09-10 04:36:59+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description The gradle plugin's [gradlew test](https://github.com/canonical/craft-parts/blob/6d8383c8eb079329628cd7bbf245754a70cf8018/tests/integration/plugins/test_gradle.py#L70) fails on architectures other than amd64 and arm64 ### To Reproduce https://github.com/canonical/craft-parts/actions/runs/17601539374/job/50004294034?pr=1278 ### part yaml ```shell ``` ### Relevant log output ```shell =================================== FAILURES =================================== __________________________ test_gradle_plugin_gradlew __________________________ new_dir = local('/tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0') testing_source_dir = local('/tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0') partitions = None, local_proxy_url = 'http://localhost:8888' @pytest.mark.java def test_gradle_plugin_gradlew( new_dir, testing_source_dir, partitions, local_proxy_url ): part_name = "foo" parts_yaml = textwrap.dedent( f""" parts: {part_name}: plugin: gradle gradle-task: testWrite build gradle-init-script: init.gradle source: {testing_source_dir} build-packages: [gradle, openjdk-21-jdk] build-environment: # This is just because the test environment has multiple java versions and will # use default-jre if unspecified. - JAVA_HOME: /usr/lib/jvm/java-21-openjdk-${{CRAFT_ARCH_BUILD_FOR}} - http_proxy: {local_proxy_url} - https_proxy: {local_proxy_url} # Set GRADLE_USER_HOME dir to the according part's build .gradle dir to avoid # interfering with other tests. - GRADLE_USER_HOME: {new_dir}/parts/{part_name}/build/.gradle stage-packages: [openjdk-21-jdk] """ ) parts = yaml.safe_load(parts_yaml) lf = LifecycleManager( parts, application_name="test_ant", cache_dir=new_dir, work_dir=new_dir, partitions=partitions, ) actions = lf.plan(Step.PRIME) with lf.action_executor() as ctx: ctx.execute(actions) _test_core_gradle_plugin_build_output(project_info=lf.project_info) # generated by the init.gradle testWrite task > assert (lf.project_info.dirs.parts_dir / f"{part_name}/build" / "test.txt").exists() E AssertionError: assert False E + where False = exists() E + where exists = ((PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts') / 'foo/build') / 'test.txt').exists E + where PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts') = <craft_parts.dirs.ProjectDirs object at 0x3ffaaf1e480>.parts_dir E + where <craft_parts.dirs.ProjectDirs object at 0x3ffaaf1e480> = <craft_parts.infos.ProjectInfo object at 0x3ffab8a10d0>.dirs E + where <craft_parts.infos.ProjectInfo object at 0x3ffab8a10d0> = <craft_parts.lifecycle_manager.LifecycleManager object at 0x3ffaa4e32c0>.project_info /home/ubuntu/actions-runner/_work/craft-parts/craft-parts/tests/integration/plugins/test_gradle.py:111: AssertionError ----------------------------- Captured stdout call ----------------------------- Downloading https://services.gradle.org/distributions/gradle-8.13-bin.zip .................................................................................................................................. Unzipping /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13-bin.zip to /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d Set executable permissions for: /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/bin/gradle Welcome to Gradle 8.13! Here are the highlights of this release: - Daemon JVM auto-provisioning - Enhancements for Scala plugin and JUnit testing - Improvements for build authors and plugin developers For more details see https://docs.gradle.org/8.13/release-notes.html Starting a Gradle Daemon (subsequent builds will be faster) > Task :testWrite > Task :compileJava > Task :processResources NO-SOURCE > Task :classes > Task :jar > Task :assemble > Task :compileTestJava NO-SOURCE > Task :processTestResources NO-SOURCE > Task :testClasses UP-TO-DATE > Task :test NO-SOURCE > Task :check UP-TO-DATE > Task :build [Incubating] Problems report is available at: file:///tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build/build/reports/problems/problems-report.html Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD SUCCESSFUL in 6s 3 actionable tasks: 3 executed ----------------------------- Captured stderr call ----------------------------- tinyproxy: Could not create listening sockets. + /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build/gradlew testWrite build --init-script init.gradle openjdk version "21.0.8" 2025-07-15 OpenJDK Runtime Environment (build 21.0.8+9-Ubuntu-0ubuntu124.04.1) OpenJDK 64-Bit Server VM (build 21.0.8+9-Ubuntu-0ubuntu124.04.1, mixed mode, sharing) + find /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build -name gradle-wrapper.jar -type f -delete + mkdir -p /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/bin ++ find /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install -name java -type f -executable + java_bin=/tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/lib/jvm/java-21-openjdk-s390x/bin/java + ln -s --relative /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/lib/jvm/java-21-openjdk-s390x/bin/java /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/bin/java + mkdir -p /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/jar + find /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build/ -iname '*.jar' -not -path '/tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/build/.parts/*' -exec ln '{}' /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/jar ';' ------------------------------ Captured log call ------------------------------- WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/sbin/pam_extrausers_chkpwd WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/sbin/unix_chkpwd WARNING craft_parts.packages.normalize:normalize.py:151 Copying needed target link from the system: /dev/null WARNING craft_parts.packages.normalize:normalize.py:151 Copying needed target link from the system: /etc/ssl/certs/ca-certificates.crt WARNING craft_parts.packages.normalize:normalize.py:151 Copying needed target link from the system: /etc/environment WARNING craft_parts.packages.normalize:normalize.py:151 Copying needed target link from the system: /etc/ssl/certs/java/cacerts WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/chfn WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/chsh WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/umount WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/su WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/mount WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/passwd WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/chage WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/gpasswd WARNING craft_parts.packages.normalize:normalize.py:229 Removing suid/guid from /tmp/pytest-of-ubuntu/pytest-0/test_gradle_plugin_gradlew0/parts/foo/install/usr/bin/expiry ===== 1 failed, 19 passed, 1 skipped, 4548 deselected in 697.93s (0:11:37) ===== ```

Evaluation history

No evaluation history available.