Static builds fail #306
	
		Labels
		
	
	
	
	No labels
	
		
			
	
	
	
	
Affects/CppNix
		
			Affects/Nightly
		
			Affects/Only nightly
		
			Affects/Stable
		
			Area/build-packaging
		
			Area/cli
		
			Area/evaluator
		
			Area/fetching
		
			Area/flakes
		
			Area/language
		
			Area/lix ci
		
			Area/nix-eval-jobs
		
			Area/profiles
		
			Area/protocol
		
			Area/releng
		
			Area/remote-builds
		
			Area/repl
		
			Area/repl/debugger
		
			Area/store
		
			bug
		
			Context
contributors
		
			Context
drive-by
		
			Context
maintainers
		
			Context
RFD
		
			crash 💥
		
			Cross Compilation
		
			devx
		
			docs
		
			Downstream Dependents
		
			E/easy
		
			E/hard
		
			E/help wanted
		
			E/reproducible
		
			E/requires rearchitecture
		
			Feature/S3
		
			imported
		
			Language/Bash
		
			Language/C++
		
			Language/NixLang
		
			Language/Python
		
			Language/Rust
		
			Needs Langver
		
			OS/Linux
		
			OS/macOS
		
			performance
		
			regression
		
			release-blocker
		
			stability
		
			Status
blocked
		
			Status
invalid
		
			Status
postponed
		
			Status
wontfix
		
			testing
		
			testing/flakey
		
			Topic/Large Scale Installations
		
			ux
		
		
	
	No project
	
	
	
	
		No assignees
		
	
	
	
	
		4 participants
	
	
		
		
	Notifications
	
		
	
	
	
		
	
	
	Due date
No due date set.
	
		Dependencies
		
		
	
	
	No dependencies set.
	
	
		
	
	
		
			Reference
		
	
	
		
	
	
			lix-project/lix#306
			
		
	
		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?
Traces: https://0x0.st/XKiG.txt
Happened during https://github.com/NixOS/nixpkgs/pull/310194.
Reproducer:
nix-build -A lixStaticon that PR.cc @delroth
@delroth FYI, it was found out that it's related to passing
-sharedand-staticto the plugin build. It should probably be skipped at the Meson level, i.e. dynamic plugin tests make no sense for static builds (dlopenfor musl returns dummy values, NULL or something IIRC).Yeah, that was fairly obvious and I already have a patch for this. But there are further problems with unit tests and C++ constructors causing store registration to sometimes not work (and that's what I'm currently debugging).
https://gerrit.lix.systems/c/lix/+/1106/1 fixes the first trivial part of the problem.
Then libstore tests fail because the linker is pruning .o files for store implementations due to them not being referenced. This is because store registrations are done via static initializers instead of having e.g. an init function being called by libstore's init, so unless the linker is forced to keep those .o files via (for example) Meson's
link_wholeit doesn't. But if you make libstore link_whole, that breaks a whole bunch of things, for example linking with libexpr because libexpr depends on libstore but Meson isn't transitively passing dependencies? I think?Anyway, it's a fairly deep rabbit hole. Dropping for now.
why did this work in the first place?! :O cursed
~~like, did this work properly in make? because you still should need to give whole-archive right?~~oh i see we have some staticlibs that get linked together into a shared lib. yeah, hm. right.
Blocked on #359 (most likely).
Also, is static builds availability something that should block release? I'd be tempted to say it's a major regression tbf.
We::Qyriad can make it a priority
We have this basically working; just need to clean it up and make sure the logic doesn't break anything else
Static builds fails during plugin teststo Static builds failWill be fixed by https://gerrit.lix.systems/c/lix/+/1360/3