Skip to content

New shared builds mechanism (mockup) - #1419

Merged
mosteo merged 3 commits into
alire-project:masterfrom
mosteo:feat/shared-builds
Aug 5, 2023
Merged

New shared builds mechanism (mockup)#1419
mosteo merged 3 commits into
alire-project:masterfrom
mosteo:feat/shared-builds

Conversation

@mosteo

@mosteo mosteo commented Aug 3, 2023

Copy link
Copy Markdown
Member

This introduces most infrastructure needed for the new build system. It's still disabled by default (although some tests check it already) because it's missing the hash computation, which will come in a follow-up PR.

Instead of the real hash, the same unique fake hash is always used. Hence, enabling it now roughly works like the previous dependencies.dir worked, as there will be only one build config per release, except that there are already separate locations for "read-only" sources and build sources.

There are also some assorted TODOs through the code for future optimizations, but the functional part is complete (again, but for the hash computation).

A summary of the new modus operandi is in alire-builds.ads.

@mosteo
mosteo force-pushed the feat/shared-builds branch from 33fc957 to 03f9772 Compare August 3, 2023 22:34
@mosteo
mosteo marked this pull request as ready for review August 4, 2023 10:04
@mosteo
mosteo requested a review from Fabien-Chouteau August 4, 2023 10:04
Comment thread doc/user-changes.md
encouraged to use the pin system.

If these default locations for shared dependencies must be relocated, this can
be achieved by using a new configuration path (`ALR_CONFIG` or `-c` global

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be useful to have a separate option/env-var for the cache.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create an issue to track this.

-------------------
-- To_Msys2_Path --
-------------------
-- Convert C:\blah\blah into /c/blah/blah. This is needed because otherwise

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to avoid msys2 specific behaviors like that. And that probably means removing the dependency on an rsync executable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually rsync is probably overkill since the new folder should either exist or not at all, so a full copy is OK. I was for some reason too focused on using rsync. I take note for a follow-up PR.

);
-- TODO: this may take some time, and rsync doesn't have a way
-- to show oneliner progress, so at some point we may want to use
-- something like GNAT.Expect for our spawns, and spin on newlines

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or the Spawn library https://github.com/adacore/spawn

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either spawn or GNATCOLL.OS.Process - spawn is higher level and suited for integration in a main loop. GNATCOLL.OS.Process is lower level and leaves the user more things to do, but is an easier in-place replacement for GNAT.Expect. Both are superior to GNAT.Expect since they allow separating stdout and stderr, and allow controlling the environment of the spawned process without affecting the parent's environment.

@mosteo
mosteo merged commit 9b476d0 into alire-project:master Aug 5, 2023
@mosteo
mosteo deleted the feat/shared-builds branch August 5, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants