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

Remove redundant getenv() calls #2836

Open
morevnaproject opened this issue Sep 27, 2022 · 14 comments · May be fixed by #3327
Open

Remove redundant getenv() calls #2836

morevnaproject opened this issue Sep 27, 2022 · 14 comments · May be fixed by #3327

Comments

@morevnaproject
Copy link
Member

The #2826 PR improved performance by replacing getenv() calls.

Still, there are more getenv() calls remaining. It would be nice to replace them, especially in render engine parts.

JTucker17 added a commit to JTucker17/synfig that referenced this issue Oct 2, 2022
@harshvardhan-khachane
Copy link

Hello, @morevnaproject .
I want to solve this issue.

@ice0
Copy link
Collaborator

ice0 commented Dec 25, 2022

@harshvardhan-khachane

Sure, you can take it.

@harshvardhan-khachane
Copy link

@ice0 While setting up the NetBeans IDE, in the last step (Setting up make configuration, https://synfig-docs-dev.readthedocs.io/en/latest/ide/NetBeans.html), the document says:-
Under Build -> make section change Build result so that it points to “_debug/build/bin/synfigstudio”:
But I need help finding the _debug file or the synfigstudio file in the repository. Please help me with this.

@ice0
Copy link
Collaborator

ice0 commented Dec 25, 2022

@harshvardhan-khachane

What OS you are using?

@harshvardhan-khachane
Copy link

@ice0 I am using Windows

@ice0
Copy link
Collaborator

ice0 commented Dec 25, 2022

In that case you need to use CMake-Windows-MSYS2 toolchain.

https://synfig-docs-dev.readthedocs.io/en/latest/building/Preparing%20Environment.html

After environment is prepared you need to run:
1-setup-windows-msys2.sh to install all dependencies
and
2-build-msys-cmake.sh

After build is complete synfigstudio for NetBeans should be located in cmake-build-msys/output/Release/bin/synfigstudio.exe

Currently autotools build (which is used for netbeans tutorial) is broken, so I will do CMake+NetBeans instruction tomorrow.

@harshvardhan-khachane
Copy link

In that case you need to use CMake-Windows-MSYS2 toolchain.

https://synfig-docs-dev.readthedocs.io/en/latest/building/Preparing%20Environment.html

After environment is prepared you need to run: 1-setup-windows-msys2.sh to install all dependencies and 2-build-msys-cmake.sh

After build is complete synfigstudio for NetBeans should be located in cmake-build-msys/output/Release/bin/synfigstudio.exe

Currently autotools build (which is used for netbeans tutorial) is broken, so I will do CMake+NetBeans instruction tomorrow.

After running the 2-build-msys-cmake.sh the system says : configure: error: unsafe srcdir value

@ice0
Copy link
Collaborator

ice0 commented Dec 26, 2022

Please attach the full build log

@harshvardhan-khachane
Copy link

Here's the complete build log
Going to configure...
running autoreconf...
Done! Please run ./configure now.
/e/Open Source/Synfig/synfig/_debug/ETL
configure: loading site script /etc/config.site
checking whether make supports nested variables... yes
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking target system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... configure: error: unsafe srcdir value: '/e/Open Source/Synfig/synfig/ETL'

@ice0
Copy link
Collaborator

ice0 commented Dec 26, 2022

Are you sure you are running 2-build-msys-cmake.sh?
As I can see on the build log above you are using autotools build, not CMake.

@ice0
Copy link
Collaborator

ice0 commented Dec 26, 2022

This is working settings for CMake build:

image

${CMAKE} -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=${IDE_CC} -DCMAKE_CXX_COMPILER=${IDE_CXX}  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. -DCMAKE_MAKE_PROGRAM=C:\msys64\mingw64\bin\ninja.exe -DMSYS=1 ..

image

image

@harshvardhan-khachane
Copy link

Hey @ice0, As I am a Newbie, I am a bit confused could you please help me with this.
As the issue said: Still, there are more getenv() calls remaining. It would be nice to replace them, especially in render engine parts.
I replaced the getenv() calls with with DEBUG_GETENV(). If I may have gone wrong could you please guide me with the right thing.

@ice0
Copy link
Collaborator

ice0 commented Dec 30, 2022

@harshvardhan-khachane
Hi!
It's not just a find and replace task.
You need to separate the environment variables that are used for debugging purposes and the environment variables that are required for Synfig to work correctly.
This issue is good for getting familiar with the code, but it's still important to understand what's going on.
You can skip it if you like and try again later.

@neesaaa
Copy link
Contributor

neesaaa commented Jan 30, 2024

i can give it a shot

@neesaaa neesaaa mentioned this issue Feb 1, 2024
neesaaa added a commit to neesaaa/synfig that referenced this issue Feb 1, 2024
@neesaaa neesaaa linked a pull request Feb 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants