Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] create using docker runner cache=shared does not find profile #16357

Closed
bmwrightson opened this issue May 29, 2024 · 1 comment · Fixed by #16364
Closed

[bug] create using docker runner cache=shared does not find profile #16357

bmwrightson opened this issue May 29, 2024 · 1 comment · Fixed by #16364
Assignees
Milestone

Comments

@bmwrightson
Copy link

bmwrightson commented May 29, 2024

Describe the bug

When using cache=shared with a docker runner, the profiles are not copied to .conanrunner/profiles as they will be available in the shared .conan2 directory. But the create command has the profiles modified to include the .conanrunner/profiles/ prefix and a numbered suffix (e.g. clang12 becomes .conanrunner/profiles/clang12_0), so they are not found.

From what I can see in the code, for cache=clean or cache=copy, the profiles are copied to .conanrunner/profiles and then inside the container they are copied into ${HOME}/.conan2/profiles/ Which suggests that the prefix should not need to be appended when changing the profile names as they should be available in the conan home profiles directory. Additionally for the shared case they also shouldn't have the numeric suffix added, as the profile hasn't been renamed/copied. In fact if the suffix was not appended at all when copying, I don't think the profile paths would need adjusting in the create command for any of the possible cache options.

How to reproduce it

Follow steps in docs https://docs.conan.io/2/examples/runners/docker/basic.html#examples-runners-docker-basic but change cache=copy to cache=shared in the profile.

My conan version is 2.3.1

@bmwrightson
Copy link
Author

I think changing 98-100 of docker.py from:

                _name = f'{os.path.basename(_profile)}_{i}'
                if raw_profile in raw_arg:
                    raw_args[raw_args.index(raw_arg)] = raw_arg.replace(raw_profile, os.path.join(self.abs_docker_path, '.conanrunner/profiles', _name))

to
_name = f'{os.path.basename(_profile)}'

would work as intended, if there is no need for the numeric suffix.

@memsharded memsharded modified the milestones: 2.5.0, 2.4.0 May 29, 2024
@davidsanfal davidsanfal linked a pull request May 29, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants