| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
If we don't, and encounter a file we don't own, but have permission to
delete, we'll fail with EPERM, since we won't be able to change
permissions but will be able to delete it.
Instead, we now try to change permissions and remove a file *after* we
realize we couldn't at first.
|
|
|
|
|
|
|
|
|
|
|
| |
By default, Linux doesn't allow creating hardlinks to read-only files of
other users since Linux 3.6 (see /proc/sys/fs/protected_hardlinks).
This fixes staging when buildbox-casd is running as a separate user and
the traditional bubblewrap sandboxing backend is used. This combination
is not recommended, however, it's triggered in CI by docker images that
run buildbox-casd as a separate user and a few test cases that override
BST_FORCE_SANDBOX.
|
| |
|
|
|
|
|
| |
Newer pylint versions detect and complain about unnecessary elif/else
after a continue/break/return clause. Let's remove them
|
|
|
|
|
|
|
| |
This allows access by buildbox-casd running as different user with a
suitable umask. As this is not generally safe in global temp directories
such as /tmp, make the `dir` parameter mandatory and add a note to the
documentation.
|
|
|
|
| |
This allows access by buildbox-casd running as different user.
|
| |
|
|
|
|
|
|
|
| |
As discussed over the mailing list, reformat code using Black. This is a
one-off change to reformat all our codebase. Moving forward, we
shouldn't expect such blanket reformats. Rather, we expect each change
to already comply with the Black formatting style.
|
|
|
|
|
|
|
|
|
|
|
| |
In the latest released version of pylint (2.3.x), the
"no-else-raise" (R1720) warning has been introduced.
See:
http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-3-0
There are many instances of this in our codebase, which this
patch addresses.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case we are copying something to a read-only directory,
`_copy_directories` fails. Copying should work regardless.
Now when we are copying something to a read-only directory, we
reset the permissions of the directory to writable, and then revert to
the directory's original permissions after copying is completed.
An example where this is nessesary is when extracting Docker layers.
If one layer adds a read-only directory `/a` and the following layers adds
`/a/foo`, we must be able to copy `foo` into the otherwise read-only directory,
whilst still ensuring `/a` is read-only once the layer is staged.
|
|
|
|
| |
gRPC threads are not joined when shut down.
|
|
|
|
|
| |
This will be used to safeguard against fork issues with multiple
threads.
|
|
|
|
|
|
|
|
|
|
| |
As a first step, add type hints to variables whose type `mypy` cannot
infer automatically. This is the minimal set of type hints that allow
running `mypy` without any arguments, and having it not fail.
We currently ignore C extensions that mypy can't process directly.
Later, we can look into generating stubs for such modules (potentially
automatically).
|
|
|
|
|
| |
`calendar.timegm()` accepts a tuple, but we were giving it a list. This
was highlighted by `mypy`.
|
|
|
|
| |
This is consistent with the other global vars in the module.
|
|
|
|
|
| |
`url_directory_name` is heavily called from any downloadable source
plugin, and moving it to cython gives a more than 10x speedup
|
|
|
|
|
|
|
| |
Changes made to cli.py and _stream.py in order to support tar
compression. Compression flag has been added, which overrides any file
extensions given. Where no compression or file extension provided,
default to uncompressed .tar.
|
|
|
|
|
|
|
|
| |
Avoid a restriction of Windows that prevents us from using both the file
descriptor and the file name of tempfile.NamedTemporaryFile.
Provide a wrapper that only returns the temporary filename, and makes it
easier to be windows-compatible.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Some plugin elements, such as docker-element and tar-element, require
to set `created` and/or `modified` meta-data fields. It would be nice
to use `magic_timestamp` to ensure these fields are being set in a
consistent and deterministic way.
|
|
|
|
|
| |
This is needed in the case where the temp directory permissions
are changed between creation and deletion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is win32-friendly, less to read, and fixes a latent bug.
Avoid dealing with low-level platform specifics by using the
higher-level shutil.disk_usage() function to calc total and available
bytes for us.
shutil is also more correct - it uses f_frsize to convert from blocks to
bytes, instead of f_bsize. I verified that the numbers match with the
output from `df -k`, whereas the old implementation did not. Here are
the meanings from `man statvfs`:
f_frsize The size in bytes of the minimum unit of allocation on
this file system. (This corresponds to the f_bsize
member of struct statfs.)
f_bsize The preferred length of I/O requests for files on this
file system. (Corresponds to the f_iosize member of
struct statfs.)
Link to shutil.disk_usage() implementation:
https://github.com/python/cpython/blob/3.5/Lib/shutil.py#L980
|
|
|
|
|
| |
copy_files and link_files suggested that a single file path is a valid argument
when it isn't.
|
|
This was discussed in #1008.
Fixes #1009.
|