-
Notifications
You must be signed in to change notification settings - Fork 0
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
Move from Wren to Flamingo #50
Merged
Conversation
This file contains 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
…t class (static) or an instance of it
10 tasks
Not sure if passing NULL is UB or not but the manual doesn't talk about it so passing environ now to be sure.
This was referenced Nov 8, 2024
Closed
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.
This is really going to overhaul much more than just the language used. These are the things I wanna do:
Start with dependency management and(not yet) overhauling the output directory.Already support building simple setups with other build systems, I'm notably thinking of Meson/Ninja as is quite popular nowadays, CMake, bmake/gmake (how can we automatically detect this? default to gmake and only use bmake if e.g. a FreeBSD port makefile is detected?),This is in build: Support many other buildsystems #28./configure
, Cargo (which will completely replace theRustC
class), and Go.Figure out how I want to do asynchronous build operations.I think I'm going to ignore this for now and see how far I can get relying on the dependency system of asynchronous builds.Prune files that weren't ever touched by the build pass.Will do this later, Prune files that weren't ever touched by the build pass #51bob.fl
import path situation.build.sh
andsh-bin
tobootstrap.sh
and.bootstrap
respectively to be a little clearer.BIG ISSUE!! Don'tWe're not actually doing this, but I do want to usechown
the installed stuff of course.install
instead ofcp
eventually install: Useinstall
command instead ofcp
#52fork()
ing in multithreaded code thing -> usespawn
instead?Concretely, this is what I still need to build a project like IAR or Umber:
CC.compile
andLinker.link
use the flags passed at instantiation.CC
toCc
, I think it looks nicer..bob/prefix
with install map. Maybe do this before abob run
instead of after abob build
, because practically I thinkbob run
is the only thing that needs the prefix. OTOH, running it beforebob run
will introduce unnecessary delay. OTOOH,bob run
anyway has to runbob build
before, and we can speed up installation by checking modification times.Indeed,Res
class for resource installation (or maybe we could just accept a path as-is as a key to the install map like in previous versions?).Res
is obsolete.bob run
itself, obviously.run
vector.bob install
.Simple testing framework? Or should that just not be the concern of Bob?For now not our concern, IAR will just have its tests run withtest.sh
.Dependencies
See #54
Asynchronous build operations
I don't know how necessary this is really because
CC
can already do this and the dependencies are also entirely handled by Bob.Cargo
andGo
will also be able to handle this themselves.The only usecase for this is going to be for the AQUA devices, but there's really multiple ways we could do without this:
DEVSET
environment variable (depending on if AQUA 4.X even goes with device sets or drops them), thedeps
vector can be set to different local directories.Keep theFundamentally this is the same as adding all the stuff we wanna build to theFile.bob
idea, but be able to pass a vector of projects to build in parallel.deps
vector.Just ignore this as each device will already be parallel, though it probably won't be able to use all threads available as a lot of devices are pretty small.Crappy solution.Do away with each device being buildable on its own and have everything in a giantThis is going to be unmanagable and requires a proper system for these async jobs.build.fl
file. Not too in favour of this solution.If we go with the dependency idea, there has to be a way to divvy up thread counts between dependencies on the same BFS layer. Say we have 16 threads available and we're building 4 dependencies which use
make
, we could pass-j$(16 / 4)
to each one. We do need a strategy for when maybe 3 of the dependencies finish building in 5 seconds but the last one takes like 60 seconds; then, we may need a heuristic to decide if it's worth it to stop building so that we can re-run make with-j16
.Architectural revamp
For the different build systems Bob supports, I'm thinking of having a handler architecture where each build system handler would register functions for the different operations Bob supports (i.e.
build
,install
, &c). Bob itself would also be a handler.I thought about making these pluggable, but I don't think there ever really will be a situation where you'd need support for a build system which can't be upstreamed into Bob. Besides, the "workaround" for these kinds of buildsystems would just be using them as originally intended.
Each buildsystem would have its own subdirectory in
.bob
, and after each build (each? How slow is installing?) they'd install into a.bob/prefix
directory, which has a FHS-like filestructure (.bob/prefix/bin
,.bob/prefix/lib
,.bob/prefix/include
). When building a C program for instance,-L.bob/prefix/lib
would be passed to the compiler so that it can search for libraries in its dependencies. When prefixing a command withbob run
, this would simply append.bob/prefix/bin
to$PATH
and set$LD_PRELOAD
to.bob/prefix/lib
(similar to howpoetry run
activates the relevant venv for you). (Maybe we can find a better name thanprefix
?install-prefix
? Justinstall
?)The only unknown is how installing to the system is going to work, since we can't just overwrite existing dependencies. Maybe just install the program itself and provide an explicitly "dangerous" option for also installing all the dependencies.
The
.bob/bob
subdirectory would comprise of all the artifacts generated by Bob, which would have the name of the original source plus a randomly generated cookie UUID.Finally, the
.bob/deps
subdirectory would comprise of a directory for each dependency, and each dependency would have its own.bob
directory for its own stuff. The only difference would be that they'd share the same.bob/prefix
as their parent.Issues identified
Here are a few issues I've already identified which need fixing:
stat
.gen_cookie
should really automatically prepend the$out_path/bob
stuff and probably take in anext
argument to add the.o
for compiling e.g.