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

mod_mod : The Modening #83

Merged
merged 26 commits into from Apr 13, 2019
Merged

mod_mod : The Modening #83

merged 26 commits into from Apr 13, 2019

Conversation

20kdc
Copy link
Contributor

@20kdc 20kdc commented Apr 9, 2019

Rearchitecture of module system. I'm not sure this is really refined enough, but vifino would like it as a PR so it gets a PR.
This also includes mod_farbherd since this was derived from that.
In particular I'm concerned about what happens to the CI on Mac OS X.
Advantages:

  1. Good basis for further work on any form of module management system, including meta-modules that run VMs (mod_nes_nrom256, anyone?) and the like. Also, mod_farbherd and similar 'video as module' components.
  2. I tried to clean up what I could along the way. Not sure I really succeeded, and I'm sure my comments will be out of date within the week, but... I tried?
  3. I've made it so you can apply the available filters multiple times without requiring a way to double-load dynamic libraries.

(EDIT : dammit markdown stop messing with my numbers)

Disadvantages: REALLY BIG ONES.

  1. Blows up hilariously on CI / Mac OS X for no reason.
  2. Other potential for unknown explosions.
  3. k2link is mandatory to bootstrap this whole thing.
    Y'know, the system based off of a shell script.
    It's at LEAST mandatory for mod_dl.
  4. Because k2link is mandatory, you get to deal with the dependency graph mess that results.
    You'll need to "make clean" often, for starters...
  5. Any filter modules that didn't get caught in my own rewrites need modification. You should be able to see the pattern easily enough, but...
  6. I modified ASL along the way to make the API simpler, but this means for anyone using ASL, your compatibility is now broken. It's not complex to fix but it'll annoy people.

This fixes #66.

vifino and others added 22 commits March 24, 2019 13:50
Needs tons of cleanup, eventually, but apparently we're on a time limit.
I'll be sending this commit on data, so further communications will not be
 present until tomorrow.
This only works with STATIC=1 right now, with a limited set of modules.
Modules which will need PARTICULAR work are filters.
All filters need to be properly setup with PGCTX stuff.
Luckily, PGCTX also reduces the amount of boilerplate code for you.
PGCTX macros are defined in plugin.h, also, stop using mod.h
 when you mean plugin.h, which includes mod.h anyway now.
Of these, I've only *fully* tested flt_rot_90 because I did major changes there
This won't help the CI problems, unfortunately...
... is there a way to get better traces from that?
This reverts commit 1f57069.
Reason: I'm very stupid and need to sleep. - 20kdc
Finally, we're back where we started
@vifino vifino requested a review from fridtjof April 9, 2019 21:05
@vifino vifino added the enhancement Enhancement suggestions to the project. label Apr 9, 2019
@vifino vifino added this to In progress in Core Apr 9, 2019
@fridtjof
Copy link
Member

I couldn't verify the macOS issues on my machine, let's see what CI says again

@vifino
Copy link
Member

vifino commented Apr 10, 2019

@fridtjof any luck?

@fridtjof
Copy link
Member

fridtjof commented Apr 10, 2019

Seems like there's a memleak on linux now. macOS looks fine though

@20kdc
Copy link
Contributor Author

20kdc commented Apr 11, 2019

...Does the CI build actually have debug symbols?
CFLAGS = -fsanitize=address,undefined might be eliminating them.
It'd be very useful if AddressSanitizer could return precise debug information...

@20kdc
Copy link
Contributor Author

20kdc commented Apr 11, 2019

...actually, the debug info is added with:
CFLAGS += -Og -ggdb
so it should remain intact. New theory: The stacktraces just can't handle mod_dl.
In this case, is there a way to get library base addresses out of dl?
It's a more manual process but will help for tracking down the responsible module.

@vifino
Copy link
Member

vifino commented Apr 11, 2019

Well, we could log the addresses the libraries get loaded at with dlopen, that could help.

@vifino vifino mentioned this pull request Apr 13, 2019
Copy link
Member

@vifino vifino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking at this again, I spotted some small things.
You've done awesome work, @20kdc.

@@ -35,7 +35,7 @@ BGMMODS_DEFAULT += bgm_fish bgm_pixelflut
FLTMODS_DEFAULT += flt_gamma_correct flt_flip_x flt_flip_y flt_scale flt_rot_90
FLTMODS_DEFAULT += flt_smapper flt_channel_reorder

MODULES_DEFAULT += $(BGMMODS_DEFAULT) $(FLTMODS_DEFAULT) $(GFXMODS_DEFAULT)
MODULES_DEFAULT += $(BGMMODS_DEFAULT) $(FLTMODS_DEFAULT) $(GFXMODS_DEFAULT) mod_farbherd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ugly, I propose this.

Suggested change
MODULES_DEFAULT += $(BGMMODS_DEFAULT) $(FLTMODS_DEFAULT) $(GFXMODS_DEFAULT) mod_farbherd
LOADERS_DEFAULT := mod_farbherd
MODULES_DEFAULT += $(BGMMODS_DEFAULT) $(FLTMODS_DEFAULT) $(GFXMODS_DEFAULT) $(LOADERS_DEFAULT)


ifeq ($(OS),Linux)
src/modules/mod_dl.c.libs:
echo -ldl > src/modules/mod_dl.c.libs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually mod_dl.c.libs and not mod_dl.libs?

$(MODULES_WC) src/slloadcore.gen.c: $(MODULES_C) static/kslink
cd static ; ./kslink $(addsuffix .c, $(addprefix ../src/modules/, $(MODULES))) > ../src/slloadcore.gen.c
src/modules/mod_dl.c.libs:
echo "" > src/modules/mod_dl.c.libs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

}

void asl_test_av_validity(asl_av_t * self) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test supposed to be in at all times?
We might wanna make this CIMODE only and run it if possible.

Unit testing sled, huh..

@fridtjof
Copy link
Member

Before merging this, I'd like to match the macOS versions built against on travis and azure pipelines, to identify on which versions it fails to build.

@fridtjof
Copy link
Member

However, Azure Pipelines doesn't have a build agent for macOS 10.12. This is the version that travis builds are failing on. This means we will have to either:

  • drop macOS < 10.13 or
  • investigate build issues on 10.12

I can't assist with option 2, because my machine is running 10.14.

@vifino
Copy link
Member

vifino commented Apr 13, 2019

It fails on 10.13 too.
https://travis-ci.org/shinyblink/sled/jobs/519066166

On that build, 10.12 built fine.

@vifino
Copy link
Member

vifino commented Apr 13, 2019

Awesome, @20kdc fixed the build issue. It was not macOS specific, it had to do with Make parallelity and k2link.

@vifino vifino merged commit 5eff418 into master Apr 13, 2019
Core automation moved this from In progress to Done Apr 13, 2019
@vifino vifino deleted the mod-mod-the-modening branch January 29, 2021 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement suggestions to the project.
Projects
Core
  
Done
Development

Successfully merging this pull request may close these issues.

sled doesn't exit properly
4 participants