build: types and packages are mess #405
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#405
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
the goal of this issue is try to find out a way to not repeat codes in sub-projects and also build files
for example same
Optionsstruct exist in./build.zigandgpu/build.zig. orrefAllDeclsfunction (which is very useful for tests and we should consider to use it in other packages) has been declared twice in freetype and audio/soundioI think the reason for the code repetition was because we can't import from
../. For example we could have abuild_utils.zigfile with all the structs and functions commonly used in thebuild.zigfiles, but we wouldn't be able to import it.Also, there is the fact that we are offering people the ability to use mach packages by themselves without adding all of mach. For example if someone wanted to use just
mach-glfwit would still need thatbuild_utils.zig.Yep what @PiergiorgioZagaria said is correct.
I will also say, copying a few hundred lines is often preferable over a dependency (repeating code is not a bad thing.) This is a non-issue from my viewpoint.
Have any issues been caused by this? (e.g. two copies actually becoming out of date and it being a problem)? If not, I'd suggest we just do nothing until that happens & then address only that instance of it.
when hacking on #396, i had to use
@bitCastwhile passing the exact sameOptionsstruct togpu.testStepMach is definitely going to get bigger, and with the increase of such problems, controlling code quality will become more difficult
hopefully zig's official package manager solves all those
I agree those bitcasts between package parameters are an issue 👍 But I think they're caused by us using symlinks to load packages, not because of code duplication
i think this can be closed as of
github.com/hexops/mach@fe4e721508