java plugin should not link java under /bin
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### Bug Description
Java plugin attempts to link java executable under /bin.
This causes conflict with the other parts writing to /bin.
### To Reproduce
1. rockcraft pack attached project
### part yaml
```shell
name: maven-sample-chisel
version: 0.0.1
summary: Sample Maven-based chiselled rock
description: |
This image is a sample maven application
using openjdk-21-jre-headless slices
base: bare
build-base: ubuntu@24.04
run-user: _daemon_
platforms:
amd64:
services:
test:
override: replace
summary: Service summary
command: /usr/lib/jvm/java-21-openjdk-amd64/bin/java -jar /jars/sample-0.0.1-SNAPSHOT.jar
startup: enabled
parts:
application:
plugin: maven
source: ./sample
source-type: local
build-packages:
- maven
- openjdk-21-jdk
runtime:
plugin: nil
source: https://github.com/vpa1977/chisel-releases
source-type: git
source-branch: 24.04-openjdk-21-jre-headless
build-packages:
- ca-certificates-java
override-build: |
chisel cut --release ./ --root ${CRAFT_PART_INSTALL} \
base-files_base openjdk-21-jre-headless_security
mkdir -p ${CRAFT_PART_INSTALL}/etc/ssl/certs/java/
cp /etc/ssl/certs/java/cacerts ${CRAFT_PART_INSTALL}/etc/ssl/certs/java/cacerts
```
### Relevant log output
```shell
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.322 Staging application
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.322 execute action application:Action(part_name='application', step=Step.STAGE, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None))
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.347 Failed to stage: parts list the same file with different contents or permissions.
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.347 Detailed information: Parts 'runtime' and 'application' list the following files, but with different contents or permissions:
2024-08-16 11:47:22.717 :: bin
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 Traceback (most recent call last):
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_application/services/lifecycle.py", line 261, in run
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 aex.execute(action, stdout=stream, stderr=stream)
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 324, in execute
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 self._executor.execute(actions, stdout=stdout, stderr=stderr)
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 136, in execute
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 self._run_action(act, stdout=stdout, stderr=stderr)
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_parts/executor/executor.py", line 206, in _run_action
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 check_for_stage_collisions(
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_parts/executor/collisions.py", line 59, in check_for_stage_collisions
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 _check_for_stage_collisions_per_partition(part_list, partition)
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_parts/executor/collisions.py", line 111, in _check_for_stage_collisions_per_partition
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 raise errors.PartFilesConflict(
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 craft_parts.errors.PartFilesConflict: Failed to stage: parts list the same file with different contents or permissions.
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 Parts 'runtime' and 'application' list the following files, but with different contents or permissions:
2024-08-16 11:47:22.717 :: 2024-08-16 11:47:22.348 bin
2024-08-16 11:47:22.717 Executing on host: lxc --project rockcraft config device show local:rockcraft-maven-sample-chisel-on-amd64-for-amd64-61079577
2024-08-16 11:47:22.813 Executing on host: lxc --project rockcraft config device remove local:rockcraft-maven-sample-chisel-on-amd64-for-amd64-61079577 disk-/root/project
2024-08-16 11:47:22.957 Executing on host: lxc --project rockcraft stop local:rockcraft-maven-sample-chisel-on-amd64-for-amd64-61079577
2024-08-16 11:47:27.024 Failed to execute rockcraft in instance.
2024-08-16 11:47:27.026 Traceback (most recent call last):
2024-08-16 11:47:27.026 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_application/application.py", line 376, in run_managed
2024-08-16 11:47:27.026 instance.execute_run( # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType]
2024-08-16 11:47:27.026 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_providers/lxd/lxd_instance.py", line 293, in execute_run
2024-08-16 11:47:27.026 return self.lxc.exec(
2024-08-16 11:47:27.026 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_providers/lxd/lxc.py", line 387, in exec
2024-08-16 11:47:27.026 return runner(final_cmd, timeout=timeout, check=check, **kwargs)
2024-08-16 11:47:27.026 File "/snap/rockcraft/2374/usr/lib/python3.10/subprocess.py", line 526, in run
2024-08-16 11:47:27.026 raise CalledProcessError(retcode, process.args,
2024-08-16 11:47:27.026 subprocess.CalledProcessError: Command '['lxc', '--project', 'rockcraft', 'exec', 'local:rockcraft-maven-sample-chisel-on-amd64-for-amd64-61079577', '--cwd', '/root/project', '--', 'env', 'CRAFT_MANAGED_MODE=1', 'DEBIAN_FRONTEND=noninteractive', 'DEBCONF_NONINTERACTIVE_SEEN=true', 'DEBIAN_PRIORITY=critical', 'CRAFT_PLATFORM=amd64', 'CRAFT_VERBOSITY_LEVEL=BRIEF', 'rockcraft', 'pack']' returned non-zero exit status 1.
2024-08-16 11:47:27.026
2024-08-16 11:47:27.026 The above exception was the direct cause of the following exception:
2024-08-16 11:47:27.026 Traceback (most recent call last):
2024-08-16 11:47:27.026 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_application/application.py", line 541, in run
2024-08-16 11:47:27.026 self.run_managed(platform, build_for)
2024-08-16 11:47:27.026 File "/snap/rockcraft/2374/lib/python3.10/site-packages/craft_application/application.py", line 383, in run_managed
2024-08-16 11:47:27.026 raise craft_providers.ProviderError(
2024-08-16 11:47:27.026 craft_providers.errors.ProviderError: Failed to execute rockcraft in instance.
2024-08-16 11:47:27.026 Full execution log: '/home/vladimirp/.local/state/rockcraft/log/rockcraft-20240816-114556.473928.log'
```
Evaluation history
No evaluation history available.