Skip to content
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

New shared builds mechanism (mockup) #1419

Merged
merged 3 commits into from
Aug 5, 2023

Conversation

mosteo
Copy link
Member

@mosteo mosteo commented Aug 3, 2023

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 marked this pull request as ready for review August 4, 2023 10:04
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
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
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
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
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
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

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
13 checks passed
@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