build: Don't install libraries #232
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#232
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?
Currently, all libraries produced by Mach are installed to the output prefix. This is undesirable as Zig's build system can be used to produce packages, or to install globally to the system, and Mach static libs are simply compilation side-products, not necessarily things wanted in the installation.
If building Dawn for non-Zig use is a supported usecase, I would suggest having a separate API for this - the current one doesn't really support it well anyway.
On a related note,
mach/gpu/build.zigandmach/build.zigalso build static libraries for some reason? Not sure why that is; they probably shouldn't since they're just Zig packages and don't expose C APIs.Oh yeah, I meant to post something about this but didn't have the time earlier. Installing should never be done automatically; instead the
LibExeObjStepshould be exposed somewhere so the user can invoke.install()if they wish.Yup, there is no canonical way to link to the libraries as their
LibExeObjSteps are local variables that are never returned. This, in turn, exacerbates the problem of polluting the build root without providing any functionality to the user. It does not make much sense to create and install a new static library when user just wants to link an existing static library to their existing build step.Thanks for filing this, and for reaching out earlier about the same issue @Luexa !
I removed the unused static libraries from
mach/gpu/build.zigandmach/build.zigin #220Makes sense to me, thanks for that idea!
It is indeed a supported use case, but currently only to the extent that
zig build -Ddawn-from-source=truein themach/gpu-dawndirectory should produce and install a staticlibdawn.afor you (we also use this to create the binary release archives at https://github.com/hexops/mach-gpu-dawn/releases/tag/release-1005a82 )I agree that
gpu_dawn.link(...)should not.install()it if you are just consuming the library, though.