Skip to content

[FlatPack]: "adafruit-nrfutil": Executable file not found in $PATH #2115

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

Closed
3 tasks done
rei-vilo opened this issue Jun 26, 2023 · 6 comments
Closed
3 tasks done

[FlatPack]: "adafruit-nrfutil": Executable file not found in $PATH #2115

rei-vilo opened this issue Jun 26, 2023 · 6 comments
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system type: imperfection Perceived defect in any part of project type: support OT: Request for help using the project

Comments

@rei-vilo
Copy link

rei-vilo commented Jun 26, 2023

Describe the problem

Arduino IDE 2.0 FlatPak and AppImage

/home/reivilo/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-objcopy -O ihex /home/reivilo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/5CFF790619DC8A9CFB4AC4A8A887325E/Blink.ino.elf /home/reivilo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/5CFF790619DC8A9CFB4AC4A8A887325E/Blink.ino.hex
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0x00B6 --application /home/reivilo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/5CFF790619DC8A9CFB4AC4A8A887325E/Blink.ino.hex /home/reivilo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/5CFF790619DC8A9CFB4AC4A8A887325E/Blink.ino.zip
exec: "adafruit-nrfutil": executable file not found in $PATH

Compilation error: exec: "adafruit-nrfutil": executable file not found in $PATH

With Arduino IDE 1.8.19

adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0x00B6 --application /tmp/arduino_build_731695/Blink.ino.hex /tmp/arduino_build_731695/Blink.ino.zip
Zip created at /tmp/arduino_build_731695/Blink.ino.zip
/home/reivilo/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-size -A /tmp/arduino_build_731695/Blink.ino.elf
Sketch uses 21228 bytes (2%) of program storage space. Maximum is 815104 bytes.
Global variables use 3096 bytes (1%) of dynamic memory, leaving 234472 bytes for local variables. Maximum is 237568 bytes.

To reproduce

  • Select Adafruit Feather nRF52840
  • Launch Verify

Expected behavior

Successful build

Arduino IDE version

2.1.0 FlatPak and AppImage

Operating system

Linux

Operating system version

Linux 450-G5 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux

Additional context

Running the command in a Terminal succeeds.

$ adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application /home/reivilo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/5444C4324CC846FCD36DD91858EE6709/Blink.ino.hex /home/reivilo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/5444C4324CC846FCD36DD91858EE6709/Blink.ino.zip
Zip created at /home/reivilo/.var/app/cc.arduino.IDE2/cache/arduino/sketches/5444C4324CC846FCD36DD91858EE6709/Blink.ino.zip

$ echo $PATH
/home/reivilo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/reivilo/Applications:/home/reivilo/Applications/bin:/home/reivilo/.local/bin:/home/reivilo/Projets/Zephyr/zephyr:/usr/sbin

$ which adafruit-nrfutil
/home/reivilo/Applications/adafruit-nrfutil

Also tested, to no avail

  • Add export PATH=$PATH:/home/reivilo/Applications to .bashrc
  • Add export PATH=$PATH:/home/reivilo/Applications to .bash_profile
  • Set sudo flatpak override cc.arduino.IDE2 --filesystem=/home/reivilo/Applications

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@rei-vilo rei-vilo added the type: imperfection Perceived defect in any part of project label Jun 26, 2023
@kittaakos
Copy link
Contributor

FlatPack IDE2

// CC @joshuag1000

@kittaakos kittaakos changed the title Executable file not found in $PATH "adafruit-nrfutil": Executable file not found in $PATH Jun 26, 2023
@SuperNinja-4965
Copy link

SuperNinja-4965 commented Jun 26, 2023

Hello @rei-vilo,

The cause of this issue (for the flatpak version) is due to the fact that flatpak binaries are run in a sandbox (by design) and so therefore only have limited access to your host system. This includes the path variable.
If you would like to see what paths are included in the $PATH variable on the sandbox you can run:

flatpak run --command="bash" cc.arduino.IDE2

Which will drop you into a command line interface within the sandbox so running:

echo $PATH

Will return the $PATH variable the IDE uses.

For the library to work on flatpak you will either need to put the binary in a folder that is already in the flatpak path or modify the $PATH variable for the app using flatpak override.
PLEASE NOTE: I do not recommend that you modify the flatpak $PATH variable because it could break the app in the future.

What i will do in the mean time is look at either including this binary and library within the flatpak install so the library will work in the future or providing a way for you to give the IDE easy access to the binary if you installed it yourself. However, I cannot give an eta on this other than ASAP.

I do not have a huge amount of knowledge on AppImage applications, however, I do know that they also run within a sandbox and so the sandbox is likely also the issue as to why the external binary cannot be found.

A potential solution for now that probably requires the least amount of work would be to download the zip version of the IDE (which can be downloaded here) as the zip version does not run on any kind of sandbox.

Kind regards,
Joshua.

@SuperNinja-4965
Copy link

@rei-vilo with regards to flatpak this issue should be fixed.
I have pushed an update to the flatpak release that should be available in a few hours.

To use the Adafruit nrfutil boards I have included the adafruit-nrfutil binary within the release.

This means to use these boards all you need to do is add the URL Adafruit provides to the board manager and install the board.
For the flatpak release installing the adafruit-nrfutil pip package is not required.

Please could you double check that this update to the flatpak release fixes your issue (only on the flatpak version as I don't maintain the appimage) and just let me know.

Many thanks,
Joshua

@rei-vilo
Copy link
Author

rei-vilo commented Jun 27, 2023

@joshuag1000 Thank you very much for your detailed answer.

FlatPak sandbox $PATH

Checking $PATH on the sandbox does list home/reivilo/Applications where adafruit-nrfutil is located.

$ flatpak run --command="bash" cc.arduino.IDE2
$ echo $PATH
/app/bin:/usr/bin:/home/reivilo/Applications:/home/reivilo/Applications/bin:/home/reivilo/.local/bin:/home/reivilo/Projets/Zephyr/zephyr:/usr/sbin

Despite adding home/reivilo/Applications with sudo flatpak override cc.arduino.IDE2 --filesystem=/home/reivilo/Applications, it seems it isn't taken into account.

Updated Arduino IDE 2.0 FlatPak

I downloaded the new FlatPak release and build completes successfully.

So I am closing this ticket as solved.

@kittaakos
Copy link
Contributor

Seeing how you solved the problem and cleaned up the open issues was a pleasure. Thank you for both of you

@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Jun 27, 2023
@kittaakos kittaakos changed the title "adafruit-nrfutil": Executable file not found in $PATH [FlatPack]: "adafruit-nrfutil": Executable file not found in $PATH Jun 27, 2023
@kittaakos kittaakos added os: linux Specific to Linux operating system type: support OT: Request for help using the project labels Jun 27, 2023
@SamuTheCoder
Copy link

For those of you who installed Arduino IDE using snap, please reinstall a version from the Arduino's website. I lost hours and hours on this, installed adafruit nrfutil and used symlinks, virtual environments and changing PATH variable and all and it never worked. I don't know what is wrong with the snap version of Arduino, but it seems that it has some trouble with the PATH.

After installing the appimage, I never had this error again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system type: imperfection Perceived defect in any part of project type: support OT: Request for help using the project
Projects
None yet
Development

No branches or pull requests

4 participants