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

Major regression!! - Nightly OF/OF release not generating project files #565

Closed
ofTheo opened this issue Aug 20, 2024 · 19 comments
Closed

Comments

@ofTheo
Copy link
Member

ofTheo commented Aug 20, 2024

I am guessing this is a PG issue but the current OF nightly release isn't making project files.

image

Not sure if this is connected to #555 or #554

In the nightly log I see:

Compiling projectGenerator for Debug
make[1]: Entering directory '/home/runner/work/openFrameworks/openFrameworks/apps/projectGenerator/commandLine'
💿 Using CCACHE -- config.project.mk 
make[2]: warning: -j2 forced in submake: resetting jobserver mode.
make[2]: Entering directory '/home/runner/work/openFrameworks/openFrameworks/apps/projectGenerator/commandLine'
make[2]: Leaving directory '/home/runner/work/openFrameworks/openFrameworks/apps/projectGenerator/commandLine'
make[2]: warning: -j2 forced in submake: resetting jobserver mode.
make[2]: Entering directory '/home/runner/work/openFrameworks/openFrameworks/apps/projectGenerator/commandLine'
cp ../../../libs/*/lib/linux64/*.so bin/ ; true

     compiling done
     to launch the application

     cd bin
     ./projectGenerator_debug
     
     - or -
     
     make RunDebug


make[2]: Leaving directory '/home/runner/work/openFrameworks/openFrameworks/apps/projectGenerator/commandLine'
make[1]: Leaving directory '/home/runner/work/openFrameworks/openFrameworks/apps/projectGenerator/commandLine'
Creating project files for osx
projectGenerator does not exist. Continue.

which corresponds to these lines:

        if [ -f "${main_ofroot}/apps/projectGenerator/commandLine/bin/projectGenerator" ]; then
            echo "projectGenerator exists..."
            ${main_ofroot}/apps/projectGenerator/commandLine/bin/projectGenerator --recursive -p${pg_platform} -o$pkg_ofroot $pkg_ofroot/examples > /dev/null
        else
            echo "projectGenerator does not exist. Continue."
        fi

https://github.com/openframeworks/openFrameworks/blob/master/scripts/dev/create_package.sh#L196-L201

Maybe the pg is not building as projectGenerator but commandLine?

cc @danoli3 @dimitre

@ofTheo
Copy link
Member Author

ofTheo commented Aug 20, 2024

Okay I listed what's in the commandLine.bin/ folder and its due the the debug being added to the end of the name.

make[1]: Leaving directory '/home/runner/work/openFrameworks/openFrameworks/apps/projectGenerator/commandLine'
Creating project files for linux64
projectGenerator does not exist. Continue.
libfmod.so
projectGenerator_debug

I think as a quick fix I will change it to use the release build so it will generate projectGenerator instead of projectGenerator_debug

Note: the regression probably originated in this submodule, but I think it's fine to correct the create_package script and it should speed up the nightly build package generation step.

@dimitre
Copy link
Member

dimitre commented Aug 20, 2024

Maybe it is because of make Debug commands here
but I'm not famliar with the script

https://github.com/openframeworks/openFrameworks/blob/37fd61b2ccf5d3bf0fdac1f01c11bf0ab0f3dd68/scripts/dev/create_package.sh#L178-L185

@ofTheo
Copy link
Member Author

ofTheo commented Aug 20, 2024

Thanks @dimitre - it's now seeing the PG but now the error seems related to PG generation itself.

projectGenerator exists...
terminate called after throwing an instance of 'nlohmann::json_abi_v3_11_2::detail::type_error'
  what():  [json.exception.type_error.305] cannot use operator[] with a string argument with array
/home/runner/work/openFrameworks/openFrameworks/scripts/dev/create_package.sh: line 173: 19493 Aborted                 (core dumped) ${main_ofroot}/apps/projectGenerator/commandLine/bin/projectGenerator --recursive -p${pg_platform} -o$pkg_ofroot $pkg_ofroot/examples > /dev/null
Error on or near line 198; exiting with status 1

I believe this:

terminate called after throwing an instance of 'nlohmann::json_abi_v3_11_2::detail::type_error'
  what():  [json.exception.type_error.305] cannot use operator[] with a string argument with array 

might be to do with the pg args or the Xcode project file parsing.

The relevant line in the script:

            ${main_ofroot}/apps/projectGenerator/commandLine/bin/projectGenerator --recursive -p${pg_platform} -o$pkg_ofroot $pkg_ofroot/examples > /dev/null

@dimitre
Copy link
Member

dimitre commented Aug 20, 2024

we should change <json.hpp> to <nlohmann/json.hpp> inside pg
related:
openframeworks/openFrameworks#8082

@dimitre
Copy link
Member

dimitre commented Aug 20, 2024

#566

@ofTheo
Copy link
Member Author

ofTheo commented Aug 20, 2024

Thanks @dimitre - #566 probably doesn't fix the error I was seeing right?
Just something that needed updating?

@dimitre
Copy link
Member

dimitre commented Aug 21, 2024

Right. I didnt' read with attention and thought it was the case.
I was puzzled by the error and about the what() explanation, so I'm trying to find exceptions that only echoes e.what() and detail them more, so we know where the error is.

@dimitre
Copy link
Member

dimitre commented Aug 21, 2024

ok solved finally haha

@dimitre
Copy link
Member

dimitre commented Aug 21, 2024

it seems now to be generating, but for some reason they are not readable by xcode.
from what I'm seeing the only change is an extra pair of [ ] enclosing the entire json
nlohmann json seems to have changed recently

edit: confirmed. if we strip the [ ] in the begin and end of the file everything works correctly

@danoli3
Copy link
Member

danoli3 commented Aug 21, 2024

xcode project reading needs no comments in the file, if any change to the xcode project that adds any comments or symbols that are not json it will fail

@danoli3
Copy link
Member

danoli3 commented Aug 21, 2024

there are no changes to json headers since December 2023. where release is
image

@danoli3
Copy link
Member

danoli3 commented Aug 21, 2024

exit failure on linux when trying to backup .vscode

@danoli3
Copy link
Member

danoli3 commented Aug 21, 2024

working on fixes.
looks like errors with addons and all sorts of cmdLine pg stuff

@ofTheo
Copy link
Member Author

ofTheo commented Aug 21, 2024

Just to confirm what @dimitre mentioned.
I just ran a manual nightly build and the project files are there now, but Xcode project.pbxproj contents is wrapped with the extra [ ].

Removing that it all works fine.

Could be related to this:
nlohmann/json#2583 (comment)

Creates a JSON value of type array or object from the passed initializer 
     list @a init. In case @a type_deduction is `true` (default), the type of 
     the JSON value to be created is deducted from the initializer list @a init 
     according to the following rules: 
  
     1. If the list is empty, an empty JSON object value `{}` is created. 
     2. If the list consists of pairs whose first element is a string, a JSON 
        object value is created where the first elements of the pairs are 
        treated as keys and the second elements are as values. 
     3. In all other cases, an array is created. 

So maybe 3) is happening where as we want 1)?

A quick fix would be to manually remove the first and last lines of the pbxproj if they contain a [ or ]

@dimitre
Copy link
Member

dimitre commented Aug 21, 2024

yes or use something along the lines j[0].dump

@dimitre
Copy link
Member

dimitre commented Aug 21, 2024

I had to change PG to detect '[' and usse dump accordingly.
it seems to fix nightly I've just downloaded and it is opening ok.
the issue is, nlohmann::json is behaving differently in different systems or versions(I think) so we have to consider both possible outputs.

@dimitre
Copy link
Member

dimitre commented Aug 22, 2024

maybe related: nlohmann/json#4320

@ofTheo
Copy link
Member Author

ofTheo commented Aug 22, 2024

@dimitre that issue definitely seems related! good find!!
I'll close this issue for now - thanks for the fix!!

@ofTheo ofTheo closed this as completed Aug 22, 2024
@ofTheo
Copy link
Member Author

ofTheo commented Aug 22, 2024

closed by #568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants