Skip to content

Project Generator needs fixing to work with Env Variables #8302

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

Open
Tracked by #7588
ofTheo opened this issue Feb 28, 2025 · 19 comments
Open
Tracked by #7588

Project Generator needs fixing to work with Env Variables #8302

ofTheo opened this issue Feb 28, 2025 · 19 comments
Assignees

Comments

@ofTheo
Copy link
Member

ofTheo commented Feb 28, 2025

the lastest nightly build, projectGenerator still had trouble with addon_config.mk, can't find and include the source file from include search paths,i.e i'm tested with ofxGStreamer, ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include,it can not find source file and include within the VS2022 project solution

Image

Image

Originally posted by @liquidzym in #7588

@ofTheo
Copy link
Member Author

ofTheo commented Feb 28, 2025

@liquidzym is it stripping out the _ and replacing with spaces?

If you change all GSTREAMER 1 0 ROOT MSVC X86 64 to GSTREAMER_1_0_ROOT_MSVC_X86_64 and the same with OF ROOT to OF_ROOT does it work?

@danoli3
Copy link
Member

danoli3 commented Mar 3, 2025

@dimitre any ideas

@dimitre
Copy link
Member

dimitre commented Mar 3, 2025

I've took a look at the code (I didnt write it) and found this:

			if (containsSourceFiles(normalizedDir)) {

this wont allow this paths to pass because this variables are resolved inside VS, not replaced by PG.
cc: @roymacdonald

@dimitre dimitre removed their assignment Mar 3, 2025
@roymacdonald
Copy link
Contributor

It seems like those _ being stripped out are the problem. The issue seems to be in ofAddon::addReplaceStringVectorPathStr
That is the point where the replacements happen. It is strange though that it does so for OF_ROOT.
Yet, this was working before and now it is not...
cheers

@dimitre
Copy link
Member

dimitre commented Mar 4, 2025

@danoli3 @ofTheo
This path was directly added like this in VS

$(GSTREAMER_1_0_ROOT_MSVC_X86_64)include

and it works from there, because it is an environment variable that is correctly parsed there.

by having a function that checks if a folder is not empty before adding the path

if (containsSourceFiles(normalizedDir)) {

the file is never added because it is not a resolved path for PG.
I think PG didn't use this filter until recently

@roymacdonald
Copy link
Contributor

I see.
I think that that filter was there before. I dont recall adding it. But, then you should have some sort of rule in ofAddon::addReplaceStringVectorPathStr that if it is not able to replace that variable it should leave it untouched and then have the containsSourceFiles function to also return true if the path has a variable in it. I am not sure but I could guess that since it is being treated as a std::filesystem::path rather than a string, it gets messed up at some point.

@dimitre
Copy link
Member

dimitre commented Mar 5, 2025

Oww finally, found the commit introducing this check, so assigning @danoli3
openframeworks/projectGenerator@28d3e24#diff-569e5575fd4a62c1169c6ffe799bea95b381d89eba1756d4f165a9a1b1e681f3

@danoli3
Copy link
Member

danoli3 commented Mar 5, 2025

yeah most likely due to all those insane vs path issues we had back then, shouldn't be too hard to figure out if the value has a env variable they look pretty much the same

@danoli3
Copy link
Member

danoli3 commented Mar 5, 2025

@dimitre could you fix this one though, I am overburdened

@dimitre
Copy link
Member

dimitre commented Mar 5, 2025

@danoli3 sure. This is what I think can fix with the minimum amount of changes.
openframeworks/projectGenerator#616

Anybody else can test this one? @ofTheo @danoli3 ?
No windows machine here.

@ofTheo
Copy link
Member Author

ofTheo commented Mar 6, 2025

@dimitre your fix looked good to me so I merged.
Do we need to do anything in OF/OF to update the submodule?

@liquidzym - this time tomorrow can you check the nightly builds and see if it works for you now?

@dimitre
Copy link
Member

dimitre commented Mar 6, 2025

@ofTheo I've just invoked manual nightly so we will have a new one in 25 minutes.
about OF/OF it should build everything using latest PG.
If anybody can help testing in Windows it would be great.

@NickHardeman
Copy link
Contributor

Testing with the latest nightly on Windows 10 using VS 2022: of_v20250307_vs_64_release
Image

Image

Image

@dimitre
Copy link
Member

dimitre commented Mar 7, 2025

@NickHardeman is this good? maybe fixed?

@ofTheo
Copy link
Member Author

ofTheo commented Mar 8, 2025 via email

@liquidzym
Copy link

@ofTheo sorry just backing to home,the addon_config.mk the include path it has "_" with it ,not too sure why the captured images looks like without on it.
ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include
ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include/gstreamer-1.0
ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include/glib-2.0
ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)lib/glib-2.0/include
ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)lib/gstreamer-1.0/include
ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)lib/gstreamer-1.0/include/gst

@NickHardeman
Copy link
Contributor

@liquidzym I tested this a few days ago and the PG seemed to add the correct paths from the addon_config.mk. Can you test with the latest PG to determine if the issue is resolved please?

@liquidzym
Copy link

@NickHardeman sorry for the multipost i just pasted the output message from PG
#8124 (comment)
not too sure why still get the same issue,but i'll testing it with another computer asap!

@liquidzym
Copy link

liquidzym commented Mar 11, 2025

ok,just did tested with of_v20250311_vs_64_release,same issue,no clue at all,is it because the installed GSTREAMER driver path causing this? but it has env path in the system

Image

Image

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

6 participants