Skip to content

Conversation

@smuzaffar
Copy link
Collaborator

@smuzaffar smuzaffar commented Jan 14, 2026

This PR proposes to change the default build location when docker is used. Currently build with docker uses /sw and the new relocate all change will try to relocate all file with /sw in them. As /sw is very generic so there is a good chance that relocation script can do unwanted changes. This PR proposes to change default workdir inside container to /container/bits/sw e.g. we mount <host>/workdir to /container/bits/sw.

A new command-line option --container-use-workdir is also added which will mount <host>/workdir to <host>/workdir inside container. This allows to have local packages build with correct path and one should be able to use them directly (on correct OS/ARCH host) or start a container without explicitly mounting <host>/workdir to some magic /container/bits/sw path.

@smuzaffar smuzaffar changed the title Use /docker/bits/build as base directory instead of /sw when build in docker Use /docker/bits/build as base directory instead of / when build in docker Jan 14, 2026
@smuzaffar
Copy link
Collaborator Author

by the way @ktf , was there any specific reason to build under /sw in docker? Currently the local build area is only usable if one starts docker and explicitly mount $WORK_DIR:/sw. Why not mount $WORK_DIR as it is under docker -v $WORK_DIR:$WORK_DIR?

@ktf
Copy link
Collaborator

ktf commented Jan 15, 2026

I think it was to keep the path short, because at some point our $WORK_DIR was a very long path to a temporary directory.

@ktf
Copy link
Collaborator

ktf commented Jan 15, 2026

Please, do not use /docker since I am about to introduce some "non docker" container backend.

@smuzaffar
Copy link
Collaborator Author

Please, do not use /docker since I am about to introduce some "non docker" container backend.

sure
I would like to use -v $WORK_DIR:$WORK_DIR so that the local build area is usable but if you want to have a fixed short path inside docker then may be we can add a command-line option --docker-use-workdir which uses -v $WORK_DIR:$WORK_DIR otherwise use -v $WORK_DIR:/container/bits/build ?

@ktf
Copy link
Collaborator

ktf commented Jan 15, 2026

Sounds good to me.

@smuzaffar smuzaffar force-pushed the docker-build-basedir branch from 2e1b8ac to 078b5e1 Compare January 15, 2026 13:57
@smuzaffar smuzaffar changed the title Use /docker/bits/build as base directory instead of / when build in docker Support for using host workdir inside container also change default build dir to /container/bits/sw Jan 15, 2026
@smuzaffar
Copy link
Collaborator Author

I have updated the PR and its description. Now default workdir inside container is /container/bits/sw . also added --container-use-workdir to use host's workdirectory inside container

@smuzaffar smuzaffar changed the title Support for using host workdir inside container also change default build dir to /container/bits/sw Support for using host workdir inside container; change default container workdir to /container/bits/sw Jan 15, 2026
@ktf ktf merged commit 8bff163 into main Jan 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants