Skip to content
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

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

Open
bdshenker opened this issue Dec 3, 2024 · 5 comments · May be fixed by nasa/fprime-tools#236
Open

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

bdshenker opened this issue Dec 3, 2024 · 5 comments · May be fixed by nasa/fprime-tools#236
Assignees
Labels
bug High Priority High Priority issue that needs to be resolved.

Comments

@bdshenker
Copy link
Collaborator

bdshenker commented Dec 3, 2024

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.

@bdshenker bdshenker added the bug label Dec 3, 2024
@LeStarch
Copy link
Collaborator

LeStarch commented Dec 3, 2024

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.

@LeStarch LeStarch closed this as completed Dec 3, 2024
@bdshenker
Copy link
Collaborator Author

bdshenker commented Dec 3, 2024 via email

@LeStarch LeStarch reopened this Dec 3, 2024
@LeStarch
Copy link
Collaborator

LeStarch commented Dec 3, 2024

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

@LeStarch LeStarch changed the title fprime-util impl generates erroneous error when .fpp is invalid fprime-util impl fails to pass environment to impl steps Dec 3, 2024
@LeStarch LeStarch added the High Priority High Priority issue that needs to be resolved. label Dec 3, 2024
@LeStarch
Copy link
Collaborator

LeStarch commented Dec 3, 2024

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.

@nasa nasa deleted a comment from bdshenker Dec 16, 2024
@LeStarch LeStarch self-assigned this Dec 17, 2024
LeStarch added a commit to LeStarch/fprime-tools that referenced this issue Dec 18, 2024
LeStarch added a commit to LeStarch/fprime-tools that referenced this issue Dec 18, 2024
LeStarch added a commit to LeStarch/fprime-tools that referenced this issue Dec 18, 2024
@matt392code
Copy link

  1. fprime-util-fix.py.txt
    The key proposed changes:
  • Add environment parameter handling to the regenerate() method
  • Ensure environment variables from settings.ini are properly passed through
  • Merge with existing environment variables rather than replacing them
  • Pass environment properly in the impl() method
    =====================
  1. fpp-error-handling.py.txt
  • To integrate this into the existing codebase:
  • Add the FPPErrorHandler class to your utilities
  • Modify the impl method to use the new error handling
  • Update the error reporting in the CMake generation step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug High Priority High Priority issue that needs to be resolved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants