KiCad nightly 5.99 doesn't open files from command line

Hello.

Recently I am testing KiCad v.5.99 and have problem with opening the kicad files from the command line.

KiCad simply ignores the filename specified on the command line and opens the latest open project (kicad-nightly) or empty file (pcbnew-nightly and eeschema-nightly ).

Manjaro Linux, the program have been compiled locally from AUR: https://aur.archlinux.org/packages/kicad-nightly

KiCad 5.1.10 works as intended.

Any help on fixing this?

This opens the schematic and works as expeced:

paul@medion:~/projects/kicad/LED_PT4115_599$ eeschema-nightly LED_PT4115.kicad_sch

Just to be sure that that project was not the last I opened, I then tried another schematic and that also works for me:

paul@medion:~/projects/kicad/mumar_base_stm32_5.99$ eeschema-nightly mumar_base_stm32.kicad_sch

I tested this with:

Application: KiCad Schematic Editor

Version: 5.99.0-unknown-5c21f93803~130~ubuntu20.04.1, release build

Libraries:
	wxWidgets 3.0.4
	libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3

Platform: Linux 5.4.0-77-generic x86_64, 64 bit, Little endian, wxGTK, xfce, x11

Build Info:
	Date: Jun 26 2021 17:35:04
	wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.3.0
	Curl: 7.68.0
	ngspice: 31
	Compiler: GCC 9.3.0 with C++ ABI 1013

Build settings:
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON

Here’s how you check if a program is receiving the correct command line parameters in Linux:

Find the pid of the program that is running. Usually people do

ps -e | grep program

but another way is:

pidof program

Now that you have the pid, do

od -bc /proc/pid/cmdline

because NULs separate the arguments. For example I did this on a process called qmgr and I got:

$ od -bc /proc/32340/cmdline
0000000 161 155 147 162 000 055 154 000 055 164 000 146 151 146 157 000
          q   m   g   r  \0   -   l  \0   -   t  \0   f   i   f   o  \0
0000020 055 165 000
          -   u  \0
0000023

Things that could happen include the program receiving a truncated filename because your filename had whitespace, and there was an intervening shell script that didn’t handle the arguments correctly. Unfortunately KiCad programs don’t print a diagnostic when they cannot open the file but silently open the last opened file.

OK, thanks to your comments, it was diagnosed and fixed.

The problem was that all the “nightly” programs are actually shell scripts of type:

#!/bin/sh
. /usr/share/kicad-nightly/kicad-nightly.env
exec /usr/lib/kicad-nightly/bin/kicad

So, they ignored the command line at all. So, after adding “$@” after the program name, everything works fine now!

My Linux Mint box already has that “$@”, and I did not add that myself:

paul@medion:/usr/share/kicad-nightly$ cat /usr/bin/kicad-nightly
#!/bin/sh
. /usr/share/kicad-nightly/kicad-nightly.env
/usr/lib/kicad-nightly/bin/kicad “$@”

Are you using another Linux distribution?
I think this is a bug in the packaging for your Linux distribution, and should be reported on gitlab, so it can also be fixed for others using that same distribution.

Are you using another Linux distribution?

Yes, Manjaro Linux - in fact, it is Arch Linux derivation.

I suggest you make a comment requesting that change here: https://aur.archlinux.org/packages/kicad-nightly/

DX-MON (the maintainer) is very responsive and will likely implement it.

Done. :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.