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

Incorrect way of enabling stub extensions #2362

Open
k0T0z opened this issue Nov 11, 2023 · 7 comments
Open

Incorrect way of enabling stub extensions #2362

k0T0z opened this issue Nov 11, 2023 · 7 comments
Labels
Good First Issue Something considered solvable by a novice contributor.

Comments

@k0T0z
Copy link
Contributor

k0T0z commented Nov 11, 2023

Currently, when you need to enable a stub for an extension, you will have to create a separate code for it inside the Engine makefile like here:

# If DataStructures extension not enabled, enable DataStructures stub.
ifeq (,$(findstring Universal_System/Extensions/DataStructures, $(EXTENSIONS)))
include Universal_System/StubExtensions/DataStructures/Makefile
endif

and here:

# If Steamworks extension not enabled, enable Steamworks stub.
# Else build the fake library.
ifeq (,$(findstring Universal_System/Extensions/Steamworks, $(EXTENSIONS)))
include Universal_System/StubExtensions/Steamworks/Makefile
else
compile_game: $(STEAM_FAKE_LIB)
clean: steam_clean
endif

This is incorrect and unnecessary, I would like to loop over all the extensions and enable its stub if the extension is disabled and the stub exists.

@JoshDreamland JoshDreamland added the Good First Issue Something considered solvable by a novice contributor. label Nov 11, 2023
@evil-user
Copy link

@k0T0z @JoshDreamland is there any advantage by implementing this change i see only 2 extensions in the makefile .

@JoshDreamland
Copy link
Member

JoshDreamland commented Nov 30, 2023

@evil-user this is a sort of technical debt payoff; it's not as though this issue will kill us, which is why we marked it a "Good First Issue" and left it alone. It's just a little bit of an ugly hack in the way we do makefiles. As Saif said, the better way is to do $(wildcard) matching with $(addprefix) / $(addsuffix) on the $(EXTENSIONS) variable to filter for makefiles that exist under each extension folder. A relatively simple change that a prospective contributor just needs to implement and verify before checking it in.

@k0T0z
Copy link
Contributor Author

k0T0z commented Nov 30, 2023

@evil-user As Josh said, I have nothing to add. The 2nd main purpose of this change is to reduce the number of changes needed for the makefile as making too many changes is error-prone. Also, note that I removed these two lines inside my last PR #2363:

 compile_game: $(STEAM_FAKE_LIB) 
 clean: steam_clean 

to be:

 ifeq (,$(findstring Universal_System/Extensions/Steamworks, $(EXTENSIONS))) 
 include Universal_System/StubExtensions/Steamworks/Makefile 
 endif 

So Steamworks extension is not a special case anymore.

@Daksh-10
Copy link

@JoshDreamland @k0T0z
I tried to change the below code
https://github.com/enigma-dev/enigma-dev/blob/3918af3dc40734465b355a7d52cb9f9f93f5a8d6/ENIGMAsystem/SHELL/Makefile#L124C1-L137C1

to
image

So how in makefile can I test the changes, I tried to learn it, but was not able to understand it

@k0T0z
Copy link
Contributor Author

k0T0z commented Dec 20, 2023

@Daksh-10 You will have to try to build ENIGMA with all those extensions that have a stub enabled, which are basically: DataStructure and Steamworks. Also, you may have to build Steamworks from that branch (k0T0z:flushing-steamworks-ext) as it has important changes to this makefile. To avoid some errors just work on top of my PR: (#2363). I mean create a new PR with my PR merged into it.

@Daksh-10
Copy link

@k0T0z, about this issue I found some things,
First, these are the enabled extensions when compiling
image
Second, as there is 'DataStructures' extension , so we dont need to enable its stub it works without it, so we can don't need to include its stub
Third, I tried the wildcard method and asked for a pull request on your branch (k0T0z:flushing-steamworks-ext), it doesn't seem to be working, but it was a valiant effort and I can change it, after giving some time to it

So, is there anything I can do now. (Also there were reasons why I was not contributing, which we can discuss on discord)

@aryankumar899
Copy link

I want to contribute your issue please approach me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Something considered solvable by a novice contributor.
Projects
None yet
Development

No branches or pull requests

5 participants