mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl via ptxdist <ptxdist@pengutronix.de>
To: Rug Ros <rug2ros@gmail.com>
Cc: Alexander Dahl <ada@thorsis.com>, ptxdist@pengutronix.de
Subject: Re: [ptxdist] Possible bug while compiling the kernel sourced via lndir://
Date: Fri, 20 Nov 2026 09:22:00 +0100	[thread overview]
Message-ID: <20261120-enlarged-treachery-fa0eb139821a@thorsis.com> (raw)
In-Reply-To: <20261120083307.3f89ec27@laptop-RR>

Hello,

Am Fri, Nov 20, 2026 at 08:33:07AM +0100 schrieb Rug Ros:
> Hello,
> 
> n order to make some changes to a device driver, I sourced the kernel via
> an lndir:// URL. The kernel compilation itself succeeds, but the
> kernel.compile stage subsequently fails with the following error: 

When developing in out-of-tree projects I usually do it with `ptxdist
local-src` and for the kernel this would be for example:

    ptxdist clean kernel
    ptxdist local-src kernel ~/src/linux/vanilla
    ptxdist oldconfig kernel

Works fine for me with kernel and other packages.  This command is
documented only briefly with `ptxdist help` and somewhat more
extensive in section "6.1 Using an Externel Kernel Source Tree" in
documentation [1].  Not sure, but I guess you tried something else?

Greets
Alex

[1] https://ptxdist.org/doc/daily_work_section.html#using-an-external-kernel-source-tree
> 
> make: Leaving directory '/home/ruggero/phytec/i.MX6Linux/i.MX6Linux.newKernel/platform-phyFLEX-i.MX6/build-target/linux-6.12.96'
> sed: can't read /home/ruggero/phytec/i.MX6Linux/i.MX6Linux/platform-phyFLEX-i.MX6/build-target/linux-6.12.96/compile_commands.json:
> No such file or directory 
> make: ***[/home/ruggero/phytec/i.MX6Linux/i.MX6Linux/rules/kernel.make:276:
> /home/ruggero/phytec/i.MX6Linux/i.MX6Linux/platform-phyFLEX-i.MX6/state/kernel.compile]
> Error 2
> 
> 
> I traced the issue to ptxd_make_world_compile_commands_filter() in
> ptxd_make_world_compile_commands.sh:
> 
> In this function the file compile_commands.json is modified using sed, and
> the source is handled properly (variable ${src_cmds}).
> 
> If sed succeeds, ptxd_make_world_compile_commands_cleanup() is called.
> 
> However, ptxd_make_world_compile_commands_cleanup() runs sed on
> "${pkg_dir}/compile_commands.json". While that path is valid for regular
> builds, it points to the wrong location when using an lndir:// URL.
> 
> As a workaround, I passed the resolved path as a parameter to
> ptxd_make_world_compile_commands_cleanup() and updated its second call
> site in ptxd_make_world_compile.sh accordingly.
> 
> I have attached a patch with my changes for reference.
> 
> Best regards
> 
> Ruggero

> diff -Naur /mnt/tmp/usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile.sh /usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile.sh
> --- /mnt/tmp/usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile.sh	2026-06-27 13:07:38.000000000 +0000
> +++ /usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile.sh	2026-11-19 15:37:54.949219877 +0000
> @@ -164,7 +164,7 @@
>  		    print "\n]"
>  		}'
>  	} > "${pkg_dir}/compile_commands.json" &&
> -	ptxd_make_world_compile_commands_cleanup
> +	ptxd_make_world_compile_commands_cleanup "${pkg_dir}/compile_commands.json"
>      fi
>  }
>  export -f ptxd_make_world_compile_finish
> diff -Naur /mnt/tmp/usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile_commands.sh /usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile_commands.sh
> --- /mnt/tmp/usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile_commands.sh	2026-06-27 13:07:38.000000000 +0000
> +++ /usr/local/lib/ptxdist-2026.07.0/scripts/lib/ptxd_make_world_compile_commands.sh	2026-11-19 15:38:31.841776180 +0000
> @@ -12,7 +12,7 @@
>  ptxd_make_world_compile_commands_cleanup() {
>      sed -i \
>  	-e 's/ *-fno-diagnostics-show-caret//g' \
> -	"${pkg_dir}/compile_commands.json"
> +	"${1}"
>  }
>  export -f ptxd_make_world_compile_commands_cleanup
>  
> @@ -44,7 +44,7 @@
>  	-e "s#\(\"command\": \" *[^ ]*\(gcc\|clang\) \)#\1 ${PTXDIST_CROSS_CPPFLAGS} ${pkg_cflags} #" \
>  	-e "s#\(\"command\": \" *[^ ]*++ \)#\1 ${PTXDIST_CROSS_CPPFLAGS} ${pkg_cxxflags} #" \
>  	"${src_cmds}" > "${dst_cmds}" &&
> -    ptxd_make_world_compile_commands_cleanup
> +    ptxd_make_world_compile_commands_cleanup "${src_cmds}"
>  }
>  export -f ptxd_make_world_compile_commands_filter
>  




      parent reply	other threads:[~2026-11-20  8:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  7:33 Rug Ros
2026-11-20  7:48 ` Michael Olbrich
2026-11-20  8:59   ` Rug Ros
2026-11-20  8:22 ` Alexander Dahl via ptxdist [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120-enlarged-treachery-fa0eb139821a@thorsis.com \
    --to=ptxdist@pengutronix.de \
    --cc=ada@thorsis.com \
    --cc=rug2ros@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox