Repository navigation
Conversation
vhyrro
marked this pull request as draft
October 5, 2026 10:41
vhyrro
force-pushed
the
push-ywksqwqmssvq
branch
5 times, most recently
from
October 7, 2026 16:41
799fc84 to
b9e6a34
Compare
vhyrro
commented
Oct 7, 2026
vhyrro
force-pushed
the
push-ywksqwqmssvq
branch
5 times, most recently
from
October 10, 2026 15:38
0018767 to
ba78d09
Compare
vhyrro
commented
Oct 10, 2026
vhyrro
marked this pull request as ready for review
October 10, 2026 17:17
Member
Author
|
This should be ready for initial review. I'm aware that there are conflicts. There will probably be some cargo clippy errors too. I assume that this PR will break things. That is the nature of such a sizeable change. Our tests can catch almost everything, but not the craziest edge cases. We will have to rediscover those as we go. Feel free to be as critical as necessary with the changes :) |
…roject on source change
(allows overwrites and prevents conflicting entrypoints by removing the old version of the package and replacing it with a new one)
vhyrro
force-pushed
the
push-ywksqwqmssvq
branch
from
October 11, 2026 10:37
9f6d320 to
0c39628
Compare
Member
Author
|
Fixed all the conflicts and hopefully all CI should start passing :) |
vhyrro
added this pull request to stack #2015
October 11, 2026 13:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR is a general overhaul of the codebase, ready to prepare it for a 1.0 release. This contains a lot of refactorings and a lot of code-moving. However, the code itself is generally untouched. Almost all modules have simply been cut up and copy+pasted into new areas, so the logic of Lux remains identical across the refactor.
The exception to this is the vendoring logic, which has had its flow refactored a bit to work with the rest of the codebase. We might want to perform some serious tests there.
The goal of this PR is unification: taking a bunch of duplicated logic and code and putting it all into single structs and builders so that they can be reused everywhere.
Renames
Basic renames include:
LocalPackage->LockedPackage- the earlier name was actually misleading. A LockedPackage is one which is ready to be recorded in a Lockfile, hence the name Locked. Local can mean too many things.RemotePackageDB->PackageDB- the PackageDB can now ingest a lockfile as well as local packages, allowing it to pull from multiple sources. This means it's no longer "remote".Pipeline
I've created a new module called the "pipeline", which is the heart of Lux's logic. It describes the following stages:
DiscoveredPackagestruct)ResolvedPackage)DownloadedPackageLockedPackages.Each stage produces its own
Artifacts<T>- because luarocks can sometimes return a source (e.g. binary rocks or src rocks), these can be stored as intermediate artifacts as we move through the pipeline.Drivers
These drive the pipeline in some desired fashion. This is where a lot of the logic becomes unified.
OpenandFrozen.Open- sync the current workspace with the lockfile, pulling any unresolved packages from the luarocks manifest, but otherwise preferring the lockfile (this prevents packages with a lockfile constraint from being rebuilt with a newer version). Also builds the project as a package in the tree, so it can be executed or other things. Does not remove unused packages.Frozen- the equivalent of the old Sync's behaviour. syncs the current workspace so that it matches the lockfile exactly. Installs or removes all packages so that they match the lockfile. Name mirrors Cargo's behaviour.The sync overhaul needs extra context: it is used by essentially all commands now to ensure the project is up-to-date and properly built before executing any given command (for example,
lx luanow ensures the project is properly built before running a REPL in a potentially broken environment).This is important for Lux 1.0: imagine someone's Lux project involves generating a .so file with
mlua. Earlier, none of the Lux commands would ensure that the project got built properly, or that it was available. Now, whenever running something likelx runorlx lua, the project is built and ready to be used directly.Extra Changes
BuildBehaviours - Ignore, Conflict, Force. Ignore will simply ignore any package that is already installed. Conflict will throw an error whenever a package of the same name but with a different version is trying to be installed (useful forlx add). Force works exactly as it used to.urlfield. The project's codebase will be used instead.Multiple Modules Deleted
A bunch of code got outright removed thanks to the massive deduplication effort, making Lux a leaner codebase.