1
0
mirror of https://github.com/systemd/systemd synced 2025-09-28 00:04:47 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Daan De Meyer
ef1bd2349b mkosi: Allow setting version-tag option via VERSION_TAG env variable
With https://github.com/systemd/mkosi/pull/630, we can set environment
variables for the build script in mkosi. Let's modify the build script
so we can set the version-tag option via an environment variable of the
same name. The default is the empty string which causes meson to fall
back to the default behavior (git version).
2021-01-15 21:42:30 +01:00
Frantisek Sumsal
2e445f4fe5 ci: bump the Semaphore CI badge to the v2 instance 2021-01-15 20:31:20 +00:00
Zbigniew Jędrzejewski-Szmek
3bc66bfa01 rpm: expose $systemd_util_dir also as rpm macro
This variable (a.k.a. rootlibexecdir), was exposed through the .pc file, but
not as rpm macro.

The .pc file must be located in the package that provides libraries, which
pulls in a lot of dependencies. In Fedora, the macros are split out to a
separate package so that other packages which need to refer to some systemd
path but don't otherwise require it, can only pull in the (much smaller and
dependency-less) macros package. zram-generator uses the path to specify the
location of systemd-makefs, so by using the rpm macro we'll be able to use
a much smaller buildroot.
2021-01-15 19:54:43 +00:00
Frantisek Sumsal
01371e2cd8 ci: migrate to Semaphore CI 2.0 2021-01-15 20:18:29 +01:00
Lennart Poettering
41979f59d3 fs-util: make laccess() macro follow our usual error propagation
Functions defined by us are supposed to return negative errno-style
errors on errors. laccess() is for access() what lstat() is for stat(),
but defined by us as a macro. This led to some confusion regarding error
handling.

Let's return a negative errno code just in case. This means callers can
it use either way: like access(), i.e. checking for a negative return
value + looking at errno, or like our own code, i.e. using the negative
errno code it returns.
2021-01-15 19:14:10 +00:00
Daan De Meyer
064b8e2c99 meson: Use configure_file when version-tag is specified
vcs_tag() is slow. When the version-tag meson option is set,
we can use configure_file() directly to speed up incremental
builds.

Before (with version-tag set to v247):

```
‣ Running build script...
[1/418] Generating version.h with a custom command

real    0m0.521s
user    0m0.229s
sys     0m0.067s
```

After (with version-tag set to v247):

```
‣ Running build script...
ninja: no work to do.

real    0m0.094s
user    0m0.048s
sys     0m0.022s
```
2021-01-15 19:34:44 +01:00
8 changed files with 51 additions and 18 deletions

27
.semaphore/semaphore.yml Normal file
View File

@ -0,0 +1,27 @@
---
# vi: ts=2 sw=2 et:
version: v1.0
name: Debian autopkgtest (LXC)
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
# Cancel any running or queued job for the same ref
auto_cancel:
running:
when: "true"
execution_time_limit:
hours: 1
blocks:
- name: "Setup & test"
task:
jobs:
- name: "Install dependencies & run the Debian autopkgtest"
commands:
- checkout --use-cache
- .semaphore/semaphore-runner.sh SETUP
- .semaphore/semaphore-runner.sh RUN

View File

@ -4,7 +4,7 @@ System and Service Manager
<a href="https://in.waw.pl/systemd-github-state/systemd-systemd-issues.svg"><img align="right" src="https://in.waw.pl/systemd-github-state/systemd-systemd-issues-small.svg" alt="Count of open issues over time"></a>
<a href="https://in.waw.pl/systemd-github-state/systemd-systemd-pull-requests.svg"><img align="right" src="https://in.waw.pl/systemd-github-state/systemd-systemd-pull-requests-small.svg" alt="Count of open pull requests over time"></a>
[![Semaphore CI Build Status](https://semaphoreci.com/api/v1/projects/28a5a3ca-3c56-4078-8b5e-7ed6ef912e14/443470/shields_badge.svg)](https://semaphoreci.com/systemd/systemd)<br/>
[![Semaphore CI 2.0 Build Status](https://the-real-systemd.semaphoreci.com/badges/systemd/branches/master.svg?style=shields)](https://the-real-systemd.semaphoreci.com/projects/systemd)<br/>
[![Coverity Scan Status](https://scan.coverity.com/projects/350/badge.svg)](https://scan.coverity.com/projects/350)<br/>
[![OSS-Fuzz Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/systemd.svg)](https://oss-fuzz-build-logs.storage.googleapis.com/index.html#systemd)<br/>
[![CIFuzz](https://github.com/systemd/systemd/workflows/CIFuzz/badge.svg)](https://github.com/systemd/systemd/actions)<br/>

View File

@ -555,15 +555,24 @@ endif
#####################################################################
vcs_tagger = [project_source_root + '/tools/meson-vcs-tag.sh',
version_tag = get_option('version-tag')
if version_tag != ''
vcs_data = configuration_data()
vcs_data.set('VCS_TAG', version_tag)
version_h = configure_file(configuration : vcs_data,
input : 'src/version/version.h.in',
output : 'version.h')
else
vcs_tagger = [
project_source_root + '/tools/meson-vcs-tag.sh',
project_source_root,
get_option('version-tag'),
meson.project_version()]
version_h = vcs_tag(
input : 'src/version/version.h.in',
output : 'version.h',
command: vcs_tagger)
endif
versiondep = declare_dependency(sources: version_h)

View File

@ -92,7 +92,8 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
-D man=false \
-D "nobody-user=$nobody_user" \
-D "nobody-group=$nobody_group" \
-D translations=false
-D translations=false \
-D version-tag="${VERSION_TAG}"
fi
cd "$BUILDDIR"

View File

@ -43,7 +43,8 @@ int futimens_opath(int fd, const struct timespec ts[2]);
int fd_warn_permissions(const char *path, int fd);
int stat_warn_permissions(const char *path, const struct stat *st);
#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)
#define laccess(path, mode) \
(faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW) < 0 ? -errno : 0)
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
int touch(const char *path);

View File

@ -5,6 +5,7 @@
# RPM macros for packages installing systemd unit files
%_systemd_util_dir @rootlibexecdir@
%_unitdir @systemunitdir@
%_userunitdir @userunitdir@
%_presetdir @systempresetdir@

View File

@ -4,13 +4,7 @@ set -eu
set -o pipefail
dir="$1"
tag="$2"
fallback="$3"
if [ -n "$tag" ]; then
echo "$tag"
exit 0
fi
fallback="$2"
# Apparently git describe has a bug where it always considers the work-tree
# dirty when invoked with --git-dir (even though 'git status' is happy). Work