Age | Commit message (Collapse) | Author |
|
... by recursively copying and resolving sybolic links. In this
way, references within a tree (e.g., #include "../Something.hpp")
do not confuse the compiler, as opposed to directory symlinks.
Neverthess, by doing this copying only for tree constructors, we
still keep the overhead acceptable.
|
|
The Python script used for the first stage of bootstrapping just
uses the Git index to create trees from directories (be it file
repositories, unpacked archives, or distfiles), therefore it has
the limitations of Git itself in committing trees that contain
entries ignored by Git, such as empty directories, the .git folder,
.gitignore files and files referenced there, or other entries with
Git-specific magic names.
This commit updates the Python script to replace the use of the
Git index for importing directories to directly writing the needed
blobs and trees to the object database, then commit the resulting
top tree explicitly.
While there, fix a typing issue from our relaxed approach in using
os.environ to set the subprocess env when running commands. As on
POSIX the type is _Environ, not simple Dict[str, str], use implicit
dictionary merging (Python v3.5+) to set the Git envars. The issue
was initially flagged by pyright.
|
|
|
|
...with a default implementation.
Although it is not used directly, it will be needed for instantiation of std::optional.
|
|
While just-deduplcate-repos only identifies repositories that are
semantically indistinguishable, there still is the pragma to consider.
- If the repository in one use requires to be present, we have to
fetch it, hence cannot treat it as absent.
- If a repository in one place has to be transformed to a git root,
this also has to happen for the copy we keep.
|
|
This allows to simply specify the direct dependencies desired
to be absent at import where the dependency structure is handled
anyway, rather than afterwards reconstructing which repositories
should be absent.
|
|
When importing a repository via just-import-git, allow to
specify the value for the "inherit env" property for the
repository just being imported.
|
|
While it is best practise to build outside the source tree, some
package formats require that a build be carried out inside the
source tree. As there are no principle obstacles, as long as a
non-existing directory is requested as build dir, support it by
ignoring the destination in the recursive copy.
|
|
This allows to specify upfront alternative locations from where the
imported repository may be fetched. No action is taken in the
import, instead the argument gets passed intot he resulting just-mr
configuration.
|
|
|
|
This is brought in by the tree-of-archive rpc of just serve.
Also adds lzma and bzip2 as transitive dependencies.
|
|
... as well as the already present -Wno-error. In this way,
packagebuilding should work out of the box on more systems.
|
|
Initial version, to be extended later with other RPCs.
|
|
Together with just-import-git that allows a work flow of easily
importing dependencies without exponential blow up of the resulting
repos.json files.
|
|
|
|
The checkout locations keys can, of course, include the empty
string, so key check should be explicitly typed.
|
|
In order to get the type checker happy, some wrong type annotations
were added and, as a consequence, an unwarrented conditional as well.
To make things worse, this as checking for the non-None-ness of a
value by inspecting the truth value, ignoring that the non-None value
"" also has truth value False. Remove this conditional alltogether
and fix the type annotations.
|
|
For maximum compatibility, we use the uppercase types from the
typing package instead of the built-in types, therefore compliant
with PEP 484 and PEP 526.
As unfortunately there is no proper JSON typing option that
requires many casts, we use a more lax typing for JSON inputs, but
enforce return types in order to implicitly infer the actual
format of an input JSON variable (dict, list, string etc.).
|
|
For maximum compatibility, we use the uppercase types from the
typing package instead of the built-in types, therefore compliant
with PEP 484 and PEP 526.
|
|
For maximum compatibility, we use the uppercase types from the
typing package instead of the built-in types, therefore compliant
with PEP 484 and PEP 526.
As unfortunately there is no proper JSON typing option that
requires many casts, we use a more lax typing for JSON inputs, but
enforce return types in order to implicitly infer the actual
format of an input JSON variable (dict, list, string etc.).
|
|
For maximum compatibility, we use the uppercase types from the
typing package instead of the built-in types, therefore compliant
with PEP 484 and PEP 526.
|
|
For maximum compatibility, we use the uppercase types from the
typing package instead of the built-in types, therefore compliant
with PEP 484 and PEP 526.
As unfortunately there is no proper JSON typing option that
requires many casts, we use a more lax typing for JSON inputs, but
enforce return types in order to implicitly infer the actual
format of an input JSON variable (dict, list, string etc.).
|
|
... to pass along toolchain settings for current and future
toolchain definitions. Configuration variable
COMPILER_FAMILY is replaced by TOOLCHAIN_CONFIG["FAMILY"].
|
|
|
|
The command 'git add .' does not include paths found in .gitignore
files in the directory tree where the command is issued. This is
not the desired behaviour, as we expect for a tree with a given
commit id to contain all of the entries, irrespective of their
meaning to Git.
This commit addresses the issue as described.
For the just-mr.py script we modified the staging command to
'git add -f .'.
For the compiled just-mr, simply adding the force flag to
'git_index_add_all' did not work as intended for files found in
ignored subdirectories. This is a known libgit2 issue which has
been fixed in v1.6.3. Until we can upgrade our libgit2 version,
a workaround was implemented: we recursively read the directory
entries ourselves and add each of them iteratively using
'git_index_add_bypath', making sure to ignore the root '.git'
subtree (which cannot be staged).
At the moment the handling of Git submodules remains an open issue,
as Git does not allow '.git' subtrees to be forcefully added to the
index, and thus such directory entries will currently not be
considered as part of a git tree. This however is consistent
behavior between Git and libgit2.
|
|
... by making variables `os` and `arch` accessible to
bootstrap hints. Furthermore, support the hints `os_map`
and `arch_map` for mapping Justbuild's OS/ARCH to the
terminology used by the repository. Values not covered by
these maps will be passed through.
|
|
... and set default stack size to 8 MB.
|
|
In the definition of a repository, the workspace root (given by
the key "repository") can contain either a description of that
root (where to fetch it, whast to expect) or simply a reference
to (the workspace root of) another repository. In the latter case,
the referenced repository has to be imported as a layer, just as if
had been specified as target_root, rule_root, or expression_root.
|
|
Add an option --plain pretending that the remote repository
configuration is the canonical single-repository one. In this way,
repositories not having a multi-repository configuration (e.g.,
code built with a foreign build system) can be imported in the same
way to a template, thus providing a more uniform interface. This
can also be useful, if a repository is to be imported completely
without its transitive dependencis.
|
|
Dependencies (type archive/zip) that are not required for
bootstrapping just are usually marked with the hint "drop",
in order to avoid fetching non-required archives. This
affects only non-local dependencies, as local dependencies
(from the system) will not fetch anything and therefore do
not need to be dropped.
With this commit, the "drop" hint for declared
non-local-deps will be ignored during package builds. In
this way, the user can specify dependencies that should not
be dropped (despite not strictly required to bootstrap
just). Consequently, those dependencies remain in the
generated bootstrap configuration, in case the user wants to
use this configuration to build other targets, such as
just-mr.
|
|
... so in can be used (in combination with the repository
config) to build other just targets, such as just-mr.
|
|
... as in this way, the setup is more close to the one used in
our build tool. In particular, tools that search for auxilliary
files relativ to their own location get confused less.
|
|
|
|
|
|
|
|
|
|
|
|
... both with respect to just options and the man page specifications.
Option -L of just-mr was reassigned as a short name for
--local-launcher, matching its use in just. Its place is now
correctly held by the full name option --checkout-locations, as
per the section-1 man page.
|
|
|
|
... while following symbolic links. In this way, bootstrapping
is possible against preinstalled dependencies that symbolic links
or special files in their directories.
|
|
... to indicate, in case of a package build, which dependencies
should not be taken from the local environment. As those need a
different target root (and potentially other roots), we keep a
copy of file roots modified when transitioning to local builds and
rewrite the changed file roots in the NON_LOCAL_DEPS accordingly.
Co-authored-by: Klaus Aehlig <aehlig@linta.de>
|
|
Not all repositories mentioned in the repository configuration are
needed to boostrap just (e.g., because they are used for testing).
Support dropping dependencies for bootstrapping by replacing them
by a reference to an empty directory and in this way have less
files that need to be fetched.
|
|
In Python the json of a dict does not guarantee an order, while in
our internal just-mr implementation the json always has the keys
sorted. Also, the JSON dump in Python does not by default use the
most compact representation. This change fixes these issues and
makes the two just-mr versions produce the same distdir content id.
|
|
|
|
... to allow simple chaining of imports.
|
|
|
|
The main repository to be imported should be treated special,
whenever given. This has to be verified as the parameter not being
None, rather than being true, as the empty string (a traditional
name for the main repository) is also a false value in python.
|
|
just-mr is designed to store everything that can be reported as git
tree entirely in git only. To avoid recomputation, just-mr keeps index
files mapping the description of a repository to the corresponding
git trees. For these index files to be useful, the computation of
the key has to be independent of the presence of the respective
archives in CAS. This will become even more important once garbage
collection will be added. Fix this for distdir repositories.
|
|
|
|
The value of --just option should be used as-is,
as it might be a var in PATH. The `execvp` call will handle this.
The Python script and man page have been updated accrodingly.
|