nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
10.11k stars 1.32k forks source link

fprime-util impl fails to pass environment to `impl` steps #3055

Open bdshenker opened 1 day ago

bdshenker commented 1 day ago
F´ Version
Affected Component

Problem Description

When the user runs fprime-util impl on an ungenerated repo, the CMake regenerate step does not receive the environment specified in settings.ini.

To reproduce:

  1. Add an environment variable to settings.ini: [environment]
  2. Regenerate
  3. cd <some component>
  4. touch *.fpp
  5. fprime-util impl --verbose
  6. Inspect passed environment, and notice missing environment.

Old Description

When .fpp file in Components/ directory has a syntax error and I try to run fprime-util impl, I am getting the following error:

CMake Error at lib/fprime-vxworks/cmake/toolchain/vxworks.cmake:16 (message):
-- Configuring incomplete, errors occurred!
  User must define environment variable WIND_CC_SYSROOT
Call Stack (most recent call first):
  build-fprime-automatic-vxworks/CMakeFiles/3.26.4/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:7 (project)

There is no reference to the actual .fpp file which has a syntax error.

Context / Environment

Execute fprime-util version-check and share the output.

Operating System: Linux
CPU Architecture: x86_64
Platform: Linux-6.8.0-49-generic-x86_64-with-glibc2.39
Python version: 3.12.3
CMake version: 3.26.4
Pip version: 24.0

How to Reproduce

  1. Create valid .fpp file in Components/
  2. Run fprime-util impl. Success.
  3. Next, corrupt this .fpp file by, say, replacing "sync input" with simply "input".
  4. Run fprime-util impl and observe the error message.

Expected Behavior

We expect error message to point to the invalid .fpp file as a source of error.

LeStarch commented 1 day ago

The error is above " User must define environment variable WIND_CC_SYSROOT". This implies that the environment is not set up correctly. Check with your project to ensure your environment is correct.

bdshenker commented 1 day ago

Even though “fprime_util impl” runs with no errors when FPP file is valid in the same environment? Thanks,

From: M Starch @.> Sent: Tuesday, December 3, 2024 12:42 PM To: nasa/fprime @.> Cc: Shenker, Boris D (US 348C) @.>; Author @.> Subject: [EXTERNAL] Re: [nasa/fprime] fprime-util impl generates erroneous error when .fpp is invalid (Issue #3055)

The error is above " User must define environment variable WIND_CC_SYSROOT". This implies that the environment is not set up correctly. Check with your project to ensure your environment is correct.

— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https:/github.com/nasa/fprime/issues/3055*issuecomment-2515510439__;Iw!!PvBDto6Hs4WbVuu7!KNMppb3k2Kv45YoweX4Sd3hXoNtPcwehCbf3d8B1fKHAD7GfTJJpP_ZDLaY8WOLsJrCS2GIRFB64605Jx9rl-UW-Ga-zuz2Eyw$, or unsubscribehttps://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/AW762GK4F7W64DK6GL3KOTL2DYJRXAVCNFSM6AAAAABS6JS5YKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJVGUYTANBTHE__;!!PvBDto6Hs4WbVuu7!KNMppb3k2Kv45YoweX4Sd3hXoNtPcwehCbf3d8B1fKHAD7GfTJJpP_ZDLaY8WOLsJrCS2GIRFB64605Jx9rl-UW-Ga-ISzSixw$. You are receiving this because you authored the thread.Message ID: @.**@.>>

LeStarch commented 1 day ago

I am told that this is perhaps a real issue. @kevin-f-ortega this is a problem in fprime-vxworks.

bdshenker commented 1 day ago

[like] Shenker, Boris D (US 348C) reacted to your message:


From: M Starch @.> Sent: Tuesday, December 3, 2024 9:10:25 PM To: nasa/fprime @.> Cc: Shenker, Boris D (US 348C) @.>; Author @.> Subject: [EXTERNAL] Re: [nasa/fprime] fprime-util impl generates erroneous error when .fpp is invalid (Issue #3055)

I am told that this is perhaps a real issue. @kevin-f-ortegahttps://urldefense.us/v3/__https://github.com/kevin-f-ortega__;!!PvBDto6Hs4WbVuu7!IqwDlLdbM9yh90lLgujjuWYnux-lHyd0bpt0Iv0xwgSCgvLZrYOac4chvN6Rs6rEzYqyFLxogWmyN2YdLn0TLPmPi54BCfK_9w$ this is a problem in fprime-vxworks.

— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https://github.com/nasa/fprime/issues/3055*issuecomment-2515556711__;Iw!!PvBDto6Hs4WbVuu7!IqwDlLdbM9yh90lLgujjuWYnux-lHyd0bpt0Iv0xwgSCgvLZrYOac4chvN6Rs6rEzYqyFLxogWmyN2YdLn0TLPmPi56XnNevDQ$, or unsubscribehttps://urldefense.us/v3/__https://github.com/notifications/unsubscribe-auth/AW762GPBWFW62DHH52W7BZ32DYM4DAVCNFSM6AAAAABS6JS5YKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJVGU2TMNZRGE__;!!PvBDto6Hs4WbVuu7!IqwDlLdbM9yh90lLgujjuWYnux-lHyd0bpt0Iv0xwgSCgvLZrYOac4chvN6Rs6rEzYqyFLxogWmyN2YdLn0TLPmPi57JxfeO-w$. You are receiving this because you authored the thread.Message ID: @.***>

LeStarch commented 22 hours ago

This bug affects all cases where fprime-util refreshes the cache itself, rather than letting a build target check and rerun it. This most commonly affects FPP code.

Also note: work around is to run fprime-util build to restore the cache state itself before running a command which might regenerate the cache.