[libcamera-devel,v2,19/19] py: Use ln --relative to create symlinks
diff mbox series

Message ID 20220524114610.41848-20-tomi.valkeinen@ideasonboard.com
State Accepted
Headers show
Series
  • More misc Python patches
Related show

Commit Message

Tomi Valkeinen May 24, 2022, 11:46 a.m. UTC
We create symlinks from the Python bindings build dir to the source dir
so that 1) the build dir can be used to use the bindings, and 2) to
allow modifications of the source .py files to be used right away
without rebuilding.

The symlinks were recently fixed and changed to use absolute paths.
However, absolute paths ruin one main use case I have: using the
bindings from the build dir via nfs from an ARM device.

So move back to relative paths, but accomplish this with the --relative
parameter for ln, instead of guessing the right relative path as was
done before the above-mentioned fix.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 src/py/libcamera/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart May 27, 2022, 10:54 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Tue, May 24, 2022 at 02:46:10PM +0300, Tomi Valkeinen wrote:
> We create symlinks from the Python bindings build dir to the source dir
> so that 1) the build dir can be used to use the bindings, and 2) to
> allow modifications of the source .py files to be used right away
> without rebuilding.
> 
> The symlinks were recently fixed and changed to use absolute paths.
> However, absolute paths ruin one main use case I have: using the
> bindings from the build dir via nfs from an ARM device.
> 
> So move back to relative paths, but accomplish this with the --relative
> parameter for ln, instead of guessing the right relative path as was
> done before the above-mentioned fix.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/py/libcamera/meson.build | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
> index e0010353..3219d3df 100644
> --- a/src/py/libcamera/meson.build
> +++ b/src/py/libcamera/meson.build
> @@ -84,11 +84,11 @@ pycamera = shared_module('_libcamera',
>  # Create symlinks from the build dir to the source dir so that we can use the
>  # Python module directly from the build dir.
>  
> -run_command('ln', '-fsT', files('__init__.py'),
> +run_command('ln', '-fsrT', files('__init__.py'),
>              meson.current_build_dir() / '__init__.py',
>              check: true)
>  
> -run_command('ln', '-fsT', meson.current_source_dir() / 'utils',
> +run_command('ln', '-fsrT', meson.current_source_dir() / 'utils',
>              meson.current_build_dir() / 'utils',
>              check: true)
>

Patch
diff mbox series

diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
index e0010353..3219d3df 100644
--- a/src/py/libcamera/meson.build
+++ b/src/py/libcamera/meson.build
@@ -84,11 +84,11 @@  pycamera = shared_module('_libcamera',
 # Create symlinks from the build dir to the source dir so that we can use the
 # Python module directly from the build dir.
 
-run_command('ln', '-fsT', files('__init__.py'),
+run_command('ln', '-fsrT', files('__init__.py'),
             meson.current_build_dir() / '__init__.py',
             check: true)
 
-run_command('ln', '-fsT', meson.current_source_dir() / 'utils',
+run_command('ln', '-fsrT', meson.current_source_dir() / 'utils',
             meson.current_build_dir() / 'utils',
             check: true)