Compare commits

...

128 commits
edge ... v3.17

Author SHA1 Message Date
e0899d601c
forgejo-ci: use new forge repo 2024-08-21 10:56:36 -04:00
c37af50f2f
README: update name 2024-08-12 12:56:40 -04:00
d6ea33f851
README: update upstream 2024-08-12 12:55:43 -04:00
d90ed07ba6
README: update to use forge repo 2024-08-12 12:53:58 -04:00
1619c89a02
forgejo: initial implementation 2024-08-12 12:45:12 -04:00
bd9737fb78
gitlab-ci: drop in favor of forgejo actions 2024-08-12 12:45:07 -04:00
d19406b385
README.md: new repo location 2024-08-10 16:36:12 -04:00
e698689ee8
README: update for codeberg 2024-08-09 22:48:45 -04:00
2fdbc95e8d
user/mastodon: disable on v3.17 due to no nodejs18 2023-07-12 17:23:02 -04:00
ce22976e96
user/gitlab-foss: upgrade to 15.11.9 2023-06-26 13:40:19 -04:00
1c0a59ba20
user/gitlab-foss: upgrade to 15.10.8 2023-06-25 10:23:58 -04:00
ac698ae6eb
user/authentik: add ldap init.d 2023-06-21 09:55:39 -04:00
05f9b162ae
user/authentik: upgrade to 2023.5.3 2023-06-13 17:55:36 -04:00
b07cb4cc1b backports/nextcloud: upgrade to 26.0.2 2023-06-04 15:19:16 +00:00
45733b476e backports/php81-pecl-inotify: new aport 2023-06-02 21:06:25 +00:00
0eb85aba93
user/authentik: upgrade to 2023.5.2 2023-05-30 10:42:37 -04:00
ce5d48e452
backports/py3-sentry-sdk: new aport 2023-05-16 14:02:43 -04:00
249f54b278
user/authentik: upgrade to 2023.5.0 2023-05-16 13:16:04 -04:00
007711d14d
gitlab-ci: disable armv7 crossbuild 2023-05-08 11:57:22 -04:00
0763d8ad63
user/gitlab-foss: upgrade to 15.10.6 2023-05-08 11:57:02 -04:00
629e559309 user/zotero: new aport 2023-05-03 05:26:55 +00:00
e1a4b2cafe user/firefox-esr: new aport 2023-05-03 05:26:55 +00:00
50556c3a4e
user/rstudio-desktop: new aport 2023-05-03 00:34:34 -04:00
6dcc6e872e
user/soci: new aport 2023-05-03 00:34:25 -04:00
9d1801a244
user/mathjax2: new aport 2023-05-03 00:34:18 -04:00
6ed69b6ae5
gitlab-ci: migrate to persistent repo runner 2023-04-26 00:02:11 -04:00
483012e1fe
user/py3-rpy2: new aport 2023-04-26 00:00:51 -04:00
53538b7bac backports/iwd: new aport 2023-04-23 20:14:40 +00:00
23e99c945a gitlab-ci: cross-build to armv7 2023-04-23 20:14:40 +00:00
d5845f1407 signal 2023-04-15 03:32:44 +00:00
8195d4976e backports/electron-tasje: new aport 2023-04-15 03:32:44 +00:00
79d4c329a0 backports/signal-desktop: upgrade to 6.12.0 2023-04-15 03:32:44 +00:00
e0984e2bc4
user/dotnet8-runtime: upgrade to 8.0.0_pre3 2023-04-14 14:52:36 -04:00
adf2e2c3ca
user/dotnet8-build: upgrade to 8.0.100_pre3 2023-04-14 14:52:30 -04:00
cd73fe11e1
user/dotnet8-stage0: upgrade to 8.0.100_pre3 2023-04-14 14:52:24 -04:00
f86bfd9dd0 user/gitlab-foss: use bundler 2.3 2023-04-11 23:02:10 +00:00
58ccb0e163
user/grpc: use v3.17 of re2 2023-04-11 18:44:43 -04:00
31d1b7cf81
user/gitaly: do not use system libgit2 2023-04-11 18:44:41 -04:00
4e5ed4ab52
user/gitaly: fix rugged usage 2023-04-11 18:44:38 -04:00
bef1d6bf89
user/gitlab-foss: upgrade to 15.10.2 2023-04-11 14:56:26 -04:00
7767f572a4
backports/nextcloud: backport version 26.0.0 2023-04-04 16:52:03 -04:00
83600de91c
backports/py3-google-auth: new aport 2023-04-01 11:11:51 -04:00
4c4d58516e
backports/py3-cachetools: new aport 2023-04-01 11:02:53 -04:00
cc4c41c419
user/py3-urllib3-secure-extra: new aport 2023-04-01 10:26:23 -04:00
8ee55e212b
user/py3-pydantic-scim: new aport 2023-04-01 10:26:21 -04:00
607a072a35
user/py3-django-channels-redis: upgrade to 4.1.0 2023-04-01 10:26:19 -04:00
eca3487716
user/authentik: upgrade to 2023.3.1 2023-04-01 10:26:15 -04:00
347d31b818
user/gitlab-shell: upgrade to 14.18.0 2023-03-31 15:19:40 -04:00
553797e41c
user/gitlab-foss: upgrade to 15.10.1 2023-03-31 15:19:35 -04:00
45a11233fd user/gitlab-foss: use ruby 3.0 2023-03-31 18:52:16 +00:00
a24b564661 user/gitaly: use ruby 3.0 2023-03-31 18:52:16 +00:00
5d4f43bd0a user/ruby3.0-grpc: move from backports + use ruby 3.0 2023-03-31 18:52:16 +00:00
cbb3fcb6ff user/ruby3.0-rugged: move from backport + use ruby 3.0 2023-03-31 18:52:16 +00:00
ba44fb5073 user/ruby3.0-bundler: new aport 2023-03-31 18:52:16 +00:00
404058c5b1 user/ruby3.0-minitest: new aport 2023-03-31 18:52:16 +00:00
e042e1cbf9 user/ruby3.0-power_assert: new aport 2023-03-31 18:52:16 +00:00
a02e0cc1c0 user/ruby3.0-rake: new aport 2023-03-31 18:52:16 +00:00
86e8a808d8 user/ruby3.0-test-unit: new aport 2023-03-31 18:52:16 +00:00
b85a8d6faf user/ruby3.0-webrick: new aport 2023-03-31 18:52:16 +00:00
d186e0b8bf user/ruby3.0: new aport 2023-03-31 18:52:16 +00:00
3e983b026c
user/slade: new aport 2023-03-28 13:15:40 -04:00
8f799e91aa user/dotnet8-runtime: upgrade to 8.0.1_pre2 2023-03-15 15:35:37 +00:00
e7617aa93d user/dotnet8-build: upgrade to 8.0.100_pre2 2023-03-15 15:35:37 +00:00
a91f2a036f user/dotnet8-stage0: upgrade to 8.0.100_pre2 2023-03-15 15:35:37 +00:00
526f90bd25 user/dotnet8-runtime: enable ppc64le and s390x 2023-03-15 15:35:37 +00:00
509c114321 user/dotnet8-build: enable ppc64le and s390x 2023-03-15 15:35:37 +00:00
8c1911acd7 user/dotnet8-stage0: enable ppc64le and s390x 2023-03-15 15:35:37 +00:00
6861f08364 user/dotnet7-build: upgrade to 7.0.104 2023-03-15 00:49:43 +00:00
d4a516bde4 user/dotnet7-runtime: upgrade to 7.0.4 2023-03-15 00:49:43 +00:00
d528c2e33a
user/dotnet6-build: upgrade to 6.0.115 2023-03-14 18:27:16 -04:00
91db9b9975
user/dotnet6-runtime: upgrade to 6.0.15 2023-03-14 18:27:07 -04:00
8ee05e86a7 user/gitlab-foss: upgrade to 15.9.3 2023-03-14 18:00:34 +00:00
a60b18057e
backports/airsonic-advanced: upgrade to git20230217 2023-03-12 19:18:50 -04:00
73f3dfb751
user/rmfakecloud: upgrade to 0.0.13 2023-03-10 13:17:10 -05:00
c78031886a user/gitlab-shell: change maintainer 2023-03-10 06:49:25 +00:00
de8c371842 user/gitlab-foss: use ruby-rugged aport 2023-03-10 06:49:25 +00:00
0b9ba64c9a user/gitaly: use ruby-rugged aport 2023-03-10 06:49:25 +00:00
7a2a09dae5 backports/ruby-rugged: new aport 2023-03-10 06:49:25 +00:00
b683c218a3 backports/grpc: move from user 2023-03-10 06:49:25 +00:00
9498b3f8ca gitlab-ci: build backports on edge 2023-03-10 06:49:25 +00:00
c7843f260a
backports/airsonic-advanced: new aport 2023-03-10 00:18:42 -05:00
73d4e2a826
user/gitlab-foss: update maintainer 2023-03-09 17:06:02 -05:00
f0dadce2f9
user/gitaly: update maintainer 2023-03-09 17:03:25 -05:00
24bf7af6f9
user/gitaly: set bundle location 2023-03-09 16:46:02 -05:00
1be3b7bd2e
user/gitlab-foss: downgrade bundler to 2.3 2023-03-09 16:45:55 -05:00
631d8dcb67
user/gitlab-foss: upgrade to ruby 3.1 2023-03-09 14:32:01 -05:00
c2f76ea621
user/grpc: upgrade to ruby 3.1 2023-03-09 14:31:30 -05:00
834a0c0e3d
user/gitlab-shell: upgrade to ruby 3.1 2023-03-09 14:31:20 -05:00
5d62aea821
user/gitaly: upgrade to ruby 3.1 2023-03-09 14:30:25 -05:00
76c3c12308
user/ruby2.7-bundler: remove aport 2023-03-09 14:30:18 -05:00
87cea92317
user/ruby2.7: remove aport 2023-03-09 14:30:13 -05:00
6641624dee
user/qubes-libvchan-xen: add xen depend 2023-03-08 02:53:47 -05:00
e9b11dc290
user/qubes-vm-core: fix qvm-sync-clock on wake-up and boot 2023-03-08 02:53:10 -05:00
c6b2d629ac
user/qubes-vm-gui: properly create /var/run/console 2023-03-08 02:52:59 -05:00
7123fead2a
user/qubes-vm-utils: new aport 2023-03-07 22:20:41 -05:00
cf0d372bc6
user/qubes-vm-qrexec: new aport 2023-03-07 22:20:29 -05:00
3841136929
user/qubes-vm-gui: new aport 2023-03-07 22:20:20 -05:00
bceec03891
user/qubes-vm-gui-dev: new aport 2023-03-07 22:20:13 -05:00
c34375c98a
user/qubes-vm-proxy: new aport 2023-03-07 22:20:05 -05:00
8bc30b9509
user/qubes-usb-proxy: new aport 2023-03-07 22:19:55 -05:00
f69656ceca
user/qubes-pass: new aport 2023-03-07 22:19:47 -05:00
e26390b221
user/qubes-meta-packages: new aport 2023-03-07 22:19:38 -05:00
b6d0e57949
user/qubes-libvchan-xen: new aport 2023-03-07 22:19:25 -05:00
e91d597db5
user/qubes-gpg-split: new aport 2023-03-07 22:19:14 -05:00
eae2065489
user/qubes-dmenu: new aport 2023-03-07 22:19:05 -05:00
1860272080
user/qubes-db-vm: new aport 2023-03-07 22:18:50 -05:00
ccdce02954
gitlab-ci: fix public RSA key creation and APKINDEX signing 2023-03-03 02:02:16 -05:00
5f6191c7ff
user/powershell: new aport 2023-02-24 00:00:59 -05:00
1d102ebe56 Merge branch 'dotnet6/initial-317' into 'v3.17'
[3.17] user/dotnet6: new aport

See merge request ayakael/user-aports!18
2023-02-22 23:06:10 +00:00
da96e55577 Merge branch 'dotnet7/initial-317' into 'v3.17'
[3.17] user/dotnet7: new aport

See merge request ayakael/user-aports!17
2023-02-22 23:04:29 +00:00
e8850dd606 Merge branch 'dotnet8/initial-3.17' into 'v3.17'
[3.17] user/dotnet8: new aport

See merge request ayakael/user-aports!6
2023-02-22 22:58:22 +00:00
f578cfba81 Merge branch 'yadm/initial-317' into 'v3.17'
[3.17] user/yadm: new aport

See merge request ayakael/user-aports!14
2023-02-22 07:45:19 +00:00
0255dbb059
user/dotnet6-runtime: new aport 2023-02-22 02:41:24 -05:00
2344a60d0e
user/dotnet6-build: new aport 2023-02-22 02:41:23 -05:00
f1993458ec Merge branch 'freetube/initial-317' into 'v3.17'
[3.17] user/freetube: new aport

See merge request ayakael/user-aports!15
2023-02-22 07:40:54 +00:00
d51259f40b
user/dotnet7-runtime: new aport 2023-02-22 02:39:50 -05:00
487b4f9a3c
user/dotnet7-build: new aport 2023-02-22 02:39:49 -05:00
95ed5e9857
user/freetube: new aport 2023-02-22 02:31:20 -05:00
4f08bdba9f
user/yadm: new aport 2023-02-22 02:30:11 -05:00
ded668560d
gitlab-ci: mkdir artifacts logs 2023-02-21 23:43:50 -05:00
a0e15e45f9
user/dotne8-runtime: new aport 2023-02-21 23:43:49 -05:00
d2c00ba434
user/dotne8-build: new aport 2023-02-21 23:43:48 -05:00
062098717b
user/dotne8-stage0: new aport 2023-02-21 23:43:42 -05:00
1ab405f3e9
gitlab-ci: fix APKINDEX signing on push 2023-02-21 22:14:23 -05:00
8fd3f9a8bf Merge branch 'initial-ci-317' into 'v3.17'
gitlan-ci: initial 3.17 ci

See merge request ayakael/user-aports!3
2023-02-10 05:41:42 +00:00
be4dcb8d87
gitlab-ci: initial v3.17 2023-02-09 21:25:56 -05:00
b6a499c812
gitlab-ci: unhardcode pulled repo-apk branch 2023-02-09 18:03:43 -05:00
f64b20e9ad
gitlab-ci: Initial verify-build-push pipeline 2023-02-09 18:03:33 -05:00
235 changed files with 15833 additions and 801 deletions

26
.forgejo/bin/deploy.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/sh
# shellcheck disable=SC3040
set -eu -o pipefail
readonly REPOS="backports user"
readonly BASEBRANCH=$GITHUB_BASE_REF
readonly TARGET_REPO=$CI_ALPINE_REPO
apkgs=$(find package -type f -name "*.apk")
for apk in $apkgs; do
branch=$(echo $apk | awk -F '/' '{print $2}')
arch=$(echo $apk | awk -F '/' '{print $3}')
name=$(echo $apk | awk -F '/' '{print $4}')
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch"
return=$(curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch 2>&1)
echo $return
if [ "$return" == "package file already exists" ]; then
echo "Package already exists, refreshing..."
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch/$arch/$name
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch
fi
done

View file

@ -0,0 +1,66 @@
diff --git a/usr/local/bin/build.sh.orig b/usr/local/bin/build.sh
old mode 100644
new mode 100755
index c3b8f7a..f609018
--- a/usr/local/bin/build.sh.orig
+++ b/usr/local/bin/build.sh
@@ -7,13 +7,15 @@
set -eu -o pipefail
readonly APORTSDIR=$CI_PROJECT_DIR
-readonly REPOS="main community testing non-free"
+readonly REPOS="backports user"
+readonly ALPINE_REPOS="main community testing"
readonly ARCH=$(apk --print-arch)
# gitlab variables
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
: "${REPODEST:=$HOME/packages}"
-: "${MIRROR:=https://dl-cdn.alpinelinux.org/alpine}"
+: "${MIRROR:=https://ayakael.net/api/packages/forge/alpine}"
+: "${ALPINE_MIRROR:=http://dl-cdn.alpinelinux.org/alpine}"
: "${MAX_ARTIFACT_SIZE:=300000000}" #300M
: "${CI_DEBUG_BUILD:=}"
@@ -68,8 +70,8 @@ report() {
get_release() {
case $BASEBRANCH in
- *-stable) echo v"${BASEBRANCH%-*}";;
- master) echo edge;;
+ v*) echo v"${BASEBRANCH%-*}";;
+ edge) echo edge;;
*) die "Branch \"$BASEBRANCH\" not supported!"
esac
}
@@ -101,11 +103,11 @@ set_repositories_for() {
release=$(get_release)
for repo in $REPOS; do
[ "$repo" = "non-free" ] && continue
- [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
+ [ "$release" == "edge" ] && [ "$repo" == "backports" ] && continue
repos="$repos $MIRROR/$release/$repo $REPODEST/$repo"
[ "$repo" = "$target_repo" ] && break
done
- doas sh -c "printf '%s\n' $repos > /etc/apk/repositories"
+ doas sh -c "printf '%s\n' $repos >> /etc/apk/repositories"
doas apk update
}
@@ -118,7 +120,15 @@ apply_offset_limit() {
}
setup_system() {
- doas sh -c "echo $MIRROR/$(get_release)/main > /etc/apk/repositories"
+ local repos='' repo=''
+ local release
+
+ release=$(get_release)
+ for repo in $ALPINE_REPOS; do
+ [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
+ repos="$repos $ALPINE_MIRROR/$release/$repo"
+ done
+ doas sh -c "printf '%s\n' $repos > /etc/apk/repositories"
doas apk -U upgrade -a || apk fix || die "Failed to up/downgrade system"
abuild-keygen -ain
doas sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf

View file

@ -0,0 +1,52 @@
on:
pull_request:
types: [ assigned, opened, synchronize, reopened ]
jobs:
build-aarch64:
runs-on: aarch64
container:
image: alpinelinux/alpine-gitlab-ci:latest
env:
CI_PROJECT_DIR: ${{ github.workspace }}
CI_DEBUG_BUILD: ${{ runner.debug }}
CI_MERGE_REQUEST_PROJECT_URL: ${{ github.server_url }}/${{ github.repository }}
CI_MERGE_REQUEST_TARGET_BRANCH_NAME: ${{ github.base_ref }}
steps:
- name: Environment setup
run: |
doas apk add nodejs git patch curl
cd /etc/apk/keys
doas curl -JO https://ayakael.net/api/packages/forge/alpine/key
- name: Repo pull
uses: actions/checkout@v4
with:
fetch-depth: 500
- name: Package build
run: |
doas patch -d / -p1 -i ${{ github.workspace }}/.forgejo/patches/build.patch
build.sh
- name: Package upload
uses: forgejo/upload-artifact@v3
with:
name: package
path: packages
deploy-aarch64:
needs: [build-aarch64]
runs-on: aarch64
container:
image: alpine:latest
env:
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
steps:
- name: Setting up environment
run: apk add nodejs curl findutils git gawk
- name: Repo pull
uses: actions/checkout@v4
- name: Package download
uses: forgejo/download-artifact@v3
- name: Package deployment
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh

View file

@ -0,0 +1,52 @@
on:
pull_request:
types: [ assigned, opened, synchronize, reopened ]
jobs:
build-x86_64:
runs-on: x86_64
container:
image: alpinelinux/alpine-gitlab-ci:latest
env:
CI_PROJECT_DIR: ${{ github.workspace }}
CI_DEBUG_BUILD: ${{ runner.debug }}
CI_MERGE_REQUEST_PROJECT_URL: ${{ github.server_url }}/${{ github.repository }}
CI_MERGE_REQUEST_TARGET_BRANCH_NAME: ${{ github.base_ref }}
steps:
- name: Environment setup
run: |
doas apk add nodejs git patch curl
cd /etc/apk/keys
doas curl -JO https://ayakael.net/api/packages/forge/alpine/key
- name: Repo pull
uses: actions/checkout@v4
with:
fetch-depth: 500
- name: Package build
run: |
doas patch -d / -p1 -i ${{ github.workspace }}/.forgejo/patches/build.patch
build.sh
- name: Package upload
uses: forgejo/upload-artifact@v3
with:
name: package
path: packages
deploy-x86_64:
needs: [build-x86_64]
runs-on: x86_64
container:
image: alpine:latest
env:
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
steps:
- name: Setting up environment
run: apk add nodejs curl findutils git gawk
- name: Repo pull
uses: actions/checkout@v4
- name: Package download
uses: forgejo/download-artifact@v3
- name: Package deployment
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh

View file

@ -0,0 +1,21 @@
on:
pull_request:
types: [ assigned, opened, synchronize, reopened ]
jobs:
lint:
run-name: lint
runs-on: x86_64
container:
image: alpinelinux/apkbuild-lint-tools:latest
env:
CI_PROJECT_DIR: ${{ github.workspace }}
CI_DEBUG_BUILD: ${{ runner.debug }}
CI_MERGE_REQUEST_PROJECT_URL: ${{ github.server_url }}/${{ github.repository }}
CI_MERGE_REQUEST_TARGET_BRANCH_NAME: ${{ github.base_ref }}
steps:
- run: doas apk add nodejs git
- uses: actions/checkout@v4
with:
fetch-depth: 500
- run: lint

View file

@ -1,118 +0,0 @@
stages:
- verify
variables:
GIT_STRATEGY: clone
GIT_DEPTH: "500"
lint:
stage: verify
image: alpinelinux/apkbuild-lint-tools:latest
interruptible: true
script:
- lint
allow_failure: true
only:
- merge_requests
tags:
- docker-alpine
- x86_64
.build:
stage: verify
image: alpinelinux/alpine-gitlab-ci:latest
interruptible: true
script:
- build.sh
artifacts:
paths:
- packages/
- keys/
- logs/
expire_in: 1 day
when: always
only:
- merge_requests
build-x86_64:
extends: .build
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_x86_64
tags:
- docker-alpine
- ci-build
- x86_64
build-x86:
extends: .build
image:
name: alpinelinux/alpine-gitlab-ci:latest-x86
entrypoint: ["linux32", "sh", "-c"]
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_x86
tags:
- docker-alpine
- ci-build
- x86
build-s390x:
extends: .build
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_s390x
tags:
- docker-alpine
- ci-build
- s390x
build-ppc64le:
extends: .build
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_ppc64le
tags:
- docker-alpine
- ci-build
- ppc64le
build-aarch64:
extends: .build
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_aarch64
tags:
- docker-alpine
- ci-build
- aarch64
build-armv7:
extends: .build
image:
name: alpinelinux/alpine-gitlab-ci:latest-armv7
entrypoint: ["linux32", "sh", "-c"]
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_armv7
tags:
- docker-alpine
- ci-build
- armv7
build-armhf:
extends: .build
image:
name: alpinelinux/alpine-gitlab-ci:latest-armhf
entrypoint: ["linux32", "sh", "-c"]
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_armhf
tags:
- docker-alpine
- ci-build
- armhf
build-riscv64-emulated:
extends: .build
when: manual
artifacts:
name: MR${CI_MERGE_REQUEST_ID}_riscv64
tags:
- docker-alpine
- ci-build
- riscv64

View file

@ -1,5 +1,62 @@
Repository with various custom APKBUILDs. # ayaports
Upstream: https://ayakael.net/forge/ayaports
Use at your own risk. While they will likely work, as I built them for my own use, I cannot guarantee that they'll stay up to date or that they won't burn your house down. ## Description
One of these days I'll PR them to Alpine's package repository. This repository contains aports that are not yet merged in the official Alpine
Linux repository or dont adhere to Alpine polices. Packages are automatically
built using CI. Once built, they are deployed to a git-lfs repository, making
them available to apk.
Branches are matched to Alpine releases.
## Repositories
You can browse all the repositories at https://codeberg.org/ayakael/ayaports
Affixed to each repository description is the appropriate link for use in
`/etc/apk/repositories`.
#### Backports
```
https://ayakael.net/api/packages/forge/alpine/v3.17/backports
```
Aports from the official Alpine repositories backported from edge.
#### User
```
https://ayakael.net/api/packages/forge/alpine/v3.17/user
```
Aports that have yet to be (or may never be) upstreamed to the official
aports.
## How to use
Add security key of the repo-apk repository to your /etc/apk/keys:
```shell
cd /etc/apk/keys
wget https://ayakael.net/api/packages/forge/alpine/v3.17/antoine.martin@protonmail.com-5b3109ad.rsa.pub
```
Add repositories that you want to use (see above) to `/etc/apk/repositories`.
## Support
Generally, only the latest branch is kept up-to-date. That said, if an aport
is broken on the latest release due to a dependency incompatibility, it will be
kept up-to-date on the release it last works on.
As these aports are built for my own application, I make no guarantees that
they will work for you.
## Contribution & bug reports
If you wish to contribute to this aports collection, or wish to report a bug,
you can do so on Codeberg here:
https://codeberg.org/ayakael/ayaports/issues
For packages that are in backports, bug reports and merge requests
should be done on Alpine's aports repo instance:
https://gitlab.alpinelinux.org/alpine/aports
## License
This readme, abuilds and support scripts are licensed under MIT License.

View file

@ -0,0 +1,46 @@
# Contributor: Kay Thomas <kaythomas@pm.me>
# Maintainer: Kay Thomas <kaythomas@pm.me>
pkgname=airsonic-advanced
_sha=1397446f979b1cdea283eec89ce4f0eae7d63450
pkgver=11.0.0_git20230217
pkgrel=0
pkgdesc="Modern implementation of the Airsonic fork with several key performance and feature enhancements"
url="https://github.com/airsonic-advanced/airsonic-advanced"
# inconsistent test and build failures on other arches
arch="x86_64"
license="GPL-3.0-or-later"
depends="openjdk11"
makedepends="maven"
subpackages="$pkgname-openrc"
pkgusers="airsonic-advanced"
pkggroups="airsonic-advanced"
install="$pkgname.pre-install"
source="$pkgname-$pkgver.tar.gz::https://github.com/airsonic-advanced/airsonic-advanced/archive/$_sha.tar.gz
airsonic-advanced.initd
"
builddir="$srcdir/$pkgname-$_sha"
build() {
mvn clean package -DskipTests
}
check() {
mvn test
}
package() {
install -dm755 -o airsonic-advanced -g airsonic-advanced \
"$pkgdir"/var/airsonic
install -m755 -o airsonic-advanced -g airsonic-advanced \
"$builddir"/airsonic-main/target/airsonic.war \
"$pkgdir"/var/airsonic/airsonic.war
install -Dm755 "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/$pkgname
}
sha512sums="
f415620bdbed9fb3874afbf30d9362e68b1e9e8e90dbbed4ca3206b643cad97ca0558e64ec5b4440382f0ec908c3325e321ea3631c38ff9a2109163c8f0cfe0b airsonic-advanced-11.0.0_git20230217.tar.gz
ca87e6a7199950e6ac52aeb076a03f831d60ee9d4ceed47366bbd78443765d205796d895ebb244051d8033e5b2e9ccd648d20434039c854b8b50e766cc5cd10d airsonic-advanced.initd
"

View file

@ -0,0 +1,14 @@
#!/sbin/openrc-run
supervisor=supervise-daemon
name="airsonic-advanced"
command="/usr/lib/jvm/java-11-openjdk/jre/bin/java"
command_args="-jar airsonic.war"
command_user="airsonic-advanced:airsonic-advanced"
directory="/var/airsonic"
pidfile="/run/airsonic-advanced.pid"
depend() {
need net localmount
after firewall
}

View file

@ -0,0 +1,6 @@
#!/bin/sh
addgroup -S airsonic-advanced 2>/dev/null
adduser -S -D -H -s /sbin/nologin -G airsonic-advanced -g airsonic-advanced airsonic-advanced 2>/dev/null
exit 0

View file

@ -0,0 +1,36 @@
# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
pkgname=electron-tasje
pkgver=0.5.7
pkgrel=0
pkgdesc="Tiny replacement for electron-builder"
url="https://codeberg.org/selfisekai/electron_tasje/"
arch="aarch64 x86_64" # only useful on platforms with electron
license="Apache-2.0"
makedepends="cargo"
source="electron_tasje-$pkgver.tar.gz::https://codeberg.org/selfisekai/electron_tasje/archive/v$pkgver.tar.gz"
builddir="$srcdir/electron_tasje"
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
prepare() {
default_prepare
cargo fetch --target="$CTARGET" --locked
}
build() {
cargo build --frozen --release
}
check() {
cargo test
}
package() {
install -Dm755 target/release/tasje "$pkgdir"/usr/bin/tasje
}
sha512sums="
90649d6c7ac10edc6b50e9bfba54d5df472c0621768886fcdb039874152dbd2a72c1a23f38a5e25e4983f16f49546039eca2b79b9386f261b3c5d31a93c439f5 electron_tasje-0.5.7.tar.gz
"

86
backports/iwd/APKBUILD Normal file
View file

@ -0,0 +1,86 @@
# Contributor: Milan P. Stanić <mps@arvanta.net>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=iwd
pkgver=2.4
pkgrel=0
pkgdesc="Internet Wireless Daemon"
url="https://iwd.wiki.kernel.org/"
arch="all"
license="LGPL-2.1-or-later"
depends="dbus"
makedepends="dbus-dev readline-dev linux-headers"
options="!check" # some builders fail on some test
checkdepends="coreutils"
subpackages="
$pkgname-dbg
$pkgname-doc
$pkgname-openrc
ead
ead-openrc:ead_openrc:noarch
"
source="https://mirrors.edge.kernel.org/pub/linux/network/wireless/iwd-$pkgver.tar.gz
iwd.initd
iwd.confd
ead.initd
ead.confd
main.conf
"
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--disable-systemd-service \
--enable-wired \
--enable-tools
make
}
check() {
make check
}
package() {
make DESTDIR="$pkgdir" install
install -m750 -d "$pkgdir"/var/lib/$pkgname
install -m644 -D "$srcdir"/main.conf "$pkgdir"/etc/$pkgname/main.conf
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}
ead() {
pkgdesc="Ethernet authentication daemon"
amove usr/libexec/ead
install -m750 -d "$subpkgdir"/etc/ead
# ead expects configs in /var/lib/ead, but these are really configs,
# not dynamically generated, so they should be in /etc.
mkdir -p "$subpkgdir"/var/lib
ln -s /etc/ead "$subpkgdir"/var/lib/ead
}
ead_openrc() {
pkgdesc="Ethernet authentication daemon (OpenRC init scripts)"
depends=""
install_if="openrc ead=$pkgver-r$pkgrel"
install -m755 -D "$srcdir"/ead.initd "$subpkgdir"/etc/init.d/ead
install -m644 -D "$srcdir"/ead.confd "$subpkgdir"/etc/conf.d/ead
}
sha512sums="
00e97c9dff8dc86247b1e39e7586f3512f0ae4d2c882267dbabaa1a9b974672287d83d78fbf99b51f1787450d82d69e11eb98e007d3f7c13e66c251a8ebd3754 iwd-2.4.tar.gz
48fb5b5f0b4566a530bf971bcf7ec56ad155340b7d7b73d4e362a73d0395f516c1cd4f13cdf08af8b8b4d4972cbb7ef9b0594a74af474dc1ac949967e116f6fb iwd.initd
c53bfe1b18f0e965d6055e79b40d9f01d13648a4ae6124d2bcb0c6a77dc16f96980df0127c67cecd2a0319a6052f980400bb063d00c87ec016ccb350e3fe797e iwd.confd
8207a411d400bc7932829c959251a3246d1c33d342afa7070023dc90403e58b19518b2c84fe36495075a44724e2deab38970a2cc1f83bfff5abf3dff54b8ea3f ead.initd
4611df202e07178556d61f5642ea82f56cafaee9bf122240d8de8b4937b6bd3458ee7c2d209211523febab942dee184e94c899a1fd4456f8357347030c943c49 ead.confd
09f4097e653cfecfa1e4bc7b4843832785d0a8ef2a8ecf7daa3d5be704d9ac311fbbecf9f9f5b8b1c75beff894e4cf0d8fda4d6ff728a638dedf77aff0197179 main.conf
"

18
backports/iwd/ead.confd Normal file
View file

@ -0,0 +1,18 @@
# Configuration for /etc/init.d/ead
# A comma-separated list of patterns specifying the network interfaces that
# ead is allowed to manage. Defaults to any ethernet interfaces.
#allowed_interfaces=
# A comma-separated list of patterns specifying the network interfaces that
# ead should ignore.
#ignored_interfaces=
# Extra options for ead(8).
#command_args=
# Log messages are redirected to syslog. Set to empty string to disable.
#error_logger="logger -t ead -p daemon.info >/dev/null 2>&1"
# Uncomment to use process supervisor.
# supervisor="supervise-daemon"

20
backports/iwd/ead.initd Normal file
View file

@ -0,0 +1,20 @@
#!/sbin/openrc-run
description="Ethernet authentication daemon"
: ${error_logger="logger -t ead -p daemon.info >/dev/null 2>&1"}
command="/usr/libexec/ead"
command_background="yes"
command_args="
${allowed_interfaces:+"--interfaces \"$allowed_interfaces\""}
${ignored_interfaces:+"--nointerfaces \"$ignored_interfaces\""}
${command_args:-}
"
pidfile="/run/$RC_SVCNAME.pid"
depend() {
need dbus
before net
keyword -shutdown
}

24
backports/iwd/iwd.confd Normal file
View file

@ -0,0 +1,24 @@
# Configuration for /etc/init.d/iwd
# A comma-separated list of patterns specifying the network interfaces that
# iwd is allowed to manage. Defaults to any wireless interfaces.
#allowed_interfaces=
# A comma-separated list of patterns specifying the network interfaces that
# iwd should ignore.
#ignored_interfaces=
# Extra options for iwd(8).
#command_args=
# Log messages are redirected to syslog. Set to empty string to disable.
#error_logger="logger -t iwd -p daemon.info >/dev/null 2>&1"
# Number of milliseconds to wait after starting and check that daemon is
# still running. Set to empty string to disable.
# NOTE: If you use iwd together with ConnMan and ConnMan crashes when started
# right after iwd, increase this period to e.g. 200 ms.
#start_wait=50
# Uncomment to use process supervisor.
# supervisor="supervise-daemon"

25
backports/iwd/iwd.initd Normal file
View file

@ -0,0 +1,25 @@
#!/sbin/openrc-run
description="iNet wireless daemon"
: ${error_logger="logger -t iwd -p daemon.info >/dev/null 2>&1"}
: ${start_wait=50} # milliseconds
command="/usr/libexec/iwd"
command_background="yes"
command_args="
${allowed_interfaces:+"--interfaces \"$allowed_interfaces\""}
${ignored_interfaces:+"--nointerfaces \"$ignored_interfaces\""}
${command_args:-}
"
start_stop_daemon_args="
${start_wait:+--wait $start_wait}
${start_stop_daemon_args:-}
"
pidfile="/run/$RC_SVCNAME.pid"
depend() {
need dbus
before net
keyword -shutdown
}

View file

@ -0,0 +1,17 @@
#!/bin/sh
ver_old=$2
if [ "$(apk version -t "$ver_old" "1.15-r1")" = '<' ]; then
cat >&2 <<-EOF
*
* ead (Ethernet authentication daemon) has been moved from "iwd" into a
* separate package "ead". If you use it: apk add ead.
*
EOF
fi
if [ -f /etc/iwd/main.conf ]; then
sed -i -e s/enable_network_config=True/EnableNetworkConfiguration=True/ /etc/iwd/main.conf
sed -i -e s/resolve_method=resolvconf/NameResolvingService=resolvconf/ /etc/iwd/main.conf
fi

36
backports/iwd/main.conf Normal file
View file

@ -0,0 +1,36 @@
# Note: The lines starting with # are ignored. To enable any of the
# configuration options below, remove # from the beginning of a respective line.
# this file is not distributed upstream as of iwd 1.0 version
# It is created as transitional config from latest version
# Please read iwd.config(5), iwd.network(5), iwctl(1), iwmon(1) before setting
# these parameters below
# main.conf format is changed with iwd 1.3 release
#[EAP]
#mtu=1400
#[EAPoL]
#max_4way_handshake_time=5
#[General]
#EnableNetworkConfiguration=True
#ControlPortOverNL80211=True
#RoamThreshold=-70
#[Network]
#NameResolvingService=resolvconf
#[Scan]
# DisablePeriodicScan=false
# DisableRoamingScan=false
#[Blacklist]
#[Rank]
# BandModifier5Ghz=1.0

View file

@ -0,0 +1,269 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=nextcloud
pkgver=26.0.2
pkgrel=0
_replaced_ver=25
pkgdesc="A safe home for all your data"
url="https://nextcloud.com/"
arch="noarch"
license="AGPL-3.0-only"
_php=php81
_php_mods="-bcmath -ctype -curl -dom -gd -fileinfo -gmp -iconv -intl
-mbstring -opcache -openssl -pcntl -posix -session
-simplexml -xml -xmlreader -xmlwriter -zip"
depends="ca-certificates $_php ${_php_mods//-/$_php-}"
makedepends="xmlstarlet"
provides="$pkgname-accessibility=$pkgver-r$pkgrel
$pkgname-bruteforcesettings=$pkgver-r$pkgrel
$pkgname-contactsinteraction=$pkgver-r$pkgrel
$pkgname-cloud_federation_api=$pkgver-r$pkgrel
$pkgname-dav=$pkgver-r$pkgrel
$pkgname-files=$pkgver-r$pkgrel
$pkgname-files_videoplayer=$pkgver-r$pkgrel
$pkgname-federatedfilesharing=$pkgver-r$pkgrel
$pkgname-lookup_server_connector=$pkgver-r$pkgrel
$pkgname-oauth2=$pkgver-r$pkgrel
$pkgname-provisioning_api=$pkgver-r$pkgrel
$pkgname-related_resources=$pkgver-r$pkgrel
$pkgname-settings=$pkgver-r$pkgrel
$pkgname-theming=$pkgver-r$pkgrel
$pkgname-twofactor_totp=$pkgver-r$pkgrel
$pkgname-twofactor_backupcodes=$pkgver-r$pkgrel
$pkgname-viewer=$pkgver-r$pkgrel
$pkgname-workflowengine=$pkgver-r$pkgrel
"
replaces="nextcloud$_replaced_ver"
install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-upgrade
$pkgname-initscript.post-install"
subpackages="$pkgname-doc $pkgname-initscript $pkgname-mysql $pkgname-pgsql $pkgname-sqlite
$pkgname-default-apps:_default_apps"
source="https://download.nextcloud.com/server/releases/nextcloud-$pkgver.tar.bz2
nextcloud-dont-chmod.patch
dont-update-htaccess.patch
disable-integrity-check-as-default.patch
use-external-docs-if-local-not-avail.patch
$pkgname-config.php
$pkgname.logrotate
$pkgname.confd
$pkgname.cron
$pkgname-mysql.cnf
fpm-pool.conf
occ
"
options="!check"
pkgusers="nextcloud"
pkggroups="www-data"
builddir="$srcdir"/$pkgname
# List of bundled apps to separate into subpackages. Keep it in sync!
# Note: Don't add "bruteforcesettings", "contactsinteraction",
# "cloud_federation_api", "files", "dav",
# "federatedfilesharing", "lookup_server_connector", "provisioning_api",
# "oauth2", "settings", "twofactor_backupcodes", "twofactor_totp",
# "theming", "viewer", "workflowengine", "related_resources"
# here, these should be always installed.
_apps="activity
admin_audit
circles
comments
dashboard
encryption
federation
files_external
files_pdfviewer
files_rightclick
files_sharing
files_trashbin
files_versions
firstrunwizard
logreader
nextcloud_announcements
notifications
password_policy
photos
privacy
recommendations
serverinfo
support
sharebymail
survey_client
suspicious_login
systemtags
text
user_ldap
user_status
weather_status
"
for _i in $_apps; do
subpackages="$subpackages $pkgname-$_i:_package_app"
done
# Directory for apps shipped with Nextcloud.
_appsdir="usr/share/webapps/$pkgname/apps"
package() {
local basedir="var/lib/$pkgname"
local datadir="$basedir/data"
local wwwdir="usr/share/webapps/$pkgname"
local confdir="etc/$pkgname"
mkdir -p "$pkgdir"
cd "$pkgdir"
mkdir -p ./${wwwdir%/*}
cp -a "$builddir" ./$wwwdir
chmod +x ./$wwwdir/occ
chmod 664 ./$wwwdir/.htaccess \
./$wwwdir/.user.ini
# Let's not ship upstream's 'updatenotification' app and updater, which
# has zero chance of working and a big chance of blowing things up.
rm -r ./$wwwdir/apps/updatenotification \
./$wwwdir/lib/private/Updater/VersionCheck.php
# Replace bundled CA bundle with ours.
ln -sf /etc/ssl/certs/ca-certificates.crt ./$wwwdir/resources/config/ca-bundle.crt
install -d -m 770 -o nextcloud -g www-data \
./$confdir ./$datadir ./$basedir/apps
install -d -m 775 -o nextcloud -g www-data \
./var/log/$pkgname
# Create symlink from web root to site-apps, so web server can find
# assets w/o explicit configuration for this layout.
ln -s /$basedir/apps ./$wwwdir/apps-appstore
mv ./$wwwdir/config/* ./$confdir/
rm -r ./$wwwdir/config
ln -s /$confdir ./$wwwdir/config
mkdir -p ./usr/share/doc/$pkgname
mv ./$wwwdir/core/doc ./usr/share/doc/$pkgname/core
install -m 660 -o nextcloud -g www-data \
"$srcdir"/$pkgname-config.php ./$confdir/config.php
install -m 644 -D "$srcdir"/$pkgname.logrotate ./etc/logrotate.d/$pkgname
install -m 755 -D "$srcdir"/occ ./usr/bin/occ
# Clean some unnecessary files.
find . -name .gitignore -delete \
-o -name .bower.json -delete \
-o -name 'README*' -delete \
-o -name 'CHANGELOG*' -delete \
-o -name 'CONTRIBUTING*' -delete
find . -name .github -type d -prune -exec rm -r {} \;
}
doc() {
replaces="nextcloud$_replaced_ver-doc"
default_doc
local target="$subpkgdir"/usr/share/webapps/$pkgname/core/doc
mkdir -p "${target%/*}"
ln -s ../../../doc/$pkgname/core "$target"
install -m644 README.alpine "$subpkgdir"/usr/share/webapps/$pkgname/README.alpine
}
initscript() {
pkgdesc="Init script that runs Nextcloud with php-fpm"
depends="$pkgname $_php-fpm"
replaces="nextcloud$_replaced_ver-initscript"
local confdir="$subpkgdir/etc/$_php/php-fpm.d"
local fpm_name="php-fpm${_php#php}"
install -m 644 -D "$srcdir"/fpm-pool.conf "$confdir"/$pkgname.conf
install -m 644 -D "$srcdir"/$pkgname.confd "$subpkgdir"/etc/conf.d/$pkgname
install -m 755 -D "$srcdir"/$pkgname.cron "$subpkgdir"/etc/periodic/15min/$pkgname
mkdir -p "$subpkgdir"/etc/init.d
ln -s $fpm_name "$subpkgdir"/etc/init.d/$pkgname
}
pgsql() {
pkgdesc="Nextcloud PostgreSQL support"
depends="$pkgname $_php-pgsql $_php-pdo_pgsql"
replaces="nextcloud$_replaced_ver-pgsql"
mkdir -p "$subpkgdir"
}
sqlite() {
pkgdesc="Nextcloud SQLite support"
depends="$pkgname $_php-sqlite3 $_php-pdo_sqlite"
replaces="nextcloud$_replaced_ver-sqlite"
mkdir -p "$subpkgdir"
}
mysql() {
pkgdesc="Nextcloud MySQL support"
depends="$pkgname $_php-pdo_mysql"
replaces="nextcloud$_replaced_ver-mysql"
mkdir -p "$subpkgdir"
install -m 644 -D "$srcdir"/$pkgname-mysql.cnf "$subpkgdir"/etc/my.cnf.d/$pkgname.cnf
}
_default_apps() {
pkgdesc="Nextcloud default apps"
depends="$pkgname"
replaces="nextcloud$_replaced_ver-default-apps"
local path; for path in "$pkgdir"/"$_appsdir"/*; do
if grep -q '<default_enable\s*/>' "$path"/appinfo/info.xml; then
depends="$depends $pkgname-${path##*/}"
fi
done
mkdir -p "$subpkgdir"
}
_package_app() {
local appname="${subpkgname#"$pkgname"-}"
local appinfo="$pkgdir/$_appsdir/$appname/appinfo/info.xml"
local name=$(xmlstarlet sel -t -v 'info/name/text()' "$appinfo")
pkgdesc="Nextcloud ${name:-$appname} app"
replaces="nextcloud$_replaced_ver-$appname"
local php_deps=$(xmlstarlet sel -t -v 'info/dependencies/lib/text()' "$appinfo" \
| xargs -r -n1 printf "$_php-%s\n")
local app_deps=""
case "$appname" in
dashboard) app_deps="-accessibility"
;;
files_sharing) app_deps="-federatedfilesharing"
;;
photos)
app_deps="-viewer"
provides="$pkgname-gallery=$pkgver-r$pkgrel"
replaces="$replaces nextcloud$_replaced_ver-gallery"
;;
serverinfo) app_deps="-files_sharing"
esac
depends="$pkgname $php_deps ${app_deps//-/$pkgname-}"
mkdir -p "$subpkgdir"/$_appsdir
mv "$pkgdir"/$_appsdir/$appname "$subpkgdir"/$_appsdir/
}
sha512sums="
b7e276d19b1cb6591e0155503b549c57be64a87627d7948d161ecdaf17982258369d146d78c21525ef9bf2b4343d40ce98c79a5e2a321f56a3b3bf677304efc5 nextcloud-26.0.2.tar.bz2
aea0adb2c3a48ec6af2958c6ccfe13adff86316a56084e763b7e6df9e21aa3435b13305b7c15cc2b795e83c9388b05006862f6465c29e3dc2c1fbd8eb8befcb9 nextcloud-dont-chmod.patch
aef3c92497d738d6968e0f0b0d415b4953500db24ae14af41ef972665cf7eff00cb6c53dc953845fdbb389c3c965a75b8b14b9247513c05cf4130fe1cfc61731 dont-update-htaccess.patch
d2100a837fef1eeae5f706650ab4c985d9e00f61efa5526ef76c7c1f5811c3906eb6c3c13c151eff9677a0c303faab64411a5a84d6792728bc520d2c618d7d5b disable-integrity-check-as-default.patch
fa63b5de7e6a44d91af6403bd1f2739f0f785b99a1bd5c978b91d1348fead9059d847c228a90e13844c66be60d4ee9186e4ecb18ac367899a7f153211ac057b4 use-external-docs-if-local-not-avail.patch
5f73cd9399fa484ef15bd47e803c93381deffbc7699eceadbb5c27e43b20156806d74e5021a64d28f0165ef87b519e962780651711a37bceb9f0b04455dfdce1 nextcloud-config.php
7388458a9e8b7afd3d3269718306410ffa59c3c23da4bef367a4d7f6d2570136fae9dd421b19c1441e7ffb15a5405e18bb5da67b1a15f9f45e8b98d3fda532ba nextcloud.logrotate
dcc57735d7d4af4a7ebbdd1186d301e51d2ae4675022aea6bf1111222dfa188a3a490ebd6e7c8a7ac30046cb7d93f81cec72a51acbc60d0c10b7fb64630c637a nextcloud.confd
bd077495e4caea88f5d5d8f65e6607ecff03671a26cb08cdcad57bd8e82397f75a2a8f49971c6ebdb8d158904784ff13849fa4944263bbd43056ffced70f054c nextcloud.cron
b9ad5434c384c96608f00d65c45f782e279c6756da8fb706f62ecaf7b7aa420077cb6989da5e85becc47418884ec0672e7db874174454ca679fdca84a50f537f nextcloud-mysql.cnf
78ef204ee7c12b228c0b7b04333514e561c1c8e19153f5507224fa4fdd112aaaa6331747014f3b72181298f52ecd4223bcff4bd963b49b49153265254b07e79b fpm-pool.conf
0c2e880f68f76d04fd8264986cc7735597bb7ede846e7e67dec2bf58fcd85cc4e28e03a3c05c7299e56803eecfbc4d035d9e4dbf09508631c9256a38ed59d413 occ
"

View file

@ -0,0 +1,5 @@
## nextcloud-serverinfo package
If you are using the provided nextcloud php-fpm configuration,
nextcloud-serverinfo package requires to enable 'shell_exec' function
in php configuration file 'nextcloud.conf'.

View file

@ -0,0 +1,15 @@
We patch some files and Nextcloud's integrity check doesn't like it...
APK ensures integrity of all installed files, so this Nextcloud's integrity
check doesn't add any value.
--- a/lib/private/IntegrityCheck/Checker.php
+++ b/lib/private/IntegrityCheck/Checker.php
@@ -111,7 +111,7 @@
*/
$isIntegrityCheckDisabled = false;
if ($this->config !== null) {
- $isIntegrityCheckDisabled = $this->config->getSystemValue('integrity.check.disabled', false);
+ $isIntegrityCheckDisabled = $this->config->getSystemValue('integrity.check.disabled', true);
}
if ($isIntegrityCheckDisabled === true) {
return false;

View file

@ -0,0 +1,32 @@
Don't mess with .htaccess files.
Patch ported from https://src.fedoraproject.org/cgit/rpms/nextcloud.git/tree/nextcloud-9.1.0-dont_update_htacess.patch
--- a/core/register_command.php
+++ b/core/register_command.php
@@ -135,7 +135,6 @@
$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
$application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
- $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
$application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
$application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class)));
--- a/lib/private/Updater.php
+++ b/lib/private/Updater.php
@@ -233,14 +233,6 @@
throw new \Exception('Updates between multiple major versions and downgrades are unsupported.');
}
- // Update .htaccess files
- try {
- Setup::updateHtaccess();
- Setup::protectDataDirectory();
- } catch (\Exception $e) {
- throw new \Exception($e->getMessage());
- }
-
// create empty file in data dir, so we can later find
// out that this is indeed an ownCloud data directory
// (in case it didn't exist before)

View file

@ -0,0 +1,200 @@
[global]
; Error log file
; Default Value: log/php-fpm.log
error_log = /var/log/nextcloud/php-fpm.log
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
log_level = warning
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
emergency_restart_threshold = 10
; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
emergency_restart_interval = 1m
; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
process_control_timeout = 10s
[nextcloud]
user = nextcloud
group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket (the path is *not*
; relative to chroot!)
; Note: This value is mandatory.
listen = /run/nextcloud/fastcgi.sock
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
listen.mode = 0660
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static ... a fixed number of child processes.
; dynamic ... the number of child processes are set dynamically.
; ondemand ... no children are created at startup; children will be forked
; when new requests will connect.
; Note: This value is mandatory.
pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 10
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = 120s
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 500
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page.
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
pm.status_path =
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
ping.path = /ping
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
; Note: the path is *not* relative to chroot.
;slowlog = /var/log/nextcloud/php-fpm.slow.log
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
;
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
;
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/lib/php7.x)
; Allow HTTP file uploads.
php_admin_flag[file_uploads] = true
; Maximal size of a file that can be uploaded via web interface.
php_admin_value[memory_limit] = 512M
php_admin_value[post_max_size] = 513M
php_admin_value[upload_max_filesize] = 513M
; Where to store temporary files.
php_admin_value[session.save_path] = /var/tmp/nextcloud
php_admin_value[sys_temp_dir] = /var/tmp/nextcloud
php_admin_value[upload_tmp_dir] = /var/tmp/nextcloud
; Log errors to specified file.
php_admin_flag[log_errors] = on
php_admin_value[error_log] = /var/log/nextcloud/php.error.log
; OPcache error_log file name. Empty string assumes "stderr"
php_admin_value[opcache.error_log] = /var/log/nextcloud/php.error.log
; Output buffering is a mechanism for controlling how much output data
; (excluding headers and cookies) PHP should keep internally before pushing that
; data to the client. If your application's output exceeds this setting, PHP
; will send that data in chunks of roughly the size you specify.
; This must be disabled for ownCloud.
php_admin_flag[output_buffering] = false
; Overload(replace) single byte functions by mbstring functions.
; This must be disabled for ownCloud.
php_admin_flag[mbstring.func_overload] = false
; Never populate the $HTTP_RAW_POST_DATA variable.
; http://php.net/always-populate-raw-post-data
php_admin_value[always_populate_raw_post_data] = -1
; Disable certain functions for security reasons.
; http://php.net/disable-functions
php_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_open,curl_multi_exec,show_source
; Set recommended settings for OpCache.
; https://docs.nextcloud.com/server/13/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
php_admin_flag[opcache.enable] = true
php_admin_flag[opcache.enable_cli] = true
php_admin_flag[opcache.save_comments] = true
php_admin_value[opcache.interned_strings_buffer] = 8
php_admin_value[opcache.max_accelerated_files] = 10000
php_admin_value[opcache.memory_consumption] = 128
php_admin_value[opcache.revalidate_freq] = 1

View file

@ -0,0 +1,37 @@
<?php
$CONFIG = array (
'datadirectory' => '/var/lib/nextcloud/data',
'logfile' => '/var/log/nextcloud/nextcloud.log',
'apps_paths' => array (
// Read-only location for apps shipped with Nextcloud and installed by apk.
0 => array (
'path' => '/usr/share/webapps/nextcloud/apps',
'url' => '/apps',
'writable' => false,
),
// Writable location for apps installed from AppStore.
1 => array (
'path' => '/var/lib/nextcloud/apps',
'url' => '/apps-appstore',
'writable' => true,
),
),
'updatechecker' => false,
'check_for_working_htaccess' => false,
// Uncomment to enable Zend OPcache.
//'memcache.local' => '\OC\Memcache\APCu',
// Uncomment this and add user nextcloud to the redis group to enable Redis
// cache for file locking. This is highly recommended, see
// https://github.com/nextcloud/server/issues/9305.
//'memcache.locking' => '\OC\Memcache\Redis',
//'redis' => array(
// 'host' => '/run/redis/redis.sock',
// 'port' => 0,
// 'dbindex' => 0,
// 'timeout' => 1.5,
//),
'installed' => false,
);

View file

@ -0,0 +1,58 @@
commit d8f09abd65e5fd620b8b0d720daee293c355660c
Author: Leonardo Arena <rnalrd@alpinelinux.org>
Date: Mon Aug 31 06:59:15 2020 +0000
Don't chmod. The package takes care of setting the right permissions for directories and files
diff --git a/lib/private/Config.php b/lib/private/Config.php
index cbdbc5b2..1118981b 100644
--- a/lib/private/Config.php
+++ b/lib/private/Config.php
@@ -242,9 +242,6 @@ class Config {
touch($this->configFilePath);
$filePointer = fopen($this->configFilePath, 'r+');
- // Prevent others not to read the config
- chmod($this->configFilePath, 0640);
-
// File does not exist, this can happen when doing a fresh install
if (!is_resource($filePointer)) {
throw new HintException(
diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php
index 9e9abb11..7db25286 100644
--- a/lib/private/Log/File.php
+++ b/lib/private/Log/File.php
@@ -82,9 +82,6 @@ class File extends LogDetails implements IWriter, IFileBased {
public function write(string $app, $message, int $level) {
$entry = $this->logDetailsAsJSON($app, $message, $level);
$handle = @fopen($this->logFile, 'a');
- if ($this->logFileMode > 0 && is_file($this->logFile) && (fileperms($this->logFile) & 0777) != $this->logFileMode) {
- @chmod($this->logFile, $this->logFileMode);
- }
if ($handle) {
fwrite($handle, $entry."\n");
fclose($handle);
diff --git a/lib/private/TempManager.php b/lib/private/TempManager.php
index 49d4ee94..b0943843 100644
--- a/lib/private/TempManager.php
+++ b/lib/private/TempManager.php
@@ -96,7 +96,6 @@ class TempManager implements ITempManager {
if ($postFix !== '') {
$fileNameWithPostfix = $this->buildFileNameWithSuffix($file, $postFix);
touch($fileNameWithPostfix);
- chmod($fileNameWithPostfix, 0600);
$this->current[] = $fileNameWithPostfix;
return $fileNameWithPostfix;
}
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index 71f6edba..216abdf8 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -1004,7 +1004,6 @@ class OC_Util {
. ' cannot be listed by other users.');
$perms = substr(decoct(@fileperms($dataDirectory)), -3);
if (substr($perms, -1) !== '0') {
- chmod($dataDirectory, 0770);
clearstatcache();
$perms = substr(decoct(@fileperms($dataDirectory)), -3);
if ($perms[2] !== '0') {

View file

@ -0,0 +1,28 @@
#!/bin/sh
# It's not needed to be writable for www-data group when running with php-fpm.
for dir in /etc/nextcloud \
/etc/nextcloud/config.php \
/var/lib/nextcloud/data \
/var/lib/nextcloud/apps
do
chmod g-w $dir
done
chgrp root /etc/nextcloud/config.php
# This must be writable (only) by nextcloud user.
chmod 750 /var/log/nextcloud
mkdir /var/tmp/nextcloud # If /var/tmp doesn't exist there's a big problem
chown nextcloud /var/tmp/nextcloud
chmod 700 /var/tmp/nextcloud
cat <<EOF
*
* Point your web server to /run/nextcloud/fastcgi.sock and start Nextcloud with
* /etc/init.d/nextcloud start. You can modify php-fpm settings in
* /etc/php81/fpm.d/nextcloud.conf.
*
EOF
exit 0

View file

@ -0,0 +1,3 @@
[server]
# See https://github.com/nextcloud/server/issues/25436
innodb_read_only_compressed=off

View file

@ -0,0 +1,8 @@
# Config file for /etc/init.d/nextcloud
name="Nextcloud"
user="nextcloud"
group="www-data"
# Uncomment if you use Nextcloud with Redis for caching.
#rc_need="redis"

View file

@ -0,0 +1,6 @@
#!/bin/sh
# Run only when nextcloud service is started.
if rc-service nextcloud -q status >/dev/null 2>&1; then
su nextcloud -s /bin/sh -c 'php81 -f /usr/share/webapps/nextcloud/cron.php'
fi

View file

@ -0,0 +1,6 @@
/var/log/nextcloud/*.log {
daily
compress
copytruncate
su nextcloud www-data
}

View file

@ -0,0 +1,57 @@
#!/bin/sh
ver_new="$1"
ver_old="$2"
if [ $(apk version -t "$ver_old" '12.0.0-r2') = '<' ]; then
cat >&2 <<-EOF
*
* All Nextcloud's bundled apps (except "files" and "dav") have been moved to
* separate subpackages (e.g. nextcloud-activity). If you want to install
* all apps that are enabled by default at once, run:
*
* apk add nextcloud-default-apps
*
EOF
if [ "$(ls -A /var/lib/nextcloud/apps)" ]; then
cat >&2 <<-EOF
*
* Nextcloud's bundled apps have been moved from /var/lib/nextcloud/apps
* to /usr/share/webapps/nextcloud/apps. Only apps installed from App Store
* should be stored in /var/lib/nextcloud/apps.
*
* It seems that you have installed some apps from App Store, so you have to
* add /var/lib/nextcloud/apps to your apps_paths. Copy "apps_paths" key
* from /etc/nextcloud/config.php.apk-new to your config.php.
*
EOF
fi
fi
if [ $(apk version -t "$ver_old" '15.0.2-r0') = '<' ]; then
cat >&2 <<-EOF
*
* App "user_external" is no longer available via release channel.
* You need to uninstall the package and install it via appstore:
*
* apk del nextcloud-user_external
*
EOF
fi
if [ $(apk version -t "$ver_old" '20.0.0-r0') = '<' ]; then
cat >&2 <<-EOF
*
* If you are updating from Alpine 3.12->3.13
* please use the transitional package nextcloud19
* to upgrade from Nextcloud 18->20
*
EOF
fi
if [ "${ver_new%-r*}" != "${ver_old%-r*}" ]; then
echo ' * Run "occ upgrade" to finish upgrading your NextCloud instance!' >&2
fi

View file

@ -0,0 +1,6 @@
#!/bin/sh
addgroup -S -g 82 www-data 2>/dev/null
adduser -S -D -H -h /var/lib/nextcloud -s /sbin/nologin -G www-data -g Nextcloud nextcloud 2>/dev/null
exit 0

View file

@ -0,0 +1,10 @@
#!/bin/sh
ver_old="$2"
apps_link='/usr/share/webapps/nextcloud/apps'
# Remove apps symlink before replacing files to avoid losing installed apps.
# This is a workaround for some issue in apk.
if [ $(apk version -t "$ver_old" '12.0.0-r2') = '<' ] && [ -L "$apps_link" ]; then
rm "$apps_link"
fi

10
backports/nextcloud/occ Normal file
View file

@ -0,0 +1,10 @@
#!/bin/sh
NEXTCLOUD_DIR='/usr/share/webapps/nextcloud'
: ${NEXTCLOUD_USER:="nextcloud"}
if [ "$(id -un)" != "$NEXTCLOUD_USER" ]; then
exec su -s /bin/sh "$NEXTCLOUD_USER" -c '$0 "$@"' -- php81 $NEXTCLOUD_DIR/occ "$@"
else
exec php81 $NEXTCLOUD_DIR/occ "$@"
fi

View file

@ -0,0 +1,32 @@
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Tue, 27 Jun 2017 02:07:00 +0200
Subject: [PATCH] Show link to external docs if local is not installed
---
apps/settings/templates/help.php | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/apps/settings/templates/help.php b/apps/settings/templates/help.php
index 18cba185..45b5c8d5 100644
--- a/apps/settings/templates/help.php
+++ b/apps/settings/templates/help.php
@@ -43,6 +43,17 @@
</div>
<div id="app-content" class="help-includes">
+<?php if ($_['localDocs']) { ?>
<iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe" tabindex="0">
</iframe>
+<?php } else { ?>
+ <div class="section">
+ <h2>Local documentation is not installed</h2>
+ <p>Please use
+ <a href="<?php print_unescaped($_['url']); ?>" target="_blank" rel="noreferrer">
+ <?php p($l->t('online documentation')); ?> ↗
+ </a>
+ </p>
+ </div>
+<?php } ?>
</div>
--
2.37.3

View file

@ -0,0 +1,33 @@
# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php81-pecl-inotify
_extname=inotify
pkgver=3.0.0
pkgrel=0
pkgdesc="Inotify bindings for PHP 8.1"
url="https://pecl.php.net/package/inotify"
arch="all"
license="PHP-3.01"
depends="php81-common"
makedepends="php81-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver
build() {
phpize81
./configure --prefix=/usr --with-php-config=php-config81
make
}
check() {
make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}
package() {
make INSTALL_ROOT="$pkgdir" install
local _confdir="$pkgdir"/etc/php81/conf.d
install -d $_confdir
echo "extension=$_extname" > $_confdir/70_$_extname.ini
}
sha512sums="f8b29f8611f16b92136ab8de89181c254bba1abee1e61cac2344440567a3155aae4b9b54b10fdb1b0254fd7a96da8c14b7dc5c9f7f08a03db30ab1645aca1eee php-pecl-inotify-3.0.0.tgz"

View file

@ -0,0 +1,40 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=py3-cachetools
_pyname=cachetools
pkgver=5.3.0
pkgrel=0
pkgdesc="Extensible memoizing collections and decorators"
url="https://github.com/tkem/cachetools"
arch="noarch"
license="MIT"
depends="python3"
makedepends="
py3-gpep517
py3-setuptools
py3-wheel
"
checkdepends="py3-pytest"
source="$pkgname-$pkgver.tar.gz::https://github.com/tkem/cachetools/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"
build() {
gpep517 build-wheel \
--wheel-dir dist \
--output-fd 3 3>&1 >&2
}
check() {
python3 -m venv --clear --without-pip --system-site-packages testenv
testenv/bin/python3 -m installer dist/*.whl
testenv/bin/python3 -m pytest
}
package() {
python3 -m installer -d "$pkgdir" \
dist/*.whl
}
sha512sums="
6b600f48f28b98c5480a1952317c2f27c132cf609c6651e66165351f23fba6c028cdbf1bba0f2159a622d8cd3db9bfa09dde7e08e15929336e82358f61e495bc py3-cachetools-5.3.0.tar.gz
"

View file

@ -0,0 +1,60 @@
# Contributor: Keith Maxwell <keith.maxwell@gmail.com>
# Maintainer: Keith Maxwell <keith.maxwell@gmail.com>
pkgname=py3-google-auth
_pyname=google-auth
pkgver=2.17.0
pkgrel=0
pkgdesc="Google authentication library for Python."
url="https://google-auth.readthedocs.io/en/latest/"
arch="noarch"
license="Apache-2.0"
depends="
python3
py3-cachetools
py3-asn1-modules
py3-rsa
py3-six
"
makedepends="
py3-gpep517
py3-setuptools
py3-wheel
"
checkdepends="
py3-certifi
py3-cryptography
py3-flask
py3-freezegun
py3-grpcio
py3-mock
py3-oauth2client
py3-openssl
py3-pytest
py3-pytest-cov
py3-pytest-localserver
py3-pyu2f
py3-requests
py3-responses
py3-urllib3
"
source="https://files.pythonhosted.org/packages/source/g/google-auth/google-auth-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"
build() {
gpep517 build-wheel \
--wheel-dir dist \
--output-fd 3 3>&1 >&2
}
check() {
python3 -m pytest
}
package() {
python3 -m installer -d "$pkgdir" \
dist/*.whl
}
sha512sums="
2942f385febf8d2a3f3827e048646e01c06ac3c2880ebb06d5a6eaeeb3d258cbd5ba7d969c7aee00a74332b5ce9b43a9474daa9e2e1de72bfb5f97dfb8065b96 google-auth-2.17.0.tar.gz
"

View file

@ -0,0 +1,32 @@
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-sentry-sdk
pkgver=1.23.0
pkgrel=0
pkgdesc="The new Python SDK for Sentry.io"
url="https://sentry.io/for/python/"
arch="noarch"
license="BSD-2-Clause"
options="!check" # test depends on sanic that is not avail atm
depends="python3 py3-certifi py3-urllib3"
makedepends="py3-setuptools"
# only starting v3.18
#subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/getsentry/sentry-python/archive/$pkgver.tar.gz"
builddir="$srcdir"/sentry-python-$pkgver
build() {
python3 setup.py build
}
check() {
python3 setup.py test
}
package() {
python3 setup.py install --skip-build --root="$pkgdir"
}
sha512sums="
6cb0fda5c73e7f3a3e33458479ab40f6f33c661b9ddf69eaf6630c22004ff8a21157a3be454e583717b7d1999bff26bbe8d8e3d719e42c42612f1c5ddf0767b5 py3-sentry-sdk-1.23.0.tar.gz
"

View file

@ -1,8 +1,8 @@
# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks> # Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks> # Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
pkgname=signal-desktop pkgname=signal-desktop
pkgver=6.1.0 pkgver=6.12.0
pkgrel=0 pkgrel=1
pkgdesc="A messaging app for simple private communication with friends" pkgdesc="A messaging app for simple private communication with friends"
url="https://github.com/signalapp/Signal-Desktop/" url="https://github.com/signalapp/Signal-Desktop/"
# same as electron # same as electron
@ -24,9 +24,11 @@ makedepends="
alsa-lib-dev alsa-lib-dev
bsd-compat-headers bsd-compat-headers
cargo cargo
cbindgen
clang-dev clang-dev
cmake cmake
electron-dev electron-dev
electron-tasje
ffmpeg-dev ffmpeg-dev
git-lfs git-lfs
glib-dev glib-dev
@ -53,31 +55,35 @@ makedepends="
options="net !check" options="net !check"
# follow signal-desktop package.json -> @signalapp/libsignal-client # follow signal-desktop package.json -> @signalapp/libsignal-client
_libsignalver=0.21.1 _libsignalver=0.22.0
# follow signal-desktop package.json -> ringrtc -> commit title # follow signal-desktop package.json -> @signalapp/ringrtc
_ringrtcver=2.22.0 _ringrtcver=2.25.2
# follow ringrtc (on version above) -> config/version.sh -> WEBRTC_VERSION # follow ringrtc (on version above) -> config/version.properties -> webrtc.version
# downloading tarball generated with abuild snapshot (with gclient dependencies fetched) # downloading tarball generated with abuild snapshot (with gclient dependencies fetched)
_webrtcver=5005b _webrtcver=5481
# follow @signalapp/better-sqlite3 (on version in package.json) -> deps/download.js -> TOKENIZER_VERSION
# last bsqlite version: 8.4.3
_stokenizerver=0.2.1
source=" source="
https://github.com/signalapp/Signal-Desktop/archive/refs/tags/v$pkgver/Signal-Desktop-$pkgver.tar.gz https://github.com/signalapp/Signal-Desktop/archive/refs/tags/v$pkgver/Signal-Desktop-$pkgver.tar.gz
https://github.com/signalapp/libsignal/archive/refs/tags/v$_libsignalver/libsignal-$_libsignalver.tar.gz https://github.com/signalapp/libsignal/archive/refs/tags/v$_libsignalver/libsignal-$_libsignalver.tar.gz
https://github.com/signalapp/ringrtc/archive/refs/tags/v$_ringrtcver/ringrtc-$_ringrtcver.tar.gz https://github.com/signalapp/ringrtc/archive/refs/tags/v$_ringrtcver/ringrtc-$_ringrtcver.tar.gz
https://s3.sakamoto.pl/lnl-aports-snapshots/webrtc-$_webrtcver.tar.xz https://s3.sakamoto.pl/lnl-aports-snapshots/webrtc-$_webrtcver.tar.xz
https://github.com/signalapp/Signal-FTS5-Extension/archive/refs/tags/v$_stokenizerver/stokenizer-$_stokenizerver.tar.gz
bettersqlite-use-system-sqlcipher.patch bettersqlite-use-system-sqlcipher.patch
signal-build-expire-time.patch libsignal-too-new-clang.patch
signal-disable-updates.patch signal-disable-updates.patch
signal-update-links.patch signal-update-links.patch
webrtc-canonicalize-file-name.patch signal-tasje-whatever-the-fuck-is-ignore-doing-here.patch
webrtc-use-alpine-target.patch webrtc-use-alpine-target.patch
webrtc-no-shared-deps-in-static-lib.patch webrtc-no-shared-deps-in-static-lib.patch
signal-desktop signal-desktop
signal-desktop.desktop
" "
builddir="$srcdir/Signal-Desktop-$pkgver" builddir="$srcdir/Signal-Desktop-$pkgver"
@ -90,12 +96,13 @@ export NM=llvm-nm
export LD=clang++ export LD=clang++
# less log spam, reproducible, allow lto with rust # less log spam, reproducible, allow lto with rust
export CFLAGS="${CFLAGS/-g/} -O2 -Wno-deprecated-builtins -Wno-unknown-warning-option -Wno-builtin-macro-redefined" export CFLAGS="${CFLAGS/-g/} -O2 -Wno-error -Wno-deprecated-builtins -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-deprecated-builtins -Wno-unknown-warning-option -Wno-builtin-macro-redefined" export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-error -Wno-deprecated-builtins -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
export CPPFLAGS="$CPPFLAGS -D__DATE__= -D__TIME__= -D__TIMESTAMP__=" export CPPFLAGS="$CPPFLAGS -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
export CARGO_PROFILE_RELEASE_OPT_LEVEL=2 export CARGO_PROFILE_RELEASE_OPT_LEVEL=2
export CARGO_PROFILE_RELEASE_STRIP="symbols" export CARGO_PROFILE_RELEASE_STRIP="symbols"
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
export RUSTFLAGS="$RUSTFLAGS -C linker=clang -C link-arg=-fuse-ld=lld" export RUSTFLAGS="$RUSTFLAGS -C linker=clang -C link-arg=-fuse-ld=lld"
export YARN_CACHE_FOLDER="$srcdir/.yarn" export YARN_CACHE_FOLDER="$srcdir/.yarn"
@ -105,12 +112,18 @@ snapshot() {
mkdir -p "$srcdir" mkdir -p "$srcdir"
cd "$srcdir" cd "$srcdir"
# cleanup if retrying
rm -rf src
rm -rf webrtc-$_webrtcver
rm -f webrtc-$_webrtcver.tar
rm -f webrtc-$_webrtcver.tar.xz
echo " echo "
solutions = [{ solutions = [{
'name': 'src', 'name': 'src',
'url': 'https://github.com/signalapp/webrtc.git@$_webrtcver', 'url': 'https://github.com/signalapp/webrtc.git@$_webrtcver',
}] }]
target_cpu = ['x64'] target_cpu = ['x64', 'arm64']
target_cpu_only = True target_cpu_only = True
" > .gclient " > .gclient
@ -132,6 +145,7 @@ target_cpu_only = True
--exclude="testdata/" \ --exclude="testdata/" \
--exclude="test_data/" \ --exclude="test_data/" \
--exclude="android_rust_toolchain/toolchain/" \ --exclude="android_rust_toolchain/toolchain/" \
--exclude="base/" \
--exclude-backups \ --exclude-backups \
--exclude-caches-all \ --exclude-caches-all \
--exclude-vcs \ --exclude-vcs \
@ -141,9 +155,6 @@ target_cpu_only = True
} }
prepare() { prepare() {
ln -s "$srcdir"/webrtc-$_webrtcver "$srcdir"/ringrtc-$_ringrtcver/src/webrtc
ln -sf "$srcdir"/ringrtc-$_ringrtcver/src "$srcdir"/webrtc-$_webrtcver/ringrtc
msg "Applying patches" msg "Applying patches"
for x in $source; do for x in $source; do
case "$x" in case "$x" in
@ -151,6 +162,10 @@ prepare() {
msg "$x" msg "$x"
patch -p1 -i "$srcdir"/$x -d "$srcdir"/Signal-Desktop-$pkgver patch -p1 -i "$srcdir"/$x -d "$srcdir"/Signal-Desktop-$pkgver
;; ;;
libsignal-*.patch)
msg "$x"
patch -p1 -i "$srcdir"/$x -d "$srcdir"/libsignal-$_libsignalver
;;
ringrtc-*.patch) ringrtc-*.patch)
msg "$x" msg "$x"
patch -p1 -i "$srcdir"/$x -d "$srcdir"/ringrtc-$_ringrtcver patch -p1 -i "$srcdir"/$x -d "$srcdir"/ringrtc-$_ringrtcver
@ -208,6 +223,30 @@ prepare() {
# allow system dependencies in "official builds" # allow system dependencies in "official builds"
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
tools/generate_shim_headers/generate_shim_headers.py tools/generate_shim_headers/generate_shim_headers.py
mkdir path
ln -s /usr/bin/python3 path/vpython3
)
(
cd "$srcdir"/ringrtc-$_ringrtcver/src/rust
msg "Installing ringrtc rust dependencies"
cargo fetch --target="$CTARGET" --locked
)
(
cd "$srcdir"/libsignal-$_libsignalver
msg "Installing libsignal rust dependencies"
cargo fetch --target="$CTARGET" --locked
)
(
cd "$srcdir"/Signal-FTS5-Extension-$_stokenizerver
msg "Installing signal tokenizer rust dependencies"
cargo fetch --target="$CTARGET" --locked
) )
( (
@ -237,7 +276,9 @@ build() {
# required dependency of ringrtc # required dependency of ringrtc
( (
cd "$srcdir"/webrtc-$_webrtcver cd "$srcdir"/webrtc-$_webrtcver
export PATH="$PWD/path:$PATH"
# shellcheck disable=2089
local webrtc_args=" local webrtc_args="
rtc_build_examples=false rtc_build_examples=false
rtc_build_tools=false rtc_build_tools=false
@ -251,6 +292,7 @@ build() {
build_with_mozilla=false build_with_mozilla=false
chrome_pgo_phase=0 chrome_pgo_phase=0
clang_use_chrome_plugins=false clang_use_chrome_plugins=false
clang_base_path=\"/usr\"
custom_toolchain=\"//build/toolchain/linux/unbundle:default\" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
is_cfi=false is_cfi=false
is_clang=true is_clang=true
@ -269,15 +311,11 @@ build() {
" "
mkdir -p "$srcdir"/ringrtc-$_ringrtcver/out/release mkdir -p "$srcdir"/ringrtc-$_ringrtcver/out/release
msg "Building signal's webrtc" msg "Building signal's webrtc"
# shellcheck disable=2090,2116
gn gen "$srcdir"/ringrtc-$_ringrtcver/out/release --args="$(echo $webrtc_args)" gn gen "$srcdir"/ringrtc-$_ringrtcver/out/release --args="$(echo $webrtc_args)"
ninja -C "$srcdir"/ringrtc-$_ringrtcver/out/release webrtc ninja -C "$srcdir"/ringrtc-$_ringrtcver/out/release webrtc
) )
# add lto for the remaining c steps (sqlite)
export CFLAGS="$CFLAGS -flto"
export CXXFLAGS="$CXXFLAGS -flto"
export LDFLAGS="$LDFLAGS -flto -fuse-ld=lld"
( (
cd "$srcdir"/ringrtc-$_ringrtcver/src/rust cd "$srcdir"/ringrtc-$_ringrtcver/src/rust
@ -292,6 +330,9 @@ build() {
cd "$srcdir"/ringrtc-$_ringrtcver/src/node cd "$srcdir"/ringrtc-$_ringrtcver/src/node
msg "Building ringrtc JS glue code" msg "Building ringrtc JS glue code"
yarn build yarn build
msg "Cleaning dev dependencies for ringrtc"
yarn --ignore-scripts --frozen-lockfile --production
) )
# module on npm intentionally unbuildable: https://github.com/signalapp/libsignal/issues/464#issuecomment-1160665052 # module on npm intentionally unbuildable: https://github.com/signalapp/libsignal/issues/464#issuecomment-1160665052
@ -307,6 +348,17 @@ build() {
msg "Building libsignal glue code" msg "Building libsignal glue code"
yarn tsc yarn tsc
msg "Cleaning dev dependencies for libsignal"
yarn --ignore-scripts --frozen-lockfile --production
)
(
cd "$srcdir"/Signal-FTS5-Extension-$_stokenizerver
msg "Building signal tokenizer"
cargo build --features extension --release --frozen
cbindgen --profile release . -o target/release/signal-tokenizer.h
) )
# from package.json postinstall # from package.json postinstall
@ -314,41 +366,66 @@ build() {
yarn patch-package yarn patch-package
rm -rf node_modules/dtrace-provider rm -rf node_modules/dtrace-provider
# get esbuild installed (needed for next step)
npm rebuild esbuild
# build front
NODE_ENV=production \
SIGNAL_ENV=production \
NODE_OPTIONS=--openssl-legacy-provider \
yarn build:dev
# purge non-production deps
yarn install --ignore-scripts --frozen-lockfile --production
# XXX: the previous step undoes the patches. and removes the patch applier.
# please force me to just implement packaging without dev modules in tasje. -lnl
for x in patches/*.patch; do
# some of these patches are made for devDependencies
if [ -d "$(grep -Eo 'node_modules/(@[a-z\d_-]+/)?[a-z\d_-]+/' "$x" | head -n1)" ]; then
msg "$x"
patch -Np1 -i ./"$x"
fi
done
# use our libsignal # use our libsignal
rm -rf node_modules/@signalapp/libsignal-client/ rm -rf node_modules/@signalapp/libsignal-client/
ln -s "$srcdir"/libsignal-$_libsignalver/node/ node_modules/@signalapp/libsignal-client mv "$srcdir"/libsignal-$_libsignalver/node/ node_modules/@signalapp/libsignal-client
# use our libringrtc # use our libringrtc
rm -rf node_modules/ringrtc/ rm -rf node_modules/@signalapp/ringrtc/
ln -s "$srcdir"/ringrtc-$_ringrtcver/src/node/ node_modules/ringrtc mv "$srcdir"/ringrtc-$_ringrtcver/src/node/ node_modules/@signalapp/ringrtc
# patch the sqlcipher module # patch the sqlcipher module
for x in $source; do for x in $source; do
case "$x" in case "$x" in
bettersqlite-*.patch) bettersqlite-*.patch)
msg "$x" msg "$x"
patch -Np1 -i "$srcdir"/$x -d "$srcdir"/Signal-Desktop-$pkgver/node_modules/better-sqlite3/ patch -Np1 -i "$srcdir"/$x -d "$srcdir"/Signal-Desktop-$pkgver/node_modules/@signalapp/better-sqlite3/
;; ;;
esac esac
done done
# use system-provided font mkdir node_modules/@signalapp/better-sqlite3/tokenizer
echo '' > node_modules/typeface-inter/inter.css mv "$srcdir"/Signal-FTS5-Extension-$_stokenizerver/target/release/libsignal_tokenizer.a node_modules/@signalapp/better-sqlite3/tokenizer/
rm -rf 'node_modules/typeface-inter/Inter '* mv "$srcdir"/Signal-FTS5-Extension-$_stokenizerver/target/release/signal-tokenizer.h node_modules/@signalapp/better-sqlite3/tokenizer/
npm rebuild sharp better-sqlite3 --nodedir=/usr/include/electron/node_headers --build-from-source npm rebuild \
sharp @signalapp/better-sqlite3 spellchecker websocket \
utf-8-validate bufferutil fs-xattr \
--nodedir=/usr/include/electron/node_headers --build-from-source
# unnecessary/unused native modules, blobs
find node_modules -type d -path '**/prebuilds' \
\! -path 'node_modules/@signalapp/libsignal-client/prebuilds' -exec rm -r {} \+
find node_modules -type d -path '**/build/*/obj.target' -exec rm -r {} \+
rm -r 'node_modules/@signalapp/libsignal-client/build/'
find node_modules/@signalapp/better-sqlite3 -type f -path 'build/**/*' \
\! -path 'build/Release/better_sqlite3.node' -delete
rm -r 'node_modules/@signalapp/better-sqlite3/tokenizer'
NODE_ENV=production \
SIGNAL_ENV=production \ SIGNAL_ENV=production \
NODE_OPTIONS=--openssl-legacy-provider \ tasje pack
yarn build:dev
NODE_ENV=production \
SIGNAL_ENV=production \
yarn build:electron \
--config.extraMetadata.environment=production \
--config.directories.output=release \
--linux=dir
} }
check() { check() {
@ -357,31 +434,31 @@ check() {
} }
package() { package() {
cd "$builddir"/release/linux-unpacked cd "$builddir"/tasje_out
install -Dm644 resources/app.asar "$pkgdir"/usr/lib/$pkgname/app.asar install -Dm644 resources/app.asar "$pkgdir"/usr/lib/$pkgname/app.asar
cp -r resources/app.asar.unpacked "$pkgdir"/usr/lib/$pkgname/app.asar.unpacked cp -r resources/app.asar.unpacked "$pkgdir"/usr/lib/$pkgname/app.asar.unpacked
install -Dm644 $pkgname.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop
install -Dm755 "$srcdir"/$pkgname "$pkgdir"/usr/bin/$pkgname install -Dm755 "$srcdir"/$pkgname "$pkgdir"/usr/bin/$pkgname
install -Dm644 "$srcdir"/$pkgname.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop
for i in 16 32 48 128 250 256 1024; do while read -r size; do
install -Dm644 "$builddir"/images/icon_$i.png "$pkgdir"/usr/share/icons/hicolor/${i}x$i/apps/$pkgname.png install -Dm644 icons/$size.png "$pkgdir"/usr/share/icons/hicolor/$size/apps/$pkgname.png
done done < icons/size-list
} }
sha512sums=" sha512sums="
8f5234fa018e0590b3cad934ab46797bef16ff489a36a05364df7f43be80022143e8034665d2f24a171401bfac3315a16918d702a249c9ef8acd1de78e30f52e Signal-Desktop-6.1.0.tar.gz 84e1e9f40aed65dbe48a98b8f7c863956e8e4922c6a6d7340db19f949e5077067100568ecab8005ee9ffe272b9f3efaf72f40dbb16aab30952aa1df10844904d Signal-Desktop-6.12.0.tar.gz
d2c13bf0d96eb706afe018c0ef9b377f3f50d2a82690f6ccb7260efa7cc620fb5c52ae775d598d6ebcaa581acfaab244dfe6f7f1738755604bf860cd548a62b6 libsignal-0.21.1.tar.gz 9483c8d302728d6caa123f1fb9a977c7cb3aea09ecd1d2cfb3b19f2f2c66f884c41e37642c89db4eeeb0d607fddf281ba27ba4bd0a90e43b972d0cbc607e1483 libsignal-0.22.0.tar.gz
e263390ea2ae877edb39e9973a8c8a03e2f396f255ca48487311031c69493a93da0dedbce5f10adfef4859cb8e51579bf285fbd9b94f98fabd538acaee18c413 ringrtc-2.22.0.tar.gz 148a6ab28e1115612144d74e2bdc70712674db19f1735343626605269eb97047feba7981dbb1269527d7779a8c2059be32adbfd65823f3fa601305f303e45b7c ringrtc-2.25.2.tar.gz
748f870d35b9a9789311c3d7cee9c0bc150aed8094838406e0a1969f2f824900ffec40d0b4fe2702f2f93d4a78d7987b0f91668cff859a8a34517663b138f8b5 webrtc-5005b.tar.xz 7b6c03da2c6fd33a60b56c29d35b56919aa3f0b7b02ba172010eaff29513d2f33dc434538d15caf9c39cbbd961f979bcda9de06edd98dcd794cc2c3c835ffcab webrtc-5481.tar.xz
1aaf59c2d401ae127ed73981be330cd999794a217b455cb8033652063eb7b549c7070c63f54e4e60bf4338b475e162b6eae98683c3ce058e8f1a407588b3b2e1 bettersqlite-use-system-sqlcipher.patch 84a1f2fc29262a12842e94698d124a85b823128e72a493b0be8ea92fbb72c5c268499f4a6827cdedaae06ec73cce4039a39fe5c5d536cbef330e59ba0183da28 stokenizer-0.2.1.tar.gz
3ecfbd1b0cd03d1a697f3e53c057fa8bc2118de48ff0c3f07f8bb731f128f9478862a388efb36dd4dbc1dc5ad9977165a935fe65664aea915b8b80c38e801070 signal-build-expire-time.patch be5b4e823543b79175a12314f10c6326d9f0d59f470136962daed4665887006acc05b48b40dc1b67747396d8f6f7d23be298c1e110ccdd35ff9b09d5e6b80bab bettersqlite-use-system-sqlcipher.patch
78be44ef201d9e6e127979a496f7244c8d93e936f85ad8753fea1646e6142f8a0dbff705ba612c8c724d19e6a9e89ccae254719326021818e04cccef452fc308 libsignal-too-new-clang.patch
60a45285d885922f5c21f64b761a10efbee9081baf3efa4c8c13abc6a43dc4d27662ed10e239b0fa2071ab9e3a0dbbb4b11d6e3d26fe2b74a19f39e72b74a5bd signal-disable-updates.patch 60a45285d885922f5c21f64b761a10efbee9081baf3efa4c8c13abc6a43dc4d27662ed10e239b0fa2071ab9e3a0dbbb4b11d6e3d26fe2b74a19f39e72b74a5bd signal-disable-updates.patch
c68a2a6a37c1cdea227f29c0922b9bf15259f044e9b3240b120bba14809d04d66cf0b619f52bb91abd596ad93e51e972be132b5951d0e8f6ea238fcb7bb613eb signal-update-links.patch e50edde5a3a5b691eea4a595bd79672c207542ece710e53c26c70d7d2807335a418cfb9dc1aef6ce61ee41ee771a07534345ef4daaee8f0fdb4bab98a4034f0f signal-update-links.patch
252b37a2ecc5e7a25385943045f426dc2e30991b28d206ceaff1be7fd8ffeeb024310a8fca6b3e69a4b1c57db535d51c570935351053525f393682d5ecd0f9a9 webrtc-canonicalize-file-name.patch 536bca17e9ae774cd4c26e9012f628bee1273587e5b5db866de577025b0b9a36c68ec970d61605cdc3d470032adcdf53b948368b6cb4fe7f1bffe69d87371daf signal-tasje-whatever-the-fuck-is-ignore-doing-here.patch
6add8b4c293f5392748a2eec9486cb4a6534e161977c6a98de71617b9abcdd1e8ad94b44014256a4b52e33eb9dd4aca380279d4161629a1bb2d7b15f8eb5b459 webrtc-use-alpine-target.patch 354f516a74c5491727afe084ef7688b3e1359d230daa720ffc30b33d3ea7579c9f37a50fbdc5fe2e8dc5322e42a0a39e4ae3449d4cf5b77daed2229bd743028c webrtc-use-alpine-target.patch
bab56a33265b5b094f161af1462166e371913a5269fe8e7d12e9f65ec4f5b908157406b3bcbcf73db15d03470445127d27c64fd731b6ea57c631aba3f4d302cb webrtc-no-shared-deps-in-static-lib.patch bab56a33265b5b094f161af1462166e371913a5269fe8e7d12e9f65ec4f5b908157406b3bcbcf73db15d03470445127d27c64fd731b6ea57c631aba3f4d302cb webrtc-no-shared-deps-in-static-lib.patch
87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop 87534e7b5ad7365509eab75629e6bd1a9ed61ee92f7e358405a0abaf0df57de14623fb3894eb082f8785422e5c087e1c50f9e2e5cafbb2529591fd7bf447f7f5 signal-desktop
87ef5f3ffcf64e3cae308aa0f6bc208fb05dd8568f6a288217cdf8498ae1523f276987a7be8d6f5208f13394bab350e08734d806a8e7c08849dd8ba0dda49d66 signal-desktop.desktop
" "

View file

@ -5,20 +5,20 @@
{ {
'target_name': 'better_sqlite3', 'target_name': 'better_sqlite3',
- 'dependencies': ['deps/sqlite3.gyp:sqlite3'], - 'dependencies': ['deps/sqlite3.gyp:sqlite3'],
+ 'include_dirs': ['/usr/include/sqlcipher'], + 'include_dirs': [
+ 'direct_dependent_settings': { + '/usr/include/sqlcipher',
+ 'include_dirs': ['/usr/include/sqlcipher'], + 'tokenizer',
+ }, + ],
+ 'link_settings': { + 'link_settings': {
+ 'libraries': [ + 'libraries': [
+ '-L/usr/lib/sqlcipher',
+ '-lsqlcipher', + '-lsqlcipher',
+ '<!(pwd)/tokenizer/libsignal_tokenizer.a',
+ ] + ]
+ }, + },
'sources': ['src/better_sqlite3.cpp'], 'sources': ['src/better_sqlite3.cpp'],
'cflags_cc': ['-std=c++17'], 'cflags_cc': ['-std=c++17'],
'xcode_settings': { 'xcode_settings': {
@@ -17,14 +26,22 @@ @@ -24,14 +33,22 @@
['OS=="linux"', { ['OS=="linux"', {
'ldflags': [ 'ldflags': [
'-Wl,-Bsymbolic', '-Wl,-Bsymbolic',
@ -30,16 +30,27 @@
{ {
'target_name': 'test_extension', 'target_name': 'test_extension',
- 'dependencies': ['deps/sqlite3.gyp:sqlite3'], - 'dependencies': ['deps/sqlite3.gyp:sqlite3'],
+ 'include_dirs': ['/usr/include/sqlcipher'], + 'include_dirs': [
+ 'direct_dependent_settings': { + '/usr/include/sqlcipher',
+ 'include_dirs': ['/usr/include/sqlcipher'], + 'tokenizer',
+ }, + ],
+ 'link_settings': { + 'link_settings': {
+ 'libraries': [ + 'libraries': [
+ '-L/usr/lib/sqlcipher',
+ '-lsqlcipher', + '-lsqlcipher',
+ '<!(pwd)/tokenizer/libsignal_tokenizer.a',
+ ] + ]
+ }, + },
'conditions': [['sqlite3 == ""', { 'sources': ['deps/test_extension.c'] }]], 'conditions': [['sqlite3 == ""', { 'sources': ['deps/test_extension.c'] }]],
}, },
], ],
--- a/package.json
+++ b/package.json
@@ -34,7 +34,7 @@
"sqlite3": "^5.0.2"
},
"scripts": {
- "install": "npm run download && npm run build-release",
+ "install": "npm run build-release",
"build-release": "node-gyp rebuild --release",
"build-debug": "node-gyp rebuild --debug",
"rebuild-release": "npm run lzz && npm run build-release",

View file

@ -0,0 +1,89 @@
core issue: https://github.com/rust-lang/rust-bindgen/issues/2312
upstream: https://github.com/signalapp/boring/pull/19
upstream's upstream: https://github.com/cloudflare/boring/pull/110
--- ./Cargo.toml.orig
+++ ./Cargo.toml
@@ -25,3 +25,6 @@
# Use our fork of curve25519-dalek for eventual zkgroup support.
curve25519-dalek = { git = 'https://github.com/signalapp/curve25519-dalek', branch = 'lizard2' }
boring = { git = 'https://github.com/signalapp/boring', branch = 'libsignal'}
+
+[patch.'https://github.com/signalapp/boring']
+boring-sys = { git = 'https://github.com/selfisekai/boring-cf', branch = 'i109-signal', package = 'boring-sys' }
--- ./Cargo.lock.orig
+++ ./Cargo.lock
@@ -206,9 +206,9 @@
[[package]]
name = "bindgen"
-version = "0.60.1"
+version = "0.62.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6"
+checksum = "c6720a8b7b2d39dd533285ed438d458f65b31b5c257e6ac7bb3d7e82844dd722"
dependencies = [
"bitflags",
"cexpr",
@@ -221,6 +221,7 @@
"regex",
"rustc-hash",
"shlex",
+ "syn",
]
[[package]]
@@ -295,7 +296,7 @@
[[package]]
name = "boring-sys"
version = "2.1.0"
-source = "git+https://github.com/signalapp/boring?branch=libsignal#25e1dd8fa519ae90772008fbd4a284582096fece"
+source = "git+https://github.com/selfisekai/boring-cf?branch=i109-signal#5c13f5c357c8b33c9978f2e447de2d6caf825d13"
dependencies = [
"bindgen",
"cmake",
@@ -1398,11 +1399,11 @@
[[package]]
name = "proc-macro2"
-version = "1.0.29"
+version = "1.0.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d"
+checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534"
dependencies = [
- "unicode-xid",
+ "unicode-ident",
]
[[package]]
@@ -1868,13 +1869,13 @@
[[package]]
name = "syn"
-version = "1.0.80"
+version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
- "unicode-xid",
+ "unicode-ident",
]
[[package]]
@@ -1981,6 +1982,12 @@
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "unicode-segmentation"

View file

@ -1,15 +0,0 @@
--- a/ts/scripts/get-expire-time.ts
+++ b/ts/scripts/get-expire-time.ts
@@ -7,11 +7,7 @@
import { DAY } from '../util/durations';
-const unixTimestamp = parseInt(
- execSync('git show -s --format=%ct').toString('utf8'),
- 10
-);
-const buildCreation = unixTimestamp * 1000;
+const buildCreation = new Date().getTime();
const buildExpiration = buildCreation + DAY * 90;

View file

@ -1,10 +0,0 @@
[Desktop Entry]
Name=Signal
Exec=/usr/bin/signal-desktop %U
Terminal=false
Type=Application
Icon=signal-desktop
StartupWMClass=Signal
Comment=Private messaging from your desktop
MimeType=x-scheme-handler/sgnl;x-scheme-handler/signalcaptcha;
Categories=Network;InstantMessaging;Chat;

View file

@ -0,0 +1,12 @@
--- a/package.json
+++ b/package.json
@@ -465,9 +465,7 @@
"!node_modules/spellchecker/vendor/hunspell/**/*",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,test,__tests__,tests,powered-test,example,examples,*.d.ts,.snyk-*.flag,benchmark}",
"!**/node_modules/.bin",
- "!**/node_modules/**/build/**",
"node_modules/intl-tel-input/build/**",
- "!**/node_modules/**/prebuilds/**",
"!**/*.{o,hprof,orig,pyc,pyo,rbc,c,h,m}",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,thumbs.db,.gitignore,.gitattributes,.flowconfig,.yarn-metadata.json,.idea,appveyor.yml,.travis.yml,circle.yml,npm-debug.log,.nyc_output,yarn.lock,.yarn-integrity}",

View file

@ -12,14 +12,14 @@
hasAction hasAction
> >
{i18n('expiredWarning')}{' '} {i18n('expiredWarning')}{' '}
--- a/ts/components/DialogUpdate.tsx --- ./ts/types/support.ts.orig
+++ b/ts/components/DialogUpdate.tsx +++ ./ts/types/support.ts
@@ -27,7 +27,7 @@ @@ -1,7 +1,7 @@
currentVersion: string; // Copyright 2023 Signal Messenger, LLC
}; // SPDX-License-Identifier: AGPL-3.0-only
-const PRODUCTION_DOWNLOAD_URL = 'https://signal.org/download/'; -export const PRODUCTION_DOWNLOAD_URL = 'https://signal.org/download/';
+const PRODUCTION_DOWNLOAD_URL = 'https://pkgs.alpinelinux.org/packages?name=signal-desktop'; +export const PRODUCTION_DOWNLOAD_URL = 'https://pkgs.alpinelinux.org/packages?name=signal-desktop';
const BETA_DOWNLOAD_URL = 'https://support.signal.org/beta'; export const BETA_DOWNLOAD_URL = 'https://support.signal.org/beta';
export const UNSUPPORTED_OS_URL =
export const DialogUpdate = ({ 'https://support.signal.org/hc/articles/5109141421850';

View file

@ -1,13 +0,0 @@
no canonicalize_file_name on musl. funnily, the file using this says this is
not portable, but avoids the nonportability of realpath(path, NULL);
--- a/third_party/nasm/config/config-linux.h
+++ b/third_party/nasm/config/config-linux.h
@@ -139,7 +139,7 @@
#define HAVE_ACCESS 1
/* Define to 1 if you have the `canonicalize_file_name' function. */
-#define HAVE_CANONICALIZE_FILE_NAME 1
+/* #define HAVE_CANONICALIZE_FILE_NAME 1 */
/* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
/* #undef HAVE_CPU_TO_LE16 */

View file

@ -0,0 +1,22 @@
this breaks the clang include path
--
--- a/build/config/compiler/BUILD.gn
+++ a/build/config/compiler/BUILD.gn
@@ -1310,7 +1310,7 @@
# paths to the tools it invokes. We don't want this because we don't
# really need it and it can mess up the goma cache entries.
if (is_clang && (!is_nacl || is_nacl_saigo)) {
- cflags += [ "-no-canonical-prefixes" ]
+ #cflags += [ "-no-canonical-prefixes" ]
# Same for links: Let the compiler driver invoke the linker
# with a relative path and pass relative paths to built-in
@@ -1319,7 +1319,7 @@
# We don't link on goma, so this change is just for cleaner
# internal linker invocations, for people who work on the build.
if (!is_win) {
- ldflags += [ "-no-canonical-prefixes" ]
+ #ldflags += [ "-no-canonical-prefixes" ]
}
}
}

View file

@ -1,13 +1,13 @@
--- ./build/config/compiler/BUILD.gn --- ./build/config/compiler/BUILD.gn
+++ ./build/config/compiler/BUILD.gn +++ ./build/config/compiler/BUILD.gn
@@ -766,8 +766,8 @@ @@ -937,8 +937,8 @@
}
} else if (current_cpu == "arm64") { } else if (current_cpu == "arm64") {
if (is_clang && !is_android && !is_nacl && !is_fuchsia) { if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
!(is_chromeos_lacros && is_chromeos_device)) {
- cflags += [ "--target=aarch64-linux-gnu" ] - cflags += [ "--target=aarch64-linux-gnu" ]
- ldflags += [ "--target=aarch64-linux-gnu" ] - ldflags += [ "--target=aarch64-linux-gnu" ]
+ cflags += [ "--target=aarch64-alpine-linux-musl" ] + cflags += [ "--target=aarch64-alpine-linux-musl" ]
+ ldflags += [ "--target=aarch64-alpine-linux-musl" ] + ldflags += [ "--target=aarch64-alpine-linux-musl" ]
} }
} else if (current_cpu == "mipsel" && !is_nacl) { if (is_android) {
ldflags += [ "-Wl,--hash-style=sysv" ] # Outline atomics crash on Exynos 9810. http://crbug.com/1272795

View file

@ -2,14 +2,16 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net> # Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=authentik pkgname=authentik
pkgver=2022.12.2 pkgver=2023.5.3
pkgrel=0 pkgrel=1
pkgdesc="An open-source Identity Provider focused on flexibility and versatility" pkgdesc="An open-source Identity Provider focused on flexibility and versatility"
url="https://github.com/goauthentik/authentik" url="https://github.com/goauthentik/authentik"
arch="all" arch="all"
license="MIT" license="MIT"
depends=" depends="
postgresql postgresql
procps
pwgen
py3-aiohttp py3-aiohttp
py3-aiosignal py3-aiosignal
py3-amqp py3-amqp
@ -40,11 +42,11 @@ depends="
py3-cryptography py3-cryptography
py3-dacite py3-dacite
py3-daphne py3-daphne
py3-daphne
py3-dateutil py3-dateutil
py3-deepmerge py3-deepmerge
py3-defusedxml py3-defusedxml
py3-deprecated py3-deprecated
py3-dnspython
py3-django py3-django
py3-django-channels py3-django-channels
py3-django-channels-redis py3-django-channels-redis
@ -61,6 +63,7 @@ depends="
py3-dotenv py3-dotenv
py3-dumb-init py3-dumb-init
py3-duo-client py3-duo-client
py3-email-validator
py3-facebook-sdk py3-facebook-sdk
py3-flower py3-flower
py3-frozenlist py3-frozenlist
@ -86,14 +89,14 @@ depends="
py3-oauthlib py3-oauthlib
py3-opencontainers py3-opencontainers
py3-openssl py3-openssl
py3-packaging<=21.3-r2 py3-packaging
py3-paramiko py3-paramiko
py3-parsing py3-parsing
py3-prometheus-client py3-prometheus-client
py3-prompt_toolkit py3-prompt_toolkit
py3-psycopg2 py3-psycopg2
py3-pycryptodome py3-pycryptodome
py3-pydantic py3-pydantic-scim
py3-pynacl py3-pynacl
py3-pyrsistent py3-pyrsistent
py3-python-jwt py3-python-jwt
@ -117,7 +120,7 @@ depends="
py3-tz py3-tz
py3-ua-parser py3-ua-parser
py3-uritemplate py3-uritemplate
py3-urllib3 py3-urllib3-secure-extra
py3-uvloop py3-uvloop
py3-vine py3-vine
py3-watchdog py3-watchdog
@ -146,6 +149,8 @@ source="
$pkgname-$pkgver.tar.gz::https://github.com/goauthentik/authentik/archive/refs/tags/version/$pkgver.tar.gz $pkgname-$pkgver.tar.gz::https://github.com/goauthentik/authentik/archive/refs/tags/version/$pkgver.tar.gz
authentik.openrc authentik.openrc
authentik-worker.openrc authentik-worker.openrc
authentik-ldap.openrc
authentik-ldap.conf
root-settings-csrf_trusted_origins.patch root-settings-csrf_trusted_origins.patch
" "
builddir="$srcdir/"authentik-version-$pkgver builddir="$srcdir/"authentik-version-$pkgver
@ -157,11 +162,13 @@ export GOTMPDIR=$srcdir
build() { build() {
msg "Building authentik-ldap" msg "Building authentik-ldap"
go build -o ldap cmd/ldap/server.go go build -o ldap cmd/ldap/main.go
msg "Building authentik-proxy" msg "Building authentik-proxy"
go build -o proxy cmd/proxy/server.go go build -o proxy cmd/proxy/main.go
msg "Building authentik-radius"
go build -o radius cmd/proxy/main.go
msg "Building authentik-server" msg "Building authentik-server"
go build -o server cmd/server/main.go go build -o server cmd/server/*.go
msg "Building authentik-web" msg "Building authentik-web"
cd web cd web
@ -184,39 +191,47 @@ package() {
msg "Packaging $pkgname" msg "Packaging $pkgname"
mkdir -p "$pkgdir"/usr/share/webapps/authentik/web mkdir -p "$pkgdir"/usr/share/webapps/authentik/web
mkdir -p "$pkgdir"/usr/share/webapps/authentik/website mkdir -p "$pkgdir"/usr/share/webapps/authentik/website
mkdir -p "$pkgdir"/var/lib/authentik
mkdir -p "$pkgdir"/usr/share/doc mkdir -p "$pkgdir"/usr/share/doc
mkdir -p "$pkgdir"/usr/bin mkdir -p "$pkgdir"/usr/bin
cp -dr "$builddir"/authentik "$pkgdir"/usr/share/webapps/authentik cp -dr "$builddir"/authentik "$pkgdir"/usr/share/webapps/authentik
cp -dr "$builddir"/web/dist "$pkgdir"/usr/share/webapps/authentik/web/dist cp -dr "$builddir"/web/dist "$pkgdir"/usr/share/webapps/authentik/web/dist
cp -dr "$builddir"/web/authentik "$pkgdir"/usr/share/webapps/authentik/web/authentik cp -dr "$builddir"/web/authentik "$pkgdir"/usr/share/webapps/authentik/web/authentik
cp -dr "$builddir"/website/build "$pkgdir"/usr/share/doc/authentik cp -dr "$builddir"/website/build "$pkgdir"/usr/share/doc/authentik
cp -dr "$builddir"/xml "$pkgdir"/usr/share/webapps/authentik/xml
cp -dr "$builddir"/tests "$pkgdir"/usr/share/webapps/authentik/tests cp -dr "$builddir"/tests "$pkgdir"/usr/share/webapps/authentik/tests
cp -dr "$builddir"/lifecycle "$pkgdir"/usr/share/webapps/authentik/lifecycle cp -dr "$builddir"/lifecycle "$pkgdir"/usr/share/webapps/authentik/lifecycle
cp -dr "$builddir"/locale "$pkgdir"/usr/share/webapps/authentik/locale cp -dr "$builddir"/locale "$pkgdir"/usr/share/webapps/authentik/locale
cp -dr "$builddir"/blueprints "$pkgdir"/var/lib/authentik/blueprints
install -Dm755 "$builddir"/manage.py "$pkgdir"/usr/share/webapps/authentik/manage.py install -Dm755 "$builddir"/manage.py "$pkgdir"/usr/share/webapps/authentik/manage.py
install -Dm755 "$builddir"/server "$pkgdir"/usr/share/webapps/authentik/server install -Dm755 "$builddir"/server "$pkgdir"/usr/share/webapps/authentik/server
ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml
install -Dm755 "$builddir"/proxy "$pkgdir"/usr/bin/authentik-proxy install -Dm755 "$builddir"/proxy "$pkgdir"/usr/bin/authentik-proxy
install -Dm755 "$builddir"/ldap "$pkgdir"/usr/bin/authentik-ldap install -Dm755 "$builddir"/ldap "$pkgdir"/usr/bin/authentik-ldap
install -Dm755 "$builddir"/radius "$pkgdir"/usr/bin/authentik-radius
install -Dm755 "$srcdir"/$pkgname.openrc \ install -Dm755 "$srcdir"/$pkgname.openrc \
"$pkgdir"/etc/init.d/$pkgname "$pkgdir"/etc/init.d/$pkgname
install -Dm755 "$srcdir"/$pkgname-worker.openrc \ install -Dm755 "$srcdir"/$pkgname-worker.openrc \
"$pkgdir"/etc/init.d/$pkgname-worker "$pkgdir"/etc/init.d/$pkgname-worker
install -Dm755 "$srcdir"/$pkgname-ldap.openrc \
"$pkgdir"/etc/init.d/$pkgname-ldap
install -Dm640 "$srcdir"/$pkgname-ldap.conf \
"$pkgdir"/etc/conf.d/$pkgname-ldap
install -Dm640 "$builddir"/authentik/lib/default.yml \ install -Dm640 "$builddir"/authentik/lib/default.yml \
"$pkgdir"/etc/authentik/config.yml "$pkgdir"/etc/authentik/config.yml
sed -i 's|cert_discovery_dir.*|cert_discovery_dir: /var/lib/authentik/certs|' "$pkgdir"/etc/authentik/config.yml sed -i 's|cert_discovery_dir.*|cert_discovery_dir: /var/lib/authentik/certs|' "$pkgdir"/etc/authentik/config.yml
sed -i 's|blueprints_dir.*|blueprints_dir: /var/lib/authentik/blueprints|' "$pkgdir"/etc/authentik/config.yml sed -i 's|blueprints_dir.*|blueprints_dir: /var/lib/authentik/blueprints|' "$pkgdir"/etc/authentik/config.yml
sed -i 's|template_dir.*|template_dir: /var/lib/authentik/templates|' "$pkgdir"/etc/authentik/config.yml sed -i 's|template_dir.*|template_dir: /var/lib/authentik/templates|' "$pkgdir"/etc/authentik/config.yml
echo "\ncsrf:\n trusted_origins: ['auth.example.com']" >> "$pkgdir"/etc/authentik/config.yml printf "\ncsrf:\n trusted_origins: ['auth.example.com']" >> "$pkgdir"/etc/authentik/config.yml
echo "\nsecret_key: '@@SECRET_KEY@@'" >> "$pkgdir"/etc/authentik/config.yml printf "\nsecret_key: '@@SECRET_KEY@@'" >> "$pkgdir"/etc/authentik/config.yml
} }
sha512sums=" sha512sums="
b0856e37c5daa48bc032e91da0a1c71938824e4c21a54d0a008d32f16ab4a76c0f0c6cac6a0460aebae44a97653851a3fad764fa0955f7e43429603c61edb550 authentik-2022.12.2.tar.gz 84e3582d58a70576bfd2c2d04cc4083721beb2c3c4c015b71bb705439aa5ebf5c36b41220a95d5df8e7154cbfc42aedfb8d1608aab13289af1fb279a8aa0781b authentik-2023.5.3.tar.gz
4defb4fe3a4230f4aa517fbecd5e5b8bcef2a64e1b40615660ae9eec33597310a09df5e126f4d39ce7764bd1716c0a7040637699135c103cbc1879593c6c06f1 authentik.openrc 4defb4fe3a4230f4aa517fbecd5e5b8bcef2a64e1b40615660ae9eec33597310a09df5e126f4d39ce7764bd1716c0a7040637699135c103cbc1879593c6c06f1 authentik.openrc
5d7f28bf5a9f358a0fc3634b2bac6d070c276c3f8181d26fa7e94a17503a4d54556bf7c3207ccd6cb924b81754ed965795d5e2a8aa1af409fd9e32d390ec4cf5 authentik-worker.openrc 5d7f28bf5a9f358a0fc3634b2bac6d070c276c3f8181d26fa7e94a17503a4d54556bf7c3207ccd6cb924b81754ed965795d5e2a8aa1af409fd9e32d390ec4cf5 authentik-worker.openrc
351e6920d987861f8bf0d7ab2f942db716a8dbdad1f690ac662a6ef29ac0fd46cf817cf557de08f1c024703503d36bc8b46f0d9eb1ecaeb399dce4c3bb527d17 authentik-ldap.openrc
89ee5f0ffdade1c153f3a56ff75b25a7104aa81d8c7a97802a8f4b0eab34850cee39f874dabe0f3c6da3f71d6a0f938f5e8904169e8cdd34d407c8984adee6b0 authentik-ldap.conf
483befe5e2c90c4f37d5b3ef95ebb99a4208927ee0481e948117a79e36cce110ed53eaa0a9a816cf30ba4c0691b504c9c08d2f9dd7a7bc465a618af260aa1145 root-settings-csrf_trusted_origins.patch 483befe5e2c90c4f37d5b3ef95ebb99a4208927ee0481e948117a79e36cce110ed53eaa0a9a816cf30ba4c0691b504c9c08d2f9dd7a7bc465a618af260aa1145 root-settings-csrf_trusted_origins.patch
" "

View file

@ -0,0 +1,3 @@
AUTHENTIK_HOST=https://example.com
AUTHENTIK_TOKEN=your-authentik-token
AUTHENTIK_INSECURE=true

View file

@ -0,0 +1,24 @@
#!/sbin/openrc-run
name="$RC_SVCNAME"
cfgfile="/etc/conf.d/$RC_SVCNAME"
pidfile="/run/$RC_SVCNAME.pid"
working_directory="/usr/share/webapps/authentik"
command="/usr/bin/authentik-ldap"
command_user="authentik"
command_group="authentik"
start_stop_daemon_args=""
command_background="yes"
output_log="/var/log/authentik/$RC_SVCNAME.log"
error_log="/var/log/authentik/$RC_SVCNAME.err"
depend() {
need authentik
}
start_pre() {
cd "$working_directory"
checkpath --directory --owner $command_user:$command_group --mode 0775 \
/var/log/authentik
export AUTHENTIK_HOST AUTHENTIK_TOKEN AUTHENTIK_INSECURE AUTHENTIK_DEBUG
}

View file

@ -9,7 +9,8 @@ setcap 'cap_net_bind_service=+ep' /usr/share/webapps/authentik/server
if [ $(grep '@@SECRET_KEY@@' "$config_file") ]; then if [ $(grep '@@SECRET_KEY@@' "$config_file") ]; then
echo "* Generating random secret in $config_file" >&2 echo "* Generating random secret in $config_file" >&2
sed -i "s|@@SECRET_KEY@@|$(pwgen -s 50 1 )" "$config_file" secret_key="$(pwgen -s 50 1)"
sed -i "s|@@SECRET_KEY@@|$secret_key|" "$config_file"
chown root:$group "$config_file" chown root:$group "$config_file"
chmod 0640 "$config_file" chmod 0640 "$config_file"
fi fi

549
user/dotnet6-build/APKBUILD Normal file
View file

@ -0,0 +1,549 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# secfixes:
# 6.0.106-r0:
# - CVE-2022-30184
# 6.0.108-r0:
# - CVE-2022-34716
# 6.0.109-r0:
# - CVE-2022-38013
# 6.0.110-r0:
# - CVE-2022-41032
# 6.0.112-r0:
# - CVE-2022-41089
# 6.0.113-r0:
# - CVE-2023-21538
# 6.0.114-r0:
# - CVE-2023-21808
pkgname=dotnet6-build
pkgver=6.0.115
pkgrel=0
_gittag=v$pkgver
_giturl="https://github.com/dotnet/installer"
_testtag=4832cef147bac35fdd5c57275a795e683bba0bb8
_bunnytag=71880bd94711519f7b786248a88a827a401207a2
_patches="
aspnetcore_46735-set-known-good-runtimeid.patch
build_14816-non-portable-build.patch
build_14816-stop-overriding-aspnetcore-version.patch
build_14816-update-portable-rid-logic.patch
build_disable-apphost.diff
check_rid-alpine-generation.diff
installer_14816-crossgen2-rid.patch
installer_14816-update-portable-rid-logic.patch
msbuild_optional-systemconfiguration.patch
msbuild_optional-systemsecurity.patch
roslyn_57003-mono-namedmutex.patch
runtime_76500-mono-musl-support.patch
runtime_82269-mono-thread-coop-undefine-fortify-source.patch
runtime_enable-system-libunwind.diff
runtime_lld-fix.patch
sdk_14239-add-zsh-compdef-completion-script.patch
sdk_telemetry-optout.patch
"
_pkgver_macro=${pkgver%.*}
_pkgver_prior=${pkgver%.*.*}
_pkgver_name=${_pkgver_macro//[.0]}
pkgdesc="The .NET $_pkgver_macro bootstrap"
arch="x86_64 aarch64 armv7 s390x"
url=https://dotnet.microsoft.com
license="MIT"
# hack for dotnetx-build to be able to pull itself for bootstrapping
provides="dotnet$_pkgver_name-bootstrap"
provider_priority=$_pkgver_prior
checkdepends="
babeltrace
binutils
coreutils
file
gawk
jq
lttng-tools
npm
procps
sed
strace
util-linux-misc
which
"
makedepends="
bash
clang
cmake
dotnet$_pkgver_name-bootstrap
dotnet$_pkgver_name-bootstrap-artifacts
dotnet$_pkgver_name-stage0
findutils
git
grep
icu-data-full
icu-dev
inetutils-syslogd
krb5-dev
libgit2-dev
libintl
libucontext-dev
libunwind-dev
libxml2-dev
libxml2-utils
linux-headers
lldb-dev
llvm-dev
lttng-ust-dev
nodejs
numactl-dev
openssl-dev
pigz
rsync
tar
xz
zlib-dev
"
case $CARCH in
s390x|x86) ;;
*) makedepends="$makedepends lld-dev";;
esac
subpackages="
dotnet$_pkgver_name-artifacts:artifacts:noarch
dotnet$_pkgver_name-sdk
dotnet$_pkgver_name-templates:templates:noarch
dotnet-zsh-completion:zshcomp:noarch
dotnet-bash-completion:bashcomp:noarch
dotnet-doc
netstandard21-targeting-pack:netstandard_targeting_pack:noarch
"
source="
https://lab.ilot.io/dotnet/installer/-/releases/$_gittag/downloads/tarball/dotnet-$_gittag.tar.xz
dotnet-testsuite-$_testtag.tar.gz::https://github.com/redhat-developer/dotnet-regular-tests/archive/$_testtag.tar.gz
dotnet-bunny-$_bunnytag.tar.gz::https://github.com/redhat-developer/dotnet-bunny/archive/$_bunnytag.tar.gz
$_patches
"
builddir="$srcdir"/dotnet-v$pkgver
_checkdir="$srcdir"/dotnet-bunny-${_bunnytag/v}
_testdir="$srcdir"/dotnet-regular-tests-$_testtag
_cli_root="$srcdir"/bootstrap
_nugetdir="$srcdir"/nuget-cache
_artifactsdir="$_cli_root"/artifacts
_libdir="/usr/lib"
# if true, then within pipeline environment, in which case send logs there
# to be scooped
if [ -d "$APORTSDIR/logs" ]; then
_logdir="$APORTSDIR"/logs/$pkgname
else
_logdir="$srcdir"/logs
fi
case $CARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7) _dotnet_arch="arm";;
armhf) _dotnet_arch="armv6";;
*) _dotnet_arch="$CARCH";;
esac
# Build doesn't set all the right executable bits for the right file types
_fix_executable() {
# add executable bit
find "$1" -type f \( \
-name 'apphost' -o \
-name 'singlefilehost' -o \
-name 'lib*so' \
\) \
-exec chmod +x '{}' \;
# remove executable bit
find "$1" -type f \( \
-name '*.a' -o \
-name '*.dll' -o \
-name '*.h' -o \
-name '*.json' -o \
-name '*.pdb' -o \
-name '*.props' -o \
-name '*.pubxml' -o \
-name '*.targets' -o \
-name '*.txt' -o \
-name '*.xml' \
\) \
-exec chmod -x '{}' \;
}
# generates tarball containing all components built by dotnet
snapshot() {
local _pkg="$srcdir"/${builddir##*/}.tar
ulimit -n 4096
export NUGET_PACKAGES=$_nugetdir
if [ -d "$srcdir" ]; then
cd "$srcdir"
else
mkdir -p "$srcdir" && cd "$srcdir"
fi
if [ -d "installer" ]; then
cd "$srcdir"/installer
else
git clone $_giturl --branch $_gittag && cd "$srcdir"/installer
fi
sed 's|<Exec Command="tar.*|<Exec Command="tar -cf $(TarballFilePath) -C $(TarballDir)/.. $([MSBuild]::MakeRelative($([System.IO.Path]::GetDirectoryName($(TarballDir))), $(TarballDir)))" />|' -i src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets
if [ -d "$_libdir/dotnet/bootstrap" ]; then
local _cli_root="$(find /usr/lib/dotnet/bootstrap/6.0* -maxdepth 0 -type d | sort -r | head -n 1)"
else
local _cli_root=""
fi
_InitializeDotNetCli="$_cli_root" DOTNET_INSTALL_DIR="$_cli_root" DotNetBuildFromSource=true ./build.sh \
/p:ArcadeBuildTarball=true \
/p:TarballDir=$builddir \
/p:TarballFilePath=$_pkg
msg "Compressing ${builddir##*/}.tar to $SRCDEST"
xz -T0 -9 -vv -e -c > "$SRCDEST"/${builddir##*/}.tar.xz < "$_pkg"
cd "$startdir"
abuild checksum
}
prepare() {
default_prepare
ulimit -n 4096
# check patches
msg "check_rid-alpine-generation.diff"
patch -p1 -d "$_testdir" -i "$srcdir"/check_rid-alpine-generation.diff
# Using system libunwind is broken on aarch64 and mono-based builds
# see https://github.com/dotnet/source-build/issues/2408,
case $CARCH in
x86_64)
msg "Using system libunwind"
patch -p1 -i "$srcdir"/runtime_enable-system-libunwind.diff
;;
esac
# For some reason, new s390x apphost isn't pulled, this disable it's use on s390x
case $CARCH in
s390x)
msg "Disabing use of apphost"
patch -p1 -i "$srcdir"/build_disable-apphost.diff
;;
esac
# links logfiles to pipeline logs for easy pickup in pipelines
mkdir -p "$_logdir" "$builddir"/artifacts
ln -s "$_logdir" "$builddir"/artifacts/logs
ln -s "$_logdir" "$builddir"/artifacts/log
for i in "$builddir"/src/*; do
if [ -f "$i" ]; then
continue
fi
mkdir -p "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts
ln -s "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts/log
done
# dotnet requires its bootstrap to be in a writable dir
msg "Setting up bootstrap"
local _bootstrapdir=$(find $_libdir/dotnet/bootstrap/$_pkgver_macro* -maxdepth 0 | sort -r | head -n 1)
if [ ! -d "$_cli_root" ]; then
cp -r "$_bootstrapdir" "$_cli_root"
fi
# ensure that dotnet does not download artifacts provided by dotnet-artifacts
rm -rf "$builddir"/packages/archive
}
build() {
msg "Building $pkgname-$pkgver"
ulimit -n 4096
# Disable use of LTTng as tracing on lttng <=2,13,0 is broken
# See https://github.com/dotnet/runtime/issues/57784.
if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then
export DOTNET_LTTng=0
fi
# looks for most recent recent version of _artifactsdir
local _artifactsdir=$(find $_libdir/dotnet/artifacts/$_pkgver_macro* -maxdepth 0 | sort -r | head -n 1)
# ci args, else the output is forwarded to log files which isn't ideal in a
# pipeline environment, and build by defaults uses lots of space
local args="
/v:minimal
/p:LogVerbosity=minimal
/p:MinimalConsoleLogOutput=true
/p:CleanWhileBuilding=true
"
# disable use of crossgen on arches platforms where its unsupported (mono)
# or broken (armv7, aarch64)
case $CARCH in
x86|aarch64|armv7|armhf|s390x) local args="$args /p:CrossgenOutput=false /p:DISABLE_CROSSGEN=True";;
esac
# Sets TargetRid manually as dotnet cannot be trusted to reliably compute
# the machine's runtime ID between releases.
# shellcheck disable=SC2034
. /etc/os-release
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
while [ ${#VERSION_ID_DOT} -gt 1 ]; do
local VERSION_ID="${VERSION_ID%.*}"
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
done
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
while [ ${#VERSION_ID_DASH} -ge 1 ]; do
local VERSION_ID="${VERSION_ID%_*}"
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
done
local args="$args /p:TargetRid=$ID.$VERSION_ID-$_dotnet_arch"
./build.sh \
--with-sdk "$_cli_root" \
--with-packages "$_artifactsdir" \
-- $args
}
check() {
ulimit -n 4096
export NUGET_PACKAGES=$_nugetdir
# Tests timeout (in seconds)
local _tests_timeout=600
# Test suite disable flags
# following tests can only work after packaging step
local _disabled_tests="man-pages distribution-package bash-completion install-local release-version-sane"
# test broken on all but x86_64 and aarch64: no musl release for omnisharp
if [ "$CARCH" != "x86_64" ] && [ "$CARCH" != "aarch64" ]; then
local _disabled_tests="$_disabled_tests omnisharp"
fi
# test broken: permission issue on lxc / pipelines
local _disabled_tests="$_disabled_tests createdump-aspnet workload"
# liblttng-ust_sys-sdt.h: no 'NT_STAPSDT' on Alpine's lttng-ust package
# lttng: known issue, see https://github.com/dotnet/runtime/issues/57784
local _disabled_tests="$_disabled_tests liblttng-ust_sys-sdt.h lttng"
# {bundled,system}-libunwind: use system version on all but aarch64/armv7, as broken
# see https://github.com/redhat-developer/dotnet-regular-tests/issues/113
case $CARCH in
x86_64) local _disabled_tests="$_disabled_tests bundled-libunwind";;
*) local _disabled_tests="$_disabled_tests system-libunwind";;
esac
# publish-ready-to-run: broken due to crossgen2 nupkg on musl-arm64 / musl-arm platform being broken
# should be fixed with https://github.com/dotnet/runtime/pull/66814
case $CARCH in
aarch64|armv7) local _disabled_tests="$_disabled_tests publish-ready-to-run publish-ready-to-run-linux";;
esac
msg "Unpacking produced dotnet"
export DOTNET_ROOT="$_checkdir/release"
if [ ! -d "$DOTNET_ROOT" ]; then
mkdir -p "$DOTNET_ROOT"
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$DOTNET_ROOT" \
--no-same-owner
fi
export PATH="$DOTNET_ROOT:$PATH"
# some files either should or should not have executable bits
# (done again during packaging - this is for tests)
_fix_executable "$DOTNET_ROOT"
msg "Building turkey test suite"
mkdir "$_logdir"/check
if [ ! -d "$_checkdir"/turkey ]; then
cd "$_checkdir"/Turkey
dotnet publish -bl:$_logdir/check/turkey.binlog -f netcoreapp3.1 -c Release -p:VersionPrefix=1 -p:VersionSuffix="$(git rev-parse --short HEAD)" -o "$_checkdir"/turkey
fi
msg "Running test suite"
cd "$_testdir"
for i in $_disabled_tests; do
if [ -d "$i" ]; then
sed -i 's|"enabled": true|"enabled": false|' $i/test.json
fi
done
dotnet "$_checkdir"/turkey/Turkey.dll -t $_tests_timeout -l "$_logdir"/check || local ERROR=true
if [ $ERROR ]; then
msg "Check error reported"
fi
}
package() {
# directory creation
install -dm 755 \
"$pkgdir"/$_libdir/dotnet/bootstrap/$pkgver \
"$pkgdir"/usr/share/man/man1 \
"$pkgdir"/$_libdir/dotnet/artifacts/$pkgver
# unpack sdk to bootstrap
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$pkgdir"/$_libdir/dotnet/bootstrap/$pkgver/ \
--no-same-owner
# extract arch-specific artifacts to artifacts dir for use by future dotnet builds
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz \
-C "$pkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner \
--wildcards \
'*alpine*'
# assemble docs
find "$builddir" -iname 'dotnet*.1' -type f -exec cp '{}' "$pkgdir"/usr/share/man/man1/. \;
# some files either should or should not have executable bits
_fix_executable "$pkgdir"
# Disable use of LTTng as tracing on lttng <=2,13,0 is broken
# See https://github.com/dotnet/runtime/issues/57784.
if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then
rm "$pkgdir"/$_libdir/dotnet/bootstrap/*/shared/Microsoft.NETCore.App/*/libcoreclrtraceptprovider.so
fi
}
sdk() {
pkgdesc="The .NET $_pkgver_macro SDK"
depends="
aspnetcore$_pkgver_name-runtime
aspnetcore$_pkgver_name-targeting-pack
dotnet$_pkgver_name-apphost-pack
dotnet$_pkgver_name-targeting-pack
dotnet$_pkgver_name-templates
netstandard21-targeting-pack
"
provides="
dotnet-sdk-$_pkgver_macro=$pkgver-r$pkgrel
dotnet$_pkgver_name-dev=$pkgver-r$pkgrel
"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
# sdk
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./sdk ./sdk-manifests
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
# See https://github.com/dotnet/source-build/issues/2579
find "$subpkgdir" -type f -name 'testhost.x86' -delete
find "$subpkgdir" -type f -name 'vstest.console' -delete
}
netstandard_targeting_pack() {
pkgdesc="The .NET 2.1 Standard targeting pack"
depends="dotnet-host"
provides="netstandard-targeting-pack-2.1=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./packs/NETStandard.Library.Ref
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
}
templates() {
pkgdesc="The .NET $_pkgver_macro templates"
depends="dotnet-host"
provides="dotnet-templates-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./templates
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
}
artifacts() {
pkgdesc="Internal package for building .NET $_pkgver_macro Software Development Kit"
# hack to allow artifacts to pull itself
provides="dotnet$_pkgver_name-bootstrap-artifacts"
provider_priority=$_pkgver_prior
# directory creation
install -dm 755 \
"$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver \
"$subpkgdir"/usr/share/licenses
# extract arch-agnostic artifacts to artifacts dir for use by future dotnet builds
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner \
--exclude '*Intermediate*' \
--exclude '*alpine*'
}
zshcomp() {
depends=""
pkgdesc="zsh completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack zsh"
depends="dotnet-host"
install -dm 755 "$subpkgdir"/usr/share/zsh/site-functions
install -m 755 "$builddir"/src/sdk/scripts/register-completions.zsh "$subpkgdir"/usr/share/zsh/site-functions/_dotnet
}
bashcomp() {
depends=""
pkgdesc="bash completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack bash-completion"
depends="dotnet-host"
install -dm 755 "$subpkgdir"/usr/share/bash-completion/completions
install -m 755 "$builddir"/src/sdk/scripts/register-completions.bash "$subpkgdir"/usr/share/bash-completion/completions/_dotnet
}
doc() {
default_doc
pkgdesc="Docs for .NET"
# licenses
install -dm 755 "$subpkgdir"/usr/share/licenses/dotnet
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/usr/share/licenses/dotnet/ \
--no-same-owner \
./LICENSE.txt ./ThirdPartyNotices.txt
}
sha512sums="
d205bd65e5d51b9471805553c2a8a4c34cf81df72eaede9072541061c78109356b8b77d0b2fdc85eb33b3907facf7d06aca9247e03830df66f91385e62237ec1 dotnet-v6.0.115.tar.xz
994e5145653698551408a87e34d19368e85a2531af9e2bfe61b903af0f016bfd5e4a7691795bdf09ba74bf6f41fc666973ee8cfde9088738f9a2f83f4bafa5e4 dotnet-testsuite-4832cef147bac35fdd5c57275a795e683bba0bb8.tar.gz
fc281df5fcf0d31dc9ff7f5b0e870960cfbe3c4fa0f6a6bb50b22c4ee18d2c608c827205bc79bd7f686d77ac917582fc26f68432cdd86c4a33b910c0c7416d09 dotnet-bunny-71880bd94711519f7b786248a88a827a401207a2.tar.gz
5a46a1ac9f70c378c7193275de399d7c7c235c5c7da7e76d0b44ff380ae1df3f3724cebc9c430157606c545bb3aa6d321d0e7d6702f9c4d8e74c901d394a6c51 aspnetcore_46735-set-known-good-runtimeid.patch
bdbe798add3ded0c2cf361c9f5aa18fb3540e348e68a5695cbdb797be917f06d1bda69855cae2f36950e9506119e81165927787e13b80a17a1b647ef2c221916 build_14816-non-portable-build.patch
3e04fff2d9d9b39ac4dce0b80f4b566fff8819313a5bf1df791e8f1a63a26ef882bd8aa1524344f63fbb4a3728077179b7f1d7ebefc003c236d39a48beaa0073 build_14816-stop-overriding-aspnetcore-version.patch
70d402d0bcaa98c8b09652365404238b67ed26eb9c3d510c7d6309fb61937d98c9144f1096e521c11b00e946d29585a9d474498ccc5223de32bd6471ab5a431f build_14816-update-portable-rid-logic.patch
a5a359af816595fbf19482e5dccf874c78d2fc4b59f38223118aac603b33e00c9fed22580eee3112519477205c2c8ed16177d100f09f45275e3da3c20b0ed7f7 build_disable-apphost.diff
941b430b55e323f723bbc5160447f060f40d18ce32e5803ab7dda16bfc60a0f5ec1dccd246e68475d7115ee265a9433824d8a5d997c302531311194a90deeca9 check_rid-alpine-generation.diff
7ffda90d766217e7c3756ebd423b557218c24f5337668b319421514945d3f961d82037c997b7254de088b1853102d7de15e0d824cf2cc02a6c455efc2b0107a2 installer_14816-crossgen2-rid.patch
e71f91d14873755bc2f227807d909e5260bd1f166a262eda0bf05d4a3975a7bce7fde457c1eba476a83b317aebdaaba25f1893d3385182428c08bba6243f21c8 installer_14816-update-portable-rid-logic.patch
86e14ecc0269c8b2c2a2a679790de4fa4e15ac06b2a831e1129c4a7de1499d60583fcdc79b3705652c3c4ced73afac2e0ee3edce2cfa3b00fddf94180fb26e10 msbuild_optional-systemconfiguration.patch
f4d27624f735ce77e0030fa791594fc12fb325a3ce8620791a7856bd5c0067a042df2196ec97ed4d0309db64bd51e6a48cafaad316d9ea45e34134214a7f3ca4 msbuild_optional-systemsecurity.patch
42779a7bf1004fe0f7054cfa4f09f49d7f2a57c0543ec994ffbd54fb349abb508295476098ed35d60e9676be8bcc15aa8a9ec5c814cd1e058357530b5cdfb2b6 roslyn_57003-mono-namedmutex.patch
e67e0114bd324dae65eb19f6fa8c74414bee77cd30e299931b0d82b4ca1b6b6f88358a0c47ffb180f46c5cb28f61f79bb4a59d43c1ae3011bfe491e757de293a runtime_76500-mono-musl-support.patch
827e899a83103f666dc3d57c1ec695bebc659a574f4a1d754da0cafe8c18d7db79c3950267e905fa078f94612ee1101fbddd0ea62b3c08947d8bcd7d9c8de41c runtime_82269-mono-thread-coop-undefine-fortify-source.patch
91f237afe642d0170dbf0e9a2706a4145c937d9d869d22959acaf092f1fd11941144b2b1d041102abe7b70349dd5869d558896e9d13d01f176cace39b21ef1ef runtime_enable-system-libunwind.diff
5f465f6e3bfbff66551a5690eb41be46735f8e0b1e6e6503038521a8cc60cd66b7839426319ec304f785c9f074ef588b1f189ad6dbb6ced53257af28b09388f2 runtime_lld-fix.patch
d1b4ebcbb1a6815fc0ce4c471485c232618e60968a879309fb8336821a9351d2e0028d9f7726c0c041c750b497a0baa47400c78c9ceff550b91b4a6c2816fc41 sdk_14239-add-zsh-compdef-completion-script.patch
815de1dad37412579b16d763debe2ecceffb44f5c46bd3f4ac00b3e431b20c677db435794eac41cea5601030b4e0f03f19e2d53c7a1ead896de2ffbca787eb84 sdk_telemetry-optout.patch
"

View file

@ -0,0 +1,131 @@
# dotnet6-build
This is the .NET 6.0 package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
# Building info
## Generated packages
* dotnet6-build (aimed for internal use as bootstrap)
* dotnet6-build-artifacts (aimed for internal use as bootstrap)
* dotnet6-sdk
* dotnet6-templates (required by sdk)
* dotnet-zsh-completion
* dotnet-bash-completion
* dotnet-doc
* netstandard21-targeting-pack
## How to build dotnet6 on Alpine
As dotnet is a self-hosting compiler (thus it compiles using itself), it requires a bootstrap
for the initial build. To solve this problem, this package follows the `stage0` proposal
outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E)
The goal of `stage0` is to bootstrap dotnet with as little intervention as possible, thus allowing
seamless Alpine upgrades. Unfortunately, upstream only builds bootstraps for Alpine on `x86_64`,
`aarch64`, and `armv7`. Thus, `dotnet6-cross`, a non-standard (read: never to be included in aports) aport, was created to
faciliate cross-compiling bootstraps from `x86_64` to other dotnet supported platforms.
It is [available here](https://gitlab.alpinelinux.org/ayakael/dotnet6-cross)
In summary, dotnet6 is built using four different aports, three of which are in aports proper:
* `dotnet6-cross` [available here](https://gitlab.alpinelinux.org/ayakael/dotnet6-cross)
Builds minimum components for dotnet6, and packages these in a tar.gz that `dotnet6-stage0` then uses to build full bootstrap.
* `community/dotnet6-stage0`
Builds full bootstrap for dotnet6, and packages these in an initial `dotnet6-stage0-bootstrap` package that `dotnet6-build`
pulls if `dotnet6-build` has not been built before.
* `community/dotnet6-build
Builds full and packages dotnet6 fully using either stage0 or previoulsy built dotnet6 build.
* `community/dotnet6-runtime
As abuild does not allow different versions for subpackages, a different aport is required to
package runtime bits from dotnet6-build.
# Specification
This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging),
with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`).
In addition, the package is named `dotnet6` as opposed to `dotnet-6.0`
to match Alpine Linux naming conventions for packages with many installable versions
# Contributing
The steps below are for the final package. Please only contribute to a
pre-release version if you know what you are doing. Original instructions
follow.
## General Changes
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports
- `cd community/dotnet6-build`
3. Make your changes. Don't forget to add a changelog.
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally.
6. Commit the changes to the git repo in a git branch
- `git checkout -b dotnet6/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet6-build: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
8. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
## Updating to an new upstream release
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports
- `cd community/dotnet6-build`
3. Build the new upstream source tarball. Update the versions in the
APKBUILD file, and then create a snapshot. After build, update checksum.
- `abuild snapshot`
- `abuild checksum`
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally. Any
patches that are needed at this point should be added to the APKBUILD file
in `_patches` variable.
6. Upload the source archive to a remote location, and update `source` variable.
7. Commit the changes to the git repo in a git branch.
- `git checkout -b dotnet6/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet6-build: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.
9. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
# Testing
This package uses CI tests as defined in `check()` function. Creating a
merge-request or running a build will fire off tests and flag any issues.
The tests themselves are contained in this external repository:
https://github.com/redhat-developer/dotnet-regular-tests/

View file

@ -0,0 +1,34 @@
From 4f21dd6d62c740e2cc2557bbc5d6c2f2653a5612 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/aspnetcore/pull/46735
From: Antoine Martin <dev@ayakael.net>
Date: Wed, 9 Mar 2022 08:17:41 +0000
Subject: [PATCH 1/1] arm build
Forgotten backport from https://github.com/dotnet/aspnetcore/pull/43937.
Without this, aspnetcore does not properly ingest new RIDs generated by runtime
---
diff --git a/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in b/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in
index 5e693b6d7c..500113ea46 100644
--- a/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in
+++ b/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in
@@ -42,6 +42,18 @@
<RuntimePackRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
</KnownFrameworkReference>
+ <KnownAppHostPack Update="Microsoft.NETCore.App">
+ <AppHostPackVersion
+ Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</AppHostPackVersion>
+ <AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
+ </KnownAppHostPack>
+
+ <KnownRuntimePack Update="Microsoft.NETCore.App">
+ <LatestRuntimeFrameworkVersion
+ Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</LatestRuntimeFrameworkVersion>
+ <AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
+ </KnownRuntimePack>
+
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2" Condition=" '$(PortableBuild)' == 'false' ">
<Crossgen2PackVersion
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</Crossgen2PackVersion>

View file

@ -0,0 +1,208 @@
From 3008f7ef29e0a5593f6f0afbdc9343f573f1a375 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/installer/pull/14816
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 15 Nov 2022 01:04:07 -0500
Subject: [PATCH 1/3] Eliminate runtime portable build (backport dotnet#14549)
---
.../tarball/content/Directory.Build.props | 8 --
.../tarball/content/repos/aspnetcore.proj | 1 +
.../tarball/content/repos/installer.proj | 2 +-
.../tarball/content/repos/known-good.proj | 1 -
.../content/repos/runtime-portable.proj | 47 -----------
.../content/repos/runtime.common.props | 43 ----------
.../content/repos/runtime.common.targets | 46 -----------
.../tarball/content/repos/runtime.proj | 82 ++++++++++++++++++-
.../source-build-reference-packages.proj | 4 +-
src/redist/targets/Crossgen.targets | 2 +-
src/redist/targets/GenerateLayout.targets | 3 +
11 files changed, 88 insertions(+), 151 deletions(-)
delete mode 100644 repos/runtime-portable.proj
delete mode 100644 repos/runtime.common.props
delete mode 100644 repos/runtime.common.targets
diff --git a/Directory.Build.props b/Directory.Build.props
index 61cc6ff67..2e2d7e8bc 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -22,14 +22,6 @@
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<UseStableVersions Condition="'$(UseStableVersions)' == ''">false</UseStableVersions>
-
- <!-- new supported portable/nonportable options. These control whether to build portable runtime
- or portable SDK. The PortableBuild flag is only set in runtime-portable.proj and should
- no longer be passed in. -->
- <BuildPortableRuntime Condition="'$(BuildPortableRuntime)' == ''">false</BuildPortableRuntime>
- <BuildPortableSdk Condition="'$(BuildPortableSdk)' == ''">false</BuildPortableSdk>
- <UseSystemLibraries Condition="'$(UseSystemLibraries)' == '' AND '$(PortableRuntime)' != 'true'">true</UseSystemLibraries>
- <UseSystemLibraries Condition="'$(UseSystemLibraries)' == ''">false</UseSystemLibraries>
</PropertyGroup>
<!-- This repo's projects are entirely infrastructure and do not ship. -->
diff --git a/repos/aspnetcore.proj b/repos/aspnetcore.proj
index 480f3c713..52243024a 100644
--- a/repos/aspnetcore.proj
+++ b/repos/aspnetcore.proj
@@ -9,6 +9,7 @@
<BuildCommandArgs>$(BuildCommandArgs) --no-build-repo-tasks</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:BuildNodeJs=false</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:PublishCompressedFilesPathPrefix=$(SourceBuiltAspNetCoreRuntime)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) /p:PortableBuild=false /p:TargetRuntimeIdentifier=$(TargetRid)</BuildCommandArgs>
<!-- Update to 1.0.0 version of reference assemblies which are built in SBRP instead of the preview.2 version
included by Arcade -->
<BuildCommandArgs>$(BuildCommandArgs) /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.0</BuildCommandArgs>
diff --git a/repos/installer.proj b/repos/installer.proj
index e34337b85..6c08a1f67 100644
--- a/repos/installer.proj
+++ b/repos/installer.proj
@@ -25,7 +25,7 @@
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir)</BuildCommandArgs>
- <BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:AspNetCoreInstallerRid=linux-$(Platform)</BuildCommandArgs>
+ <BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:AspNetCoreInstallerRid=$(TargetRid)</BuildCommandArgs>
<!-- core-sdk always wants to build portable on OSX and FreeBSD -->
<BuildCommandArgs Condition="'$(TargetOS)' == 'FreeBSD'">$(BuildCommandArgs) /p:CoreSetupRid=freebsd-x64 /p:PortableBuild=true</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'OSX'">$(BuildCommandArgs) /p:CoreSetupRid=osx-x64</BuildCommandArgs>
diff --git a/repos/known-good.proj b/repos/known-good.proj
index eab516290..12d9943da 100644
--- a/repos/known-good.proj
+++ b/repos/known-good.proj
@@ -44,7 +44,6 @@
<!-- Tier 2 -->
<RepositoryReference Include="linker" />
<RepositoryReference Include="msbuild" />
- <RepositoryReference Include="runtime-portable" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="templating" />
diff --git a/repos/runtime.proj b/repos/runtime.proj
index f3ed143f8..efd8b66fa 100644
--- a/repos/runtime.proj
+++ b/repos/runtime.proj
@@ -1,18 +1,53 @@
<Project>
- <Import Project="runtime.common.props"/>
+ <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
+ <!-- Build arguments -->
<PropertyGroup>
+ <LogVerbosityOptOut>true</LogVerbosityOptOut>
+
+ <CleanCommand>$(ProjectDirectory)/clean$(ShellExtension)</CleanCommand>
+
<OverrideTargetRid>$(TargetRid)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'FreeBSD'">freebsd-x64</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'Windows_NT'">win-x64</OverrideTargetRid>
+ <_platformIndex>$(NETCoreSdkRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
+ <RuntimeOS>$(NETCoreSdkRuntimeIdentifier.Substring(0, $(_platformIndex)))</RuntimeOS>
+
+ <_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
+ <BaseOS>$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))</BaseOS>
+
<BuildCommandArgs>$(StandardSourceBuildArgs)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:TargetRid=$(OverrideTargetRid)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) /p:RuntimeOS=$(RuntimeOS)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) /p:BaseOS=$(BaseOS)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:SourceBuildNonPortable=true</BuildCommandArgs>
<BuildCommand>$(StandardSourceBuildCommand) $(BuildCommandArgs)</BuildCommand>
</PropertyGroup>
+ <!-- Output / source-build flags -->
+ <PropertyGroup>
+ <GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
+ <NuGetConfigFile>$(ProjectDirectory)NuGet.config</NuGetConfigFile>
+ <OutputPlacementRepoApiImplemented>false</OutputPlacementRepoApiImplemented>
+ <DependencyVersionInputRepoApiImplemented>true</DependencyVersionInputRepoApiImplemented>
+ </PropertyGroup>
+
+ <!-- SDK Overrides -->
+ <ItemGroup>
+ <UseSourceBuiltSdkOverride Include="@(ArcadeSdkOverride)" />
+ <UseSourceBuiltSdkOverride Include="@(ArcadeCoreFxTestingOverride)" />
+ <UseSourceBuiltSdkOverride Include="@(ArcadePackagingOverride)" />
+ <UseSourceBuiltSdkOverride Include="@(ArcadeTargetFrameworkSdkOverride)" />
+ <UseSourceBuiltSdkOverride Include="@(ArcadeSharedFrameworkSdkOverride)" />
+ </ItemGroup>
+
+ <!-- Environment Variables -->
+ <ItemGroup>
+ <EnvironmentVariables Include="BuildInParallel=false" />
+ </ItemGroup>
+
<!-- Repository References -->
<ItemGroup>
<RepositoryReference Include="arcade" />
@@ -20,8 +55,49 @@
<RepositoryReference Include="linker" />
<RepositoryReference Include="source-build" />
<RepositoryReference Include="roslyn" />
- <RepositoryReference Include="runtime-portable" />
</ItemGroup>
- <Import Project="runtime.common.targets" />
+ <UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="AddRidToRuntimeJson" />
+ <UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="PublishCoreSetupBinaries" />
+
+ <Target Name="SetOutputList" AfterTargets="Package" BeforeTargets="GatherBuiltPackages">
+ <ItemGroup>
+ <PackagesOutputList Include="$(ShippingPackagesOutput)" />
+ <PackagesOutputList Include="$(NonShippingPackagesOutput)" />
+ </ItemGroup>
+ </Target>
+
+ <Target Name="UpdateRuntimeGraph"
+ BeforeTargets="Build"
+ Condition="'$(_IsBootstrapping)' == 'true'">
+ <PropertyGroup>
+ <RuntimeJsonFile>$(ProjectDirectory)pkg/Microsoft.NETCore.Platforms/runtime.json</RuntimeJsonFile>
+ </PropertyGroup>
+
+ <Message Importance="High" Text="Adding rid, $(TargetRid), to $(RuntimeJsonFile)" />
+ <AddRidToRuntimeJson RuntimeJson="$(RuntimeJsonFile)"
+ Rid="$(TargetRid)-$(Platform)" />
+ </Target>
+
+ <Target Name="CopyBinariesToBinFolder"
+ AfterTargets="ExtractIntermediatePackages"
+ Inputs="$(MSBuildProjectFullPath)"
+ Outputs="$(RepoCompletedSemaphorePath)CopyBinariesToBinFolder.complete">
+ <ItemGroup>
+ <_builtRuntimePackages Include="$(SourceBuiltAssetsDir)*.symbols.nupkg" />
+ <_builtRuntimePackages>
+ <TransformedFileName>$([System.String]::Copy('%(FileName)').Replace('symbols', 'nupkg'))</TransformedFileName>
+ </_builtRuntimePackages>
+ <BinariesToCopy Include="$(SourceBuiltAssetsDir)*.*" Exclude="$(SourceBuiltAssetsDir)*.nupkg;$(SourceBuiltAssetsDir)*.requires_nupkg_signing" />
+ <BinariesToCopy Include="@(_builtRuntimePackages->'$(SourceBuiltPackagesPath)%(TransformedFileName)')" />
+ </ItemGroup>
+
+ <Copy SourceFiles="@(BinariesToCopy)"
+ DestinationFolder="$(OutputPath)runtime"
+ Condition="'@(BinariesToCopy)'!=''" />
+
+ <WriteLinesToFile File="$(RepoCompletedSemaphorePath)CopyBinariesToBinFolder.complete" Overwrite="true" />
+ </Target>
+
+ <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
diff --git a/repos/source-build-reference-packages.proj b/repos/source-build-reference-packages.proj
index 69ab564a2..9545b50e4 100644
--- a/repos/source-build-reference-packages.proj
+++ b/repos/source-build-reference-packages.proj
@@ -2,7 +2,9 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
- <BuildCommand>$(StandardSourceBuildCommand) $(StandardSourceBuildArgs)</BuildCommand>
+ <BuildCommandArgs>$(StandardSourceBuildArgs)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) /p:MicrosoftNetCoreIlasmPackageRuntimeId=$(NETCoreSdkRuntimeIdentifier)</BuildCommandArgs>
+ <BuildCommand>$(StandardSourceBuildCommand) $(BuildCommandArgs)</BuildCommand>
<NuGetConfigFile>$(ProjectDirectory)NuGet.config</NuGetConfigFile>
<GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
--
2.38.2

View file

@ -0,0 +1,69 @@
From 94463478bd6aaec208bc5e3dd1d120e0a49aeaaa Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/installer/pull/14816
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 15 Nov 2022 01:08:29 -0500
Subject: [PATCH 3/3] source-build: stop overriding aspnetcore version
(backport of #14938)
---
.../tarball/content/Directory.Build.props | 4 ----
.../tarball/content/tools-local/init-build.proj | 12 ++++++++++++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 2e2d7e8bc..6b08fa71b 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -222,12 +222,8 @@
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftNETCoreAppRuntimePackageVersion" Version="$(runtimeOutputPackageVersion)" />
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftNETCoreAppRuntimeVersion" Version="$(runtimeOutputPackageVersion)" />
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftNETCoreAppHostPackageVersion" Version="$(runtimeOutputPackageVersion)" />
- <ExtraPackageVersionPropsPackageInfo Include="MicrosoftAspNetCoreAppRuntimePackageVersion" Version="%24(MicrosoftAspNetCoreAppRuntimeLinux$(Platform)PackageVersion)" />
<!-- core-sdk uses this property for ASP.NET blob directory -->
<ExtraPackageVersionPropsPackageInfo Include="VSRedistCommonAspNetCoreTargetingPackx6430PackageVersion" Version="$(aspnetcoreOutputPackageVersion)" />
- <!-- OSX needs the OSX version instead of Linux. We don't have a lot of flexibility in how we output these properties so we're relying on the previous one being blank if the Linux version of the package is missing. -->
- <ExtraPackageVersionPropsPackageInfo Include="MicrosoftAspNetCoreAppRuntimePackageVersion" Version="%24(MicrosoftAspNetCoreAppRuntimeOsxX64PackageVersion)" DoNotOverwrite="true" />
- <ExtraPackageVersionPropsPackageInfo Include="MicrosoftAspNetCoreAppRuntimePackageVersion" Version="%24(MicrosoftAspNetCoreAppRuntimewinx64PackageVersion)" DoNotOverwrite="true" />
<!-- Used by installer to determine sdk version -->
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftDotnetToolsetInternalPackageVersion" Version="%24(MicrosoftNETSdkPackageVersion)" />
diff --git a/tools-local/init-build.proj b/tools-local/init-build.proj
index 701f76c0c..ac4508947 100644
--- a/tools-local/init-build.proj
+++ b/tools-local/init-build.proj
@@ -9,6 +9,7 @@
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="NuGetPack" />
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ZipFileExtractToDirectory" />
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ReplaceTextInFile" />
+ <UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ReplaceRegexInFiles" />
<ItemGroup>
<BuildTasksTarget Include="Restore;Build;InstallResolver" />
@@ -22,6 +23,7 @@
<CallTarget Targets="
UnpackTarballs;
BuildXPlatTasks;
+ PatchPackageVersions;
BuildLeakDetection;
ExtractToolPackage;
GenerateRootFs;
@@ -38,6 +40,16 @@
<Delete Files="$(CompletedSemaphorePath)*.*" />
</Target>
+ <!-- TODO: Remove this when the .NET 8 artifacts tarball no longer includes MicrosoftAspNetCoreAppRuntimePackageVersion -->
+ <Target Name="PatchPackageVersions">
+ <!-- Rename MicrosoftAspNetCoreAppRuntimePackageVersion so it isn't used
+ Fixes https://github.com/dotnet/installer/issues/14492 -->
+ <ReplaceRegexInFiles
+ InputFiles="$(IntermediatePath)PreviouslySourceBuiltPackageVersions.props"
+ OldTextRegex="\bMicrosoftAspNetCoreAppRuntimePackageVersion\b"
+ NewText="__unused" />
+ </Target>
+
<Target Name="UnpackTarballs"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(CompletedSemaphorePath)UnpackTarballs.complete" >
--
2.38.2

View file

@ -0,0 +1,38 @@
From 5ee269eef8bd02d066151deaa4d8c0fe6b6cbce4 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/installer/pull/14816
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 15 Nov 2022 01:04:46 -0500
Subject: [PATCH 2/3] BundledVersions: update portable rid logic (backport
dotnet#14647)
---
.../tarball/content/repos/installer.proj | 5 +++++
src/redist/targets/GetRuntimeInformation.targets | 16 ++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/repos/installer.proj b/repos/installer.proj
index 6c08a1f67..95d47c941 100644
--- a/repos/installer.proj
+++ b/repos/installer.proj
@@ -10,6 +10,10 @@
<OverrideTargetRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</OverrideTargetRid>
<OSNameOverride>$(OverrideTargetRid.Substring(0, $(OverrideTargetRid.IndexOf("-"))))</OSNameOverride>
+ <!-- Determine target portable rid based on bootstrap SDK's portable rid -->
+ <_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-'))</_platformIndex>
+ <PortableOS Condition="'$(PortableOS)' == ''">$(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex)))</PortableOS>
+
<RuntimeArg>--runtime-id $(OverrideTargetRid)</RuntimeArg>
<RuntimeArg Condition="'$(TargetOS)' == 'Linux'">--runtime-id $(TargetRid)</RuntimeArg>
@@ -22,6 +26,7 @@
-->
<BuildCommandArgs>$(BuildCommandArgs) /p:NETCoreAppMaximumVersion=99.9</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:OSName=$(OSNameOverride)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) /p:PortableOSName=$(PortableOS)</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir)</BuildCommandArgs>
--
2.38.2

View file

@ -0,0 +1,79 @@
From 75c3e74ea35219f257c80daf9a236e0f518a7875 Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Wed, 9 Mar 2022 20:16:03 +0000
Subject: [PATCH 1/1] Disable apphost
Disables use of apphost
---
--- a/src/fsharp/tests/benchmarks/MicroPerf/MicroPerf.fsproj
+++ b/src/fsharp/tests/benchmarks/MicroPerf/MicroPerf.fsproj
@@ -9,6 +9,7 @@
<OtherFlags>$(OtherFlags) --nowarn:57</OtherFlags>
<OtherFlags>$(OtherFlags) --langversion:preview</OtherFlags>
<OtherFlags>$(OtherFlags) --define:PREVIEW</OtherFlags>
+ <UseAppHost>false</UseAppHost>
<!-- By default this project will compile with the proto compiler -->
<!-- Uncommenting this will build with a previous installed compiler -->
<!--
--- a/src/fsharp/tests/benchmarks/TaskPerf/TaskPerf.fsproj
+++ b/src/fsharp/tests/benchmarks/TaskPerf/TaskPerf.fsproj
@@ -4,6 +4,7 @@
<TargetFramework>net5.0</TargetFramework>
<OutputType>Exe</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
+ <UseAppHost>false</UseAppHost>
<!-- Turn off "This function is for use by compiled F# code and should not be used directly" -->
<OtherFlags>$(OtherFlags) --nowarn:1204</OtherFlags>
<!-- Turn off "Experimental" -->
--- a/src/arcade/src/Microsoft.DotNet.GitSync.CommitManager/Microsoft.DotNet.GitSync.CommitManager.csproj
+++ b/src/arcade/src/Microsoft.DotNet.GitSync.CommitManager/Microsoft.DotNet.GitSync.CommitManager.csproj
@@ -5,6 +5,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
+ <UseAppHost>false</UseAppHost>
</PropertyGroup>
<ItemGroup>
--- a/src/arcade/src/Microsoft.DotNet.SwaggerGenerator/Microsoft.DotNet.SwaggerGenerator.CmdLine/Microsoft.DotNet.SwaggerGenerator.CmdLine.csproj
+++ b/src/arcade/src/Microsoft.DotNet.SwaggerGenerator/Microsoft.DotNet.SwaggerGenerator.CmdLine/Microsoft.DotNet.SwaggerGenerator.CmdLine.csproj
@@ -9,6 +9,7 @@
<ToolCommandName>dotnet-swaggergen</ToolCommandName>
<SignAssembly>false</SignAssembly>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
+ <UseAppHost>false</UseAppHost>
</PropertyGroup>
<ItemGroup>
--- a/src/arcade/src/Microsoft.DotNet.XUnitConsoleRunner/src/Microsoft.DotNet.XUnitConsoleRunner.csproj
+++ b/src/arcade/src/Microsoft.DotNet.XUnitConsoleRunner/src/Microsoft.DotNet.XUnitConsoleRunner.csproj
@@ -11,6 +11,7 @@
<VersionPrefix>2.5.1</VersionPrefix>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<RollForward>Major</RollForward>
+ <UseAppHost>false</UseAppHost>
</PropertyGroup>
<ItemGroup>
--- a/src/roslyn-analyzers/src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj
+++ b/src/roslyn-analyzers/src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj
@@ -4,6 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<NonShipping>true</NonShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
+ <UseAppHost>false</UseAppHost>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
--- a/src/roslyn/src/Workspaces/Remote/ServiceHub.CoreComponents/Microsoft.CodeAnalysis.Remote.ServiceHub.CoreComponents.csproj
+++ b/src/roslyn/src/Workspaces/Remote/ServiceHub.CoreComponents/Microsoft.CodeAnalysis.Remote.ServiceHub.CoreComponents.csproj
@@ -5,6 +5,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<!-- The purpose of this project is to include all dependecies of Microsoft.CodeAnalysis.Remote.ServiceHub targeting .Net Core -->
+ <UseAppHost>false</UseAppHost>
<IsShipping>false</IsShipping>
</PropertyGroup>
<ItemGroup>

View file

@ -0,0 +1,42 @@
From 5bbd0366f3caa6281fbafb49882a226453371b6a Mon Sep 17 00:00:00 2001
From: Antoine Martin (ayakael) <dev@ayakael.net>
Date: Wed, 10 Aug 2022 00:57:30 +0000
Subject: [PATCH 1/1] fix-runtme-id
General fix for RID normalisation in testing suite
---
runtime-id | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/runtime-id b/runtime-id
index 5673bba..7369776 100755
--- a/runtime-id
+++ b/runtime-id
@@ -44,12 +44,15 @@ if [[ ${portable_rid} == 1 ]]; then
echo "linux-${arch}"
fi
else
- case "${ID}" in
- # Remove the minor version
- alpine|ol|rhel|rocky) rid_version=${VERSION_ID%.*} ;;
-
- *) rid_version=${VERSION_ID} ;;
- esac
-
- echo "${ID}.${rid_version}-${arch}"
+ VERSION_ID_DOT="${VERSION_ID//[^.]}"
+ while [[ ${#VERSION_ID_DOT} -gt 1 ]]; do
+ VERSION_ID="${VERSION_ID%.*}"
+ VERSION_ID_DOT="${VERSION_ID//[^.]}"
+ done
+ VERSION_ID_DASH="${VERSION_ID//[^_]}"
+ while [[ ${#VERSION_ID_DASH} -ge 1 ]]; do
+ VERSION_ID="${VERSION_ID%_*}"
+ VERSION_ID_DASH="${VERSION_ID//[^_]}"
+ done
+ echo "${ID}.${VERSION_ID}-${arch}"
fi
--
2.37.1

View file

@ -0,0 +1,53 @@
From 3008f7ef29e0a5593f6f0afbdc9343f573f1a375 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/installer/pull/14816
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 15 Nov 2022 01:04:07 -0500
Subject: [PATCH 1/3] Eliminate runtime portable build (backport dotnet#14549)
---
.../tarball/content/Directory.Build.props | 8 --
.../tarball/content/repos/aspnetcore.proj | 1 +
.../tarball/content/repos/installer.proj | 2 +-
.../tarball/content/repos/known-good.proj | 1 -
.../content/repos/runtime-portable.proj | 47 -----------
.../content/repos/runtime.common.props | 43 ----------
.../content/repos/runtime.common.targets | 46 -----------
.../tarball/content/repos/runtime.proj | 82 ++++++++++++++++++-
.../source-build-reference-packages.proj | 4 +-
src/redist/targets/Crossgen.targets | 2 +-
src/redist/targets/GenerateLayout.targets | 3 +
11 files changed, 88 insertions(+), 151 deletions(-)
delete mode 100644 src/SourceBuild/tarball/content/repos/runtime-portable.proj
delete mode 100644 src/SourceBuild/tarball/content/repos/runtime.common.props
delete mode 100644 src/SourceBuild/tarball/content/repos/runtime.common.targets
diff --git a/src/installer/src/redist/targets/Crossgen.targets b/src/installer/src/redist/targets/Crossgen.targets
index 8949af132..a59ed388f 100644
--- a/src/installer/src/redist/targets/Crossgen.targets
+++ b/src/installer/src/redist/targets/Crossgen.targets
@@ -6,7 +6,7 @@
<PropertyGroup>
<RuntimeNETCoreAppPackageName>microsoft.netcore.app.runtime.$(SharedFrameworkRid)</RuntimeNETCoreAppPackageName>
- <RuntimeNETCrossgenPackageName>microsoft.netcore.app.crossgen2.$(HostOSName)-$(BuildArchitecture)</RuntimeNETCrossgenPackageName>
+ <RuntimeNETCrossgenPackageName>microsoft.netcore.app.crossgen2.$(Crossgen2Rid)</RuntimeNETCrossgenPackageName>
<CrossgenPath>$(NuGetPackageRoot)/$(RuntimeNETCrossgenPackageName)/$(MicrosoftNETCoreAppRuntimePackageVersion)/tools/crossgen2$(ExeExtension)</CrossgenPath>
<!-- When ingesting stable pgo instrumented binaries, the shared framework will be a non-stable version,
as will the archive file names themselves. -->
diff --git a/src/installer/src/redist/targets/GenerateLayout.targets b/src/installer/src/redist/targets/GenerateLayout.targets
index 88a053b61..ce5e09b69 100644
--- a/src/installer/src/redist/targets/GenerateLayout.targets
+++ b/src/installer/src/redist/targets/GenerateLayout.targets
@@ -84,6 +84,9 @@
<CombinedFrameworkHostArchiveFileName Condition=" '$(PgoInstrument)' == 'true' ">dotnet-runtime$(PgoTerm)-$(VSRedistCommonNetCoreSharedFrameworkx6460PackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension)</CombinedFrameworkHostArchiveFileName>
<WinFormsAndWpfSharedFxArchiveFileName>windowsdesktop-runtime-$(MicrosoftWindowsDesktopAppRuntimePackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension)</WinFormsAndWpfSharedFxArchiveFileName>
+ <Crossgen2Rid>$(HostOSName)-$(BuildArchitecture)</Crossgen2Rid>
+ <Crossgen2Rid Condition="'$(DotNetBuildFromSource)' == 'true'">$(SharedFrameworkRid)</Crossgen2Rid>
+
<AspNetCoreInstallerRid Condition="'$(AspNetCoreInstallerRid)' == ''">$(SharedFrameworkRid)</AspNetCoreInstallerRid>
<AspNetCoreInstallerRid Condition="'$(SharedFrameworkRid)' == 'rhel.6-x64'">linux-x64</AspNetCoreInstallerRid>
<AspNetCoreArchiveRid>$(AspNetCoreInstallerRid)</AspNetCoreArchiveRid>
--
2.38.2

View file

@ -0,0 +1,51 @@
From 5ee269eef8bd02d066151deaa4d8c0fe6b6cbce4 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/installer/pull/14816
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 15 Nov 2022 01:04:46 -0500
Subject: [PATCH 2/3] BundledVersions: update portable rid logic (backport
dotnet#14647)
---
.../tarball/content/repos/installer.proj | 5 +++++
src/redist/targets/GetRuntimeInformation.targets | 16 ++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/installer/src/redist/targets/GetRuntimeInformation.targets b/src/installer/src/redist/targets/GetRuntimeInformation.targets
index a99a7e9da..89f000119 100644
--- a/src/installer/src/redist/targets/GetRuntimeInformation.targets
+++ b/src/installer/src/redist/targets/GetRuntimeInformation.targets
@@ -9,10 +9,15 @@
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('OSX')) ">osx</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD')) ">freebsd</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND '$(IsLinux)' == 'True' ">linux</HostOSName>
-
+
+ <OSName Condition=" '$(OSName)' == '' AND $(Rid) != '' ">$(Rid.Substring(0, $(Rid.LastIndexOf('-'))))</OSName>
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
- <Rid Condition=" '$(Rid)' == '' ">$(OSName)-$(Architecture)</Rid>
+ <PortableOSName Condition=" '$(PortableOSName)' == '' ">$(OSName)</PortableOSName>
+
+ <Rid>$(OSName)-$(Architecture)</Rid>
+
+ <PortableRid>$(PortableOSName)-$(Architecture)</PortableRid>
</PropertyGroup>
<PropertyGroup>
@@ -23,10 +28,9 @@
</PropertyGroup>
<PropertyGroup>
- <ProductMonikerRid Condition=" '$(Rid)' == 'ubuntu.16.04-x64' OR
- '$(Rid)' == 'rhel.6-x64' OR
- '$(Rid)' == 'linux-musl-x64' ">$(Rid)</ProductMonikerRid>
- <ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(OSName)-$(Architecture)</ProductMonikerRid>
+ <ProductMonikerRid Condition=" '$(ProductMonikerRid)' == '' ">$(Rid)</ProductMonikerRid>
+
+ <PortableProductMonikerRid Condition=" '$(PortableProductMonikerRid)' == '' ">$(PortableRid)</PortableProductMonikerRid>
<PortableProductMonikerRid Condition=" '$(PortableProductMonikerRid)' == '' ">$(HostOSName)-$(Architecture)</PortableProductMonikerRid>
--
2.38.2

View file

@ -0,0 +1,69 @@
From 26a12cb531161e1fc3d6ec1f2a241e1c516ca775 Mon Sep 17 00:00:00 2001
Patch-Source: https://src.fedoraproject.org/rpms/dotnet6.0/blob/src/msbuild/rawhide/f/msbuild-no-systemconfiguration.patch
From: Antoine Martin <dev@ayakael.net>
Date: Fri, 21 Oct 2022 14:13:04 -0400
Subject: [PATCH 1/2] optional-systemconfiguration
Fix mono-specific runtime crashes running msbuild. CoreCLR does not
load types that are not actually used/invoked at runtime, while mono
does. System.Configuration and System.Security are missing in
source-build builds, which breaks msbuild.
---
src/Build/Definition/ProjectCollection.cs | 4 ++++
src/Build/Definition/ToolsetReader.cs | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/src/msbuild/src/Build/Definition/ProjectCollection.cs b/src/msbuild/src/Build/Definition/ProjectCollection.cs
index 8629bd943..6a550e32d 100644
--- a/src/msbuild/src/Build/Definition/ProjectCollection.cs
+++ b/src/msbuild/src/Build/Definition/ProjectCollection.cs
@@ -1754,7 +1754,11 @@ namespace Microsoft.Build.Evaluation
#if FEATURE_WIN32_REGISTRY
ToolsetRegistryReader registryReader = null,
#endif
+#if FEATURE_SYSTEM_CONFIGURATION
ToolsetConfigurationReader configReader = null
+#else
+ object configReader = null
+#endif
)
{
_toolsets = new Dictionary<string, Toolset>(StringComparer.OrdinalIgnoreCase);
diff --git a/src/msbuild/src/Build/Definition/ToolsetReader.cs b/src/msbuild/src/Build/Definition/ToolsetReader.cs
index 869b3318e..c6b95d3cf 100644
--- a/src/msbuild/src/Build/Definition/ToolsetReader.cs
+++ b/src/msbuild/src/Build/Definition/ToolsetReader.cs
@@ -101,7 +101,11 @@ namespace Microsoft.Build.Evaluation
#if FEATURE_WIN32_REGISTRY
ToolsetRegistryReader registryReader,
#endif
+#if FEATURE_SYSTEM_CONFIGURATION
ToolsetConfigurationReader configurationReader,
+#else
+ object _configurationReader,
+#endif
PropertyDictionary<ProjectPropertyInstance> environmentProperties,
PropertyDictionary<ProjectPropertyInstance> globalProperties,
ToolsetDefinitionLocations locations
@@ -120,6 +124,7 @@ namespace Microsoft.Build.Evaluation
if ((locations & ToolsetDefinitionLocations.ConfigurationFile) == ToolsetDefinitionLocations.ConfigurationFile)
{
+#if FEATURE_SYSTEM_CONFIGURATION
if (configurationReader == null)
{
configurationReader = new ToolsetConfigurationReader(environmentProperties, globalProperties);
@@ -129,6 +134,9 @@ namespace Microsoft.Build.Evaluation
defaultToolsVersionFromConfiguration = configurationReader.ReadToolsets(toolsets, globalProperties,
initialProperties, true /* accumulate properties */, out overrideTasksPathFromConfiguration,
out defaultOverrideToolsVersionFromConfiguration);
+#else
+ throw new InvalidOperationException("ToolsetDefinitionLocations.ConfigurationFile not supported");
+#endif
}
string defaultToolsVersionFromRegistry = null;
--
2.36.3

View file

@ -0,0 +1,32 @@
From 06707ec777769f1756230caf54391302e4378777 Mon Sep 17 00:00:00 2001
Patch-Source: https://src.fedoraproject.org/rpms/dotnet6.0/blob/src/msbuild/rawhide/f/msbuild-no-systemsecurity.patch
From: Antoine Martin <dev@ayakael.net>
Date: Fri, 21 Oct 2022 14:13:29 -0400
Subject: [PATCH 2/2] optional-systemsecurity
Fix mono-specific runtime crashes running msbuild. CoreCLR does not
load types that are not actually used/invoked at runtime, while mono
does. System.Configuration and System.Security are missing in
source-build builds, which breaks msbuild.
---
src/Shared/ExceptionHandling.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/msbuild/src/Shared/ExceptionHandling.cs b/src/msbuild/src/Shared/ExceptionHandling.cs
index 16a0576b5..1c7cd5967 100644
--- a/src/msbuild/src/Shared/ExceptionHandling.cs
+++ b/src/msbuild/src/Shared/ExceptionHandling.cs
@@ -153,7 +153,9 @@ namespace Microsoft.Build.Shared
internal static bool IsXmlException(Exception e)
{
return e is XmlException
+#if FEATURE_SECURITY_PERMISSIONS
|| e is XmlSyntaxException
+#endif
|| e is XmlSchemaException
|| e is UriFormatException; // XmlTextReader for example uses this under the covers
}
--
2.36.3

View file

@ -0,0 +1,470 @@
From 210c17ea60f525837a7525df73e7332598ad4089 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/roslyn/pull/57003
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 27 Aug 2022 21:26:01 -0800
Subject: [PATCH 1/1] mono-named-mutex
---
.../InternalUtilities/PlatformInformation.cs | 19 ++
.../VBCSCompilerTests/BuildClientTests.cs | 2 +-
.../CompilerServerApiTest.cs | 4 +-
.../VBCSCompilerTests/CompilerServerTests.cs | 4 +-
.../VBCSCompilerServerTests.cs | 7 +-
src/Compilers/Shared/BuildServerConnection.cs | 251 +++++++++++-------
6 files changed, 182 insertions(+), 105 deletions(-)
diff --git a/src/roslyn/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs b/src/roslyn/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs
index 033e66cd2f2..d4fa56413fb 100644
--- a/src/roslyn/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs
+++ b/src/roslyn/src/Compilers/Core/Portable/InternalUtilities/PlatformInformation.cs
@@ -31,5 +31,24 @@ public static bool IsRunningOnMono
}
}
}
+ /// <summary>
+ /// Are we running on .NET 5 or later using the Mono runtime?
+ /// Will also return true when running on Mono itself; if necessary
+ /// we can use IsRunningOnMono to distinguish.
+ /// </summary>
+ public static bool IsUsingMonoRuntime
+ {
+ get
+ {
+ try
+ {
+ return !(Type.GetType("Mono.RuntimeStructs", throwOnError: false) is null);
+ }
+ catch
+ {
+ return false;
+ }
+ }
+ }
}
}
diff --git a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/BuildClientTests.cs b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/BuildClientTests.cs
index 669d1bfb676..7f1d0468823 100644
--- a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/BuildClientTests.cs
+++ b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/BuildClientTests.cs
@@ -79,7 +79,7 @@ public void ConnectToServerFails()
// to connect. When it fails it should fall back to in-proc
// compilation.
bool holdsMutex;
- using (var serverMutex = new Mutex(initiallyOwned: true,
+ using (var serverMutex = BuildServerConnection.OpenOrCreateMutex(
name: BuildServerConnection.GetServerMutexName(_pipeName),
createdNew: out holdsMutex))
{
diff --git a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerApiTest.cs b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerApiTest.cs
index 0dbd1b2e143..c00b72e8434 100644
--- a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerApiTest.cs
+++ b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerApiTest.cs
@@ -103,7 +103,7 @@ public void MutexStopsServerStarting()
var mutexName = BuildServerConnection.GetServerMutexName(pipeName);
bool holdsMutex;
- using (var mutex = new Mutex(initiallyOwned: true,
+ using (var mutex = BuildServerConnection.OpenOrCreateMutex(
name: mutexName,
createdNew: out holdsMutex))
{
@@ -119,7 +119,7 @@ public void MutexStopsServerStarting()
}
finally
{
- mutex.ReleaseMutex();
+ mutex.Dispose();
}
}
}
diff --git a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs
index 3b6f4f291ff..e97a6bf923f 100644
--- a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs
+++ b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs
@@ -304,7 +304,7 @@ public async Task ServerFailsWithLongTempPathUnix()
var newTempDir = _tempDirectory.CreateDirectory(new string('a', 100 - _tempDirectory.Path.Length));
await ApplyEnvironmentVariables(
new[] { new KeyValuePair<string, string>("TMPDIR", newTempDir.Path) },
- async () =>
+ async () => await Task.Run(async () =>
{
using var serverData = await ServerUtil.CreateServer(_logger);
var result = RunCommandLineCompiler(
@@ -317,7 +317,7 @@ public async Task ServerFailsWithLongTempPathUnix()
var listener = await serverData.Complete();
Assert.Equal(CompletionData.RequestCompleted, listener.CompletionDataList.Single());
- });
+ }));
}
[Fact]
diff --git a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerServerTests.cs b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerServerTests.cs
index d5f493fed8a..73941972e48 100644
--- a/src/roslyn/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerServerTests.cs
+++ b/src/roslyn/src/Compilers/Server/VBCSCompilerTests/VBCSCompilerServerTests.cs
@@ -101,7 +101,7 @@ public async Task NoServerConnection()
var thread = new Thread(() =>
{
- using (var mutex = new Mutex(initiallyOwned: true, name: mutexName, createdNew: out created))
+ using (var mutex = BuildServerConnection.OpenOrCreateMutex(name: mutexName, createdNew: out created))
using (var stream = NamedPipeUtil.CreateServer(pipeName))
{
readyMre.Set();
@@ -112,7 +112,7 @@ public async Task NoServerConnection()
stream.Close();
doneMre.WaitOne();
- mutex.ReleaseMutex();
+ mutex.Dispose();
}
});
@@ -153,7 +153,7 @@ public async Task ServerShutdownsDuringProcessing()
{
using (var stream = NamedPipeUtil.CreateServer(pipeName))
{
- var mutex = new Mutex(initiallyOwned: true, name: mutexName, createdNew: out created);
+ var mutex = BuildServerConnection.OpenOrCreateMutex(name: mutexName, createdNew: out created);
readyMre.Set();
stream.WaitForConnection();
@@ -161,7 +161,6 @@ public async Task ServerShutdownsDuringProcessing()
// Client is waiting for a response. Close the mutex now. Then close the connection
// so the client gets an error.
- mutex.ReleaseMutex();
mutex.Dispose();
stream.Close();
diff --git a/src/roslyn/src/Compilers/Shared/BuildServerConnection.cs b/src/roslyn/src/Compilers/Shared/BuildServerConnection.cs
index f67c2d83957..1fe609061ee 100644
--- a/src/roslyn/src/Compilers/Shared/BuildServerConnection.cs
+++ b/src/roslyn/src/Compilers/Shared/BuildServerConnection.cs
@@ -543,19 +543,10 @@ internal static bool WasServerMutexOpen(string mutexName)
{
try
{
- if (PlatformInformation.IsRunningOnMono)
+ if (PlatformInformation.IsUsingMonoRuntime)
{
- IServerMutex? mutex = null;
- bool createdNew = false;
- try
- {
- mutex = new ServerFileMutexPair(mutexName, false, out createdNew);
- return !createdNew;
- }
- finally
- {
- mutex?.Dispose();
- }
+ using var mutex = new ServerFileMutex(mutexName);
+ return !mutex.CouldLock();
}
else
{
@@ -572,9 +563,11 @@ internal static bool WasServerMutexOpen(string mutexName)
internal static IServerMutex OpenOrCreateMutex(string name, out bool createdNew)
{
- if (PlatformInformation.IsRunningOnMono)
+ if (PlatformInformation.IsUsingMonoRuntime)
{
- return new ServerFileMutexPair(name, initiallyOwned: true, out createdNew);
+ var mutex = new ServerFileMutex(name);
+ createdNew = mutex.TryLock(0);
+ return mutex;
}
else
{
@@ -648,19 +641,22 @@ internal interface IServerMutex : IDisposable
}
/// <summary>
- /// An interprocess mutex abstraction based on OS advisory locking (FileStream.Lock/Unlock).
+ /// An interprocess mutex abstraction based on file sharing permission (FileShare.None).
/// If multiple processes running as the same user create FileMutex instances with the same name,
/// those instances will all point to the same file somewhere in a selected temporary directory.
- /// The TryLock method can be used to attempt to acquire the mutex, with Unlock or Dispose used to release.
+ /// The TryLock method can be used to attempt to acquire the mutex, with Dispose used to release.
+ /// The CouldLock method can be used to check whether an attempt to acquire the mutex would have
+ /// succeeded at the current time, without actually acquiring it.
/// Unlike Win32 named mutexes, there is no mechanism for detecting an abandoned mutex. The file
/// will simply revert to being unlocked but remain where it is.
/// </summary>
- internal sealed class FileMutex : IDisposable
+ internal sealed class ServerFileMutex : IServerMutex
{
- public readonly FileStream Stream;
+ public FileStream? Stream;
public readonly string FilePath;
+ public readonly string GuardPath;
- public bool IsLocked { get; private set; }
+ public bool IsDisposed { get; private set; }
internal static string GetMutexDirectory()
{
@@ -670,61 +666,176 @@ internal static string GetMutexDirectory()
return result;
}
- public FileMutex(string name)
+ public ServerFileMutex(string name)
{
- FilePath = Path.Combine(GetMutexDirectory(), name);
- Stream = new FileStream(FilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
+ var mutexDirectory = GetMutexDirectory();
+ FilePath = Path.Combine(mutexDirectory, name);
+ GuardPath = Path.Combine(mutexDirectory, ".guard");
}
- public bool TryLock(int timeoutMs)
+ /// <summary>
+ /// Acquire the guard by opening the guard file with FileShare.None. The guard must only ever
+ /// be held for very brief amounts of time, so we can simply spin until it is acquired. The
+ /// guard must be released by disposing the FileStream returned from this routine. Note the
+ /// guard file is never deleted; this is a leak, but only of a single file.
+ /// </summary>
+ internal FileStream LockGuard()
{
- if (IsLocked)
- throw new InvalidOperationException("Lock already held");
-
- var sw = Stopwatch.StartNew();
- do
+ // We should be able to acquire the guard quickly. Limit the number of retries anyway
+ // by some arbitrary bound to avoid getting hung up in a possibly infinite loop.
+ for (var i = 0; i < 100; i++)
{
try
{
- Stream.Lock(0, 0);
- IsLocked = true;
- return true;
+ return new FileStream(GuardPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
}
catch (IOException)
{
- // Lock currently held by someone else.
+ // Guard currently held by someone else.
// We want to sleep for a short period of time to ensure that other processes
// have an opportunity to finish their work and relinquish the lock.
// Spinning here (via Yield) would work but risks creating a priority
// inversion if the lock is held by a lower-priority process.
Thread.Sleep(1);
}
+ }
+ // Handle unexpected failure to acquire guard as error.
+ throw new InvalidOperationException("Unable to acquire guard");
+ }
+
+ /// <summary>
+ /// Attempt to acquire the lock by opening the lock file with FileShare.None. Sets "Stream"
+ /// and returns true if successful, returns false if the lock is already held by another
+ /// thread or process. Guard must be held when calling this routine.
+ /// </summary>
+ internal bool TryLockFile()
+ {
+ Debug.Assert(Stream is null);
+ FileStream? stream = null;
+ try
+ {
+ stream = new FileStream(FilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
+ // On some targets, the file locking used to implement FileShare.None may not be
+ // atomic with opening/creating the file. This creates a race window when another
+ // thread holds the lock and is just about to unlock: we may be able to open the
+ // file here, then the other thread unlocks and deletes the file, and then we
+ // acquire the lock on our file handle - but the actual file is already deleted.
+ // To close this race, we verify that the file does in fact still exist now that
+ // we have successfull acquired the locked FileStream. (Note that this check is
+ // safe because we cannot race with an other attempt to create the file since we
+ // hold the guard, and after the FileStream constructor returned we can no race
+ // with file deletion because we hold the lock.)
+ if (!File.Exists(FilePath))
+ {
+ // To simplify the logic, we treat this case as "unable to acquire the lock"
+ // because it we caught another process while it owned the lock and was just
+ // giving it up. If the caller retries, we'll likely acquire the lock then.
+ stream.Dispose();
+ return false;
+ }
+ }
+ catch (Exception)
+ {
+ stream?.Dispose();
+ return false;
+ }
+ Stream = stream;
+ return true;
+ }
+
+ /// <summary>
+ /// Release the lock by deleting the lock file and disposing "Stream".
+ /// </summary>
+ internal void UnlockFile()
+ {
+ Debug.Assert(Stream is not null);
+ try
+ {
+ // Delete the lock file while the stream is not yet disposed
+ // and we therefore still hold the FileShare.None exclusion.
+ // There may still be a race with another thread attempting a
+ // TryLockFile in parallel, but that is safely handled there.
+ File.Delete(FilePath);
+ }
+ finally
+ {
+ Stream.Dispose();
+ Stream = null;
+ }
+ }
+
+ public bool TryLock(int timeoutMs)
+ {
+ if (IsDisposed)
+ throw new ObjectDisposedException("Mutex");
+ if (Stream is not null)
+ throw new InvalidOperationException("Lock already held");
+
+ var sw = Stopwatch.StartNew();
+ do
+ {
+ try
+ {
+ // Attempt to acquire lock while holding guard.
+ using var guard = LockGuard();
+ if (TryLockFile())
+ return true;
+ }
catch (Exception)
{
- // Something else went wrong.
return false;
}
+
+ // See comment in LockGuard.
+ Thread.Sleep(1);
} while (sw.ElapsedMilliseconds < timeoutMs);
return false;
}
- public void Unlock()
+ public bool CouldLock()
{
- if (!IsLocked)
- return;
- Stream.Unlock(0, 0);
- IsLocked = false;
+ if (IsDisposed)
+ return false;
+ if (Stream is not null)
+ return false;
+
+ try
+ {
+ // Attempt to acquire lock while holding guard, and if successful
+ // immediately unlock again while still holding guard. This ensures
+ // no other thread will spuriously observe the lock as held due to
+ // the lock attempt here.
+ using var guard = LockGuard();
+ if (TryLockFile())
+ {
+ UnlockFile();
+ return true;
+ }
+ }
+ catch (Exception)
+ {
+ return false;
+ }
+
+ return false;
}
public void Dispose()
{
- var wasLocked = IsLocked;
- if (wasLocked)
- Unlock();
- Stream.Dispose();
- // We do not delete the lock file here because there is no reliable way to perform a
- // 'delete if no one has the file open' operation atomically on *nix. This is a leak.
+ if (IsDisposed)
+ return;
+ IsDisposed = true;
+ if (Stream is not null)
+ {
+ try
+ {
+ UnlockFile();
+ }
+ catch (Exception)
+ {
+ }
+ }
}
}
@@ -792,56 +903,4 @@ public void Dispose()
}
}
}
-
- /// <summary>
- /// Approximates a named mutex with 'locked', 'unlocked' and 'abandoned' states.
- /// There is no reliable way to detect whether a mutex has been abandoned on some target platforms,
- /// so we use the AliveMutex to manually track whether the creator of a mutex is still running,
- /// while the HeldMutex represents the actual lock state of the mutex.
- /// </summary>
- internal sealed class ServerFileMutexPair : IServerMutex
- {
- public readonly FileMutex AliveMutex;
- public readonly FileMutex HeldMutex;
-
- public bool IsDisposed { get; private set; }
-
- public ServerFileMutexPair(string mutexName, bool initiallyOwned, out bool createdNew)
- {
- AliveMutex = new FileMutex(mutexName + "-alive");
- HeldMutex = new FileMutex(mutexName + "-held");
- createdNew = AliveMutex.TryLock(0);
- if (initiallyOwned && createdNew)
- {
- if (!TryLock(0))
- throw new Exception("Failed to lock mutex after creating it");
- }
- }
-
- public bool TryLock(int timeoutMs)
- {
- if (IsDisposed)
- throw new ObjectDisposedException("Mutex");
- return HeldMutex.TryLock(timeoutMs);
- }
-
- public void Dispose()
- {
- if (IsDisposed)
- return;
- IsDisposed = true;
-
- try
- {
- HeldMutex.Unlock();
- AliveMutex.Unlock();
- }
- finally
- {
- AliveMutex.Dispose();
- HeldMutex.Dispose();
- }
- }
- }
-
}
--
2.36.2

View file

@ -0,0 +1,48 @@
From 9a05b184f74fc299ddd33bccb74d153e0692d8c8 Mon Sep 17 00:00:00 2001
From: Tom Deseyn <tom.deseyn@gmail.com>
Date: Wed, 14 Sep 2022 11:06:42 +0200
Subject: [PATCH 1/8] source-build: support building runtime using non-portable
runtime packages.
Currently source-build performs a 'runtime-portable' build that produces
'linux-{arch}' packages that are used when building target runtime (non-portable).
With this change, we can use the non-portable packages that are produced by
a previous (non-portable) 'runtime' build. This helps eliminate the
'runtime-portable' build.
---
src/runtime/Directory.Build.targets | 15 ++++
src/runtime/Directory.Build.targets.orig | 96 ++++++++++++++++++++++++
2 files changed, 111 insertions(+)
create mode 100644 src/runtime/Directory.Build.targets.orig
diff --git a/src/runtime/Directory.Build.targets b/src/runtime/Directory.Build.targets
index d0c698797..4337207a4 100644
--- a/src/runtime/Directory.Build.targets
+++ b/src/runtime/Directory.Build.targets
@@ -11,6 +11,21 @@
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
<Import Project="$(RepositoryEngineeringDir)python.targets" />
+ <!--
+ When .NET gets built from source, make the SDK aware there are bootstrap packages
+ for Microsoft.NETCore.App.Runtime.<rid> and Microsoft.NETCore.App.Crossgen2.<rid>.
+ -->
+ <ItemGroup Condition=" '$(DotNetBuildFromSource)' == 'true' " >
+ <KnownFrameworkReference Update="@(KnownFrameworkReference->WithMetadataValue('Identity', 'Microsoft.NETCore.App')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
+ <RuntimePackRuntimeIdentifiers>$(PackageRID)</RuntimePackRuntimeIdentifiers>
+ </KnownFrameworkReference>
+ <KnownCrossgen2Pack Update="@(KnownCrossgen2Pack->WithMetadataValue('Identity', 'Microsoft.NETCore.App.Crossgen2')->WithMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))">
+ <Crossgen2RuntimeIdentifiers>$(PackageRID)</Crossgen2RuntimeIdentifiers>
+ </KnownCrossgen2Pack>
+ <!-- Avoid references to Microsoft.AspNetCore.App.Runtime.<rid> -->
+ <KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
+ </ItemGroup>
+
<PropertyGroup>
<!--
Define this here (not just in Versions.props) because the SDK resets it
--
2.38.0

View file

@ -0,0 +1,189 @@
From f54977e2fc84527fe58024ed5537cb63244168e2 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/pull/76500
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 13 Sep 2022 14:17:35 +0200
Subject: [PATCH 1/1] Mono musl support
---
src/coreclr/pal/src/misc/perfjitdump.cpp | 2 +-
src/mono/CMakeLists.txt | 29 ++++++++++++++++++++++++
src/mono/mono.proj | 18 +++++++++------
src/mono/mono/metadata/domain.c | 10 ++++++++
src/mono/mono/mini/CMakeLists.txt | 10 ++++++++
src/mono/mono/utils/mono-context.h | 8 +++++++
6 files changed, 69 insertions(+), 8 deletions(-)
diff --git a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp
index d80bd58038c..3488397b0da 100644
--- a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp
+++ b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp
@@ -25,7 +25,7 @@
#include <sys/uio.h>
#include <time.h>
#include <unistd.h>
-#include <linux/limits.h>
+#include <limits.h>
#include "../inc/llvm/ELF.h"
diff --git a/src/runtime/src/mono/CMakeLists.txt b/src/runtime/src/mono/CMakeLists.txt
index 49a73b1b709..7e596d69d35 100644
--- a/src/runtime/src/mono/CMakeLists.txt
+++ b/src/runtime/src/mono/CMakeLists.txt
@@ -208,6 +208,35 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Enable the "full RELRO" options (RELRO & BIND_NOW) at link time
add_link_options(-Wl,-z,relro)
add_link_options(-Wl,-z,now)
+ # Detect Linux ID
+ # TODO: Eventually merge with eng/native/configureplatform.cmake
+ set(LINUX_ID_FILE "/etc/os-release")
+ if(CMAKE_CROSSCOMPILING)
+ set(LINUX_ID_FILE "${CMAKE_SYSROOT}${LINUX_ID_FILE}")
+ endif()
+
+ if(EXISTS ${LINUX_ID_FILE})
+ execute_process(
+ COMMAND bash -c "source ${LINUX_ID_FILE} && echo \$ID"
+ OUTPUT_VARIABLE CLR_CMAKE_LINUX_ID
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND bash -c "if strings \"${CMAKE_SYSROOT}/usr/bin/ldd\" 2>&1 | grep -q musl; then echo musl; fi"
+ OUTPUT_VARIABLE CLR_CMAKE_LINUX_MUSL
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif()
+
+ if(DEFINED CLR_CMAKE_LINUX_ID)
+ if(CLR_CMAKE_LINUX_ID STREQUAL alpine)
+ set(CLR_CMAKE_HOST_ALPINE_LINUX 1)
+ set(CLR_CMAKE_HOST_OS ${CLR_CMAKE_LINUX_ID})
+ endif()
+
+ if(CLR_CMAKE_LINUX_MUSL STREQUAL musl)
+ set(CLR_CMAKE_HOST_LINUX_MUSL 1)
+ endif()
+ endif(DEFINED CLR_CMAKE_LINUX_ID)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(HOST_LINUX 1)
add_definitions(-D_GNU_SOURCE -D_REENTRANT)
diff --git a/src/runtime/src/mono/mono.proj b/src/runtime/src/mono/mono.proj
index d6a0c9a8ec2..933ed60cea7 100644
--- a/src/runtime/src/mono/mono.proj
+++ b/src/runtime/src/mono/mono.proj
@@ -417,11 +417,15 @@
<!-- Linux options -->
<ItemGroup Condition="'$(TargetsLinux)' == true">
<_MonoCFLAGS Include="-Wl,--build-id=sha1" />
+ <_MonoCFLAGS Include="-Wno-strict-prototypes" />
<_MonoCXXFLAGS Include="-Wl,--build-id=sha1" />
+ <_MonoCXXFLAGS Include="-Wno-strict-prototypes" />
</ItemGroup>
<ItemGroup Condition="'$(RealTargetOS)' == 'Linux'">
<_MonoAOTCFLAGS Include="-Wl,--build-id=sha1" />
+ <_MonoAOTCFLAGS Include="-Wno-strict-prototypes" />
<_MonoAOTCXXFLAGS Include="-Wl,--build-id=sha1" />
+ <_MonoAOTCXXFLAGS Include="-Wno-strict-prototypes" />
</ItemGroup>
<!-- Devloop features -->
@@ -500,15 +504,15 @@
<MonoToolchainPrebuiltOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">darwin-x86_64</MonoToolchainPrebuiltOS>
<MonoToolchainPrebuiltOS Condition="'$(OS)' == 'Windows_NT'">windows-x86_64</MonoToolchainPrebuiltOS>
<_MonoRuntimeFilePath>$(MonoObjDir)out\lib\$(MonoFileName)</_MonoRuntimeFilePath>
- <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true'">gnu</_LinuxAbi>
- <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true'">android</_LinuxAbi>
+ <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true'">alpine-linux-musl</_LinuxAbi>
+ <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true'">linux-android</_LinuxAbi>
<_LinuxFloatAbi Condition="'$(TargetsAndroid)' != 'true'">hf</_LinuxFloatAbi>
<_Objcopy>objcopy</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'arm'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'arm64'">aarch64-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 's390x'">s390x-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'x64'">x86_64-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'x86'">i686-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'arm' and '$(CrossBuild)' == 'true'">arm-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'arm64' and '$(CrossBuild)' == 'true'">aarch64-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 's390x' and '$(CrossBuild)' == 'true'">s390x-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'x64' and '$(CrossBuild)' == 'true'">x86_64-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'x86' and '$(CrossBuild)' == 'true'">i686-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
<_Objcopy Condition="'$(TargetsAndroid)' == 'true'">$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/bin/$(_Objcopy)</_Objcopy>
</PropertyGroup>
<!-- test viability of objcopy command -->
diff --git a/src/runtime/src/mono/mono/metadata/domain.c b/src/runtime/src/mono/mono/metadata/domain.c
index 4a8e06d28ae..e9868bd1b2c 100644
--- a/src/runtime/src/mono/mono/metadata/domain.c
+++ b/src/runtime/src/mono/mono/metadata/domain.c
@@ -138,6 +138,14 @@ create_root_domain (void)
return domain;
}
+static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE void
+ensure_stack_size (void)
+{
+ const int default_size = 5 * 1024 * 1024;
+ volatile uint8_t *s = (uint8_t *)g_alloca(default_size);
+ *s = 0;
+}
+
/**
* mono_init_internal:
*
@@ -181,6 +189,8 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
mono_counters_register ("Max HashTable Chain Length", MONO_COUNTER_INT|MONO_COUNTER_METADATA, &mono_g_hash_table_max_chain_length);
+ ensure_stack_size ();
+
mono_gc_base_init ();
mono_thread_info_attach ();
diff --git a/src/runtime/src/mono/mono/mini/CMakeLists.txt b/src/runtime/src/mono/mono/mini/CMakeLists.txt
index 128ed08f45b..17cbe696c4b 100644
--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt
+++ b/src/runtime/src/mono/mono/mini/CMakeLists.txt
@@ -364,6 +364,11 @@ if(NOT DISABLE_SHARED_LIBS)
set_target_properties(monosgen-shared PROPERTIES IMPORT_SUFFIX ".import.lib")
endif()
target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS})
+ # Alpine Linux implements ucontext in a different library
+ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ target_link_libraries(monosgen-shared PRIVATE ucontext)
+ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+
if(ICU_LDFLAGS)
set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}")
endif()
@@ -488,6 +493,11 @@ if(NOT DISABLE_EXECUTABLES)
set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross)
endif()
target_link_libraries(mono-sgen PRIVATE monosgen-static ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS})
+ # Alpine Linux implements ucontext in a different library
+ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ target_link_libraries(mono-sgen PRIVATE ucontext)
+ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+
if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS)
# if components are built statically, link them into runtime.
target_sources(mono-sgen PRIVATE "${mono-components-objects}")
diff --git a/src/runtime/src/mono/mono/utils/mono-context.h b/src/runtime/src/mono/mono/utils/mono-context.h
index bd1a3cd0104..db4ba452bcb 100644
--- a/src/runtime/src/mono/mono/utils/mono-context.h
+++ b/src/runtime/src/mono/mono/utils/mono-context.h
@@ -11,6 +11,14 @@
#ifndef __MONO_MONO_CONTEXT_H__
#define __MONO_MONO_CONTEXT_H__
+/*
+ * Handle non-gnu libc versions with nothing in features.h
+ * We have no idea what they're compatible with, so always fail.
+ */
+#ifndef __GLIBC_PREREQ
+# define __GLIBC_PREREQ(x,y) 0
+#endif
+
#include "mono-compiler.h"
#include "mono-sigcontext.h"
#include "mono-machine.h"
--
2.36.3

View file

@ -0,0 +1,25 @@
From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/issues/82269
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 1 Oct 2022 09:21:58 -0400
Subject: [PATCH] Undefine fortify-source on mono-thread-coop
When _FORTIFY_SOURCE=2, there is a bug relating to memcpy that expresses itself.
which makes mono-flavored runtime dump its core. This patch offers a workaround
by undefining _FORTIFY_SOURCE in the problematic file.
See: https://github.com/dotnet/runtime/issues/82269
---
diff --git a/src/runtime/src/mono/mono/utils/mono-threads-coop.c b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
index 4ed659d6605..34bb5785fba 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads-coop.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
@@ -15,6 +15,7 @@
#ifdef TARGET_MACH
#define _DARWIN_C_SOURCE
#endif
+#undef _FORTIFY_SOURCE
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-threads.h>

View file

@ -0,0 +1,22 @@
From 75c3e74ea35219f257c80daf9a236e0f518a7875 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/installer/pull/13378
From: Antoine Martin <dev@ayakael.net>
Date: Wed, 9 Mar 2022 20:16:03 +0000
Subject: [PATCH 1/1] Enable system libunwind
Forces use of system's libunwind
---
diff --git a/src/runtime/eng/SourceBuild.props b/src/runtime/eng/SourceBuild.props
index f595e9b7d1..d90fd47dbd 100644
--- a/src/runtime/eng/SourceBuild.props
+++ b/src/runtime/eng/SourceBuild.props
@@ -47,6 +47,7 @@
<InnerBuildArgs>$(InnerBuildArgs) /p:BuildDebPackage=false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:RuntimeOS=$(RuntimeOS)</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS)</InnerBuildArgs>
+ <InnerBuildArgs>$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</InnerBuildArgs>
</PropertyGroup>
</Target>

View file

@ -0,0 +1,31 @@
From 91988b0241a77f1f6524c19e2ce55dda06de7242 Mon Sep 17 00:00:00 2001
Patch-Source: https://src.fedoraproject.org/rpms/dotnet6.0/blob/src/runtime/rawhide/f/runtime-arm64-lld-fix.patch
From: Omair Majid <omajid@redhat.com>
Date: Wed, 16 Feb 2022 18:08:22 +0000
Subject: [PATCH 1/1] arm64 lld fix
---
eng/native/init-compiler.sh | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/runtime/eng/native/init-compiler.sh b/src/runtime/eng/native/init-compiler.sh
index 567d18da474..05245c7b9f8 100755
--- a/src/runtime/eng/native/init-compiler.sh
+++ b/src/runtime/eng/native/init-compiler.sh
@@ -108,11 +108,8 @@ if [[ -z "$CC" ]]; then
fi
if [[ "$compiler" == "clang" ]]; then
- if command -v "lld$desired_version" > /dev/null; then
- # Only lld version >= 9 can be considered stable
- if [[ "$majorVersion" -ge 9 ]]; then
- LDFLAGS="-fuse-ld=lld"
- fi
+ if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then
+ LDFLAGS="-fuse-ld=lld"
fi
fi
--
2.34.1

View file

@ -0,0 +1,35 @@
From 4c74721e1f5da9642adab03075dda2f55719ac7b Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/sdk/pull/14239
From: Esgariot <esgariot@icloud.com>
Date: Mon, 19 Oct 2020 23:42:37 +0200
Subject: [PATCH 1/1] Add zsh compdef completion script.
Continuing off of PR 13384 in upstream.
This commit is ready to be rebased to include appropriate co-authors
before merging PR.
---
scripts/register-completions.zsh | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/sdk/scripts/register-completions.zsh b/src/sdk/scripts/register-completions.zsh
index 8eebe9a867..faa32fef71 100644
--- a/src/sdk/scripts/register-completions.zsh
+++ b/src/sdk/scripts/register-completions.zsh
@@ -1,10 +1,3 @@
-# zsh parameter completion for the dotnet CLI
-
-_dotnet_zsh_complete()
-{
- local completions=("$(dotnet complete "$words")")
-
- reply=( "${(ps:\n:)completions}" )
-}
-
-compctl -K _dotnet_zsh_complete dotnet
+#compdef dotnet
+local completions=("$(dotnet complete "$words")")
+[[ -n "$completions" ]] && compadd -- "${(ps:\n:)completions}"
--
2.34.1

View file

@ -0,0 +1,32 @@
From eb7141ec561b9a2551d16ee661343b87c5e5f1b1 Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Sun, 23 Jan 2022 15:47:27 +0000
Subject: [PATCH 1/1] SDK telemetry optout
Disables telemetry by default.
---
src/Cli/dotnet/Program.cs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/sdk/src/Cli/dotnet/Program.cs b/src/sdk/src/Cli/dotnet/Program.cs
index c3be733b4a..2a157a75d5 100644
--- a/src/sdk/src/Cli/dotnet/Program.cs
+++ b/src/sdk/src/Cli/dotnet/Program.cs
@@ -27,6 +27,13 @@ public class Program
public static int Main(string[] args)
{
+ // opt out of telemetry by default if the env var is unset
+ string telemetryValue = Environment.GetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT");
+ if (String.IsNullOrEmpty(telemetryValue))
+ {
+ Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
+ }
+
DebugHelper.HandleDebugSwitch(ref args);
// Capture the current timestamp to calculate the host overhead.
--
2.35.1

View file

@ -0,0 +1,137 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# secfixes:
# 6.0.6-r0:
# - CVE-2022-30184
# 6.0.8-r0:
# - CVE-2022-34716
# 6.0.9-r0:
# - CVE-2022-38013
# 6.0.10-r0:
# - CVE-2022-41032
# 6.0.12-r0:
# - CVE-2022-41089
# 6.0.13-r0:
# - CVE-2023-21538
# 6.0.14-r0:
# - CVE-2023-21808
pkgname=dotnet6-runtime
pkgver=6.0.15
_bldver=6.0.115-r0
pkgrel=0
_pkgver_macro=${pkgver%.*}
_pkgver_name=${_pkgver_macro//[.0]}
_bldver_ver=${_bldver%%-*}
pkgdesc="The .NET $_pkgver_macro Core runtime"
arch="x86_64 aarch64 armv7 s390x"
url=https://dotnet.microsoft.net
license="MIT"
depends="
dotnet$_pkgver_name-hostfxr
icu-data-full
icu-libs
"
makedepends="dotnet$_pkgver_name-build=$_bldver"
subpackages="
aspnetcore$_pkgver_name-runtime:aspnetcore_runtime:noarch
aspnetcore$_pkgver_name-targeting-pack:aspnetcore_targeting_pack:noarch
dotnet$_pkgver_name-apphost-pack:apphost_pack
dotnet$_pkgver_name-hostfxr
dotnet$_pkgver_name-targeting-pack:targeting_pack:noarch
dotnet-host:host
"
provides="dotnet$_pkgver_name=$pkgver-r$pkgrel"
options="!check" # No test suite
source="dotnet.sh.in"
builddir="$srcdir"
_libdir="/usr/lib"
case $CARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7) _dotnet_arch="arm";;
armhf) _dotnet_arch="armv6";;
*) _dotnet_arch="$CARCH";;
esac
build() {
sed "s|%LIBDIR%|$_libdir/dotnet|" "$srcdir"/dotnet.sh.in > "$srcdir"/dotnet.sh
}
package() {
install -dm 755 "$pkgdir"/$_libdir/dotnet/shared
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/shared/Microsoft.NETCore.App "$pkgdir"/$_libdir/dotnet/shared/.
}
host() {
pkgdesc="A generic driver for the .NET Core Command Line Interface"
depends=""
install -dm 755 \
"$subpkgdir"/etc/profile.d \
"$subpkgdir"/etc/dotnet \
"$subpkgdir"/usr/bin \
"$subpkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/dotnet "$subpkgdir"/$_libdir/dotnet/.
ln -s $_libdir/dotnet/dotnet "$subpkgdir"/usr/bin/dotnet
echo "$_libdir/dotnet" > "$subpkgdir"/etc/dotnet/install_location
echo "$_libdir/dotnet" > "$subpkgdir"/etc/dotnet/install_location_$_dotnet_arch
install -Dm 644 "$srcdir"/dotnet.sh -t "$subpkgdir"/etc/profile.d/
}
hostfxr() {
pkgdesc="The .NET host resolver contains the logic to resolve and select the right version of the .NET SDK or runtime to use."
depends="dotnet-host"
provides="dotnet-hostfxr-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/host "$subpkgdir"/$_libdir/dotnet/.
}
aspnetcore_runtime() {
pkgdesc="The ASP.NET $_pkgver_macro Core runtime"
depends="dotnet$_pkgver_name-runtime"
provides="aspnetcore-runtime-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/shared
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/shared/Microsoft.AspNetCore.App "$subpkgdir"/$_libdir/dotnet/shared/.
}
apphost_pack() {
pkgdesc="The .NET $_pkgver_macro Core apphost pack"
provides="dotnet-apphost-pack-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.NETCore.App.Host.* "$subpkgdir"/$_libdir/dotnet/packs/.
}
targeting_pack() {
pkgdesc="The .NET $_pkgver_macro Core targeting pack"
provides="dotnet-targeting-pack-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.NETCore.App.Ref "$subpkgdir"/$_libdir/dotnet/packs/.
}
aspnetcore_targeting_pack() {
pkgdesc="The ASP.NET $_pkgver_macro Core targeting pack"
provides="aspnetcore-targeting-pack-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.AspNetCore.App.Ref "$subpkgdir"/$_libdir/dotnet/packs/.
}
sha512sums="
c3f31956976b77198e72a3fef3427338b6b2961f8c121416040c1105de0ce8073e46f4c2e9ef22a001aee69cbe39621c2ddac988522693110071dfae42f2e2b7 dotnet.sh.in
"

View file

@ -0,0 +1,144 @@
# dotnet6-runtime
This is the .NET 6.0 package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
# Building info
## Generated packages
* `aspnetcore6-runtime`
* `aspnetcore6-targeting-pack`
* `dotnet6-apphost-pack` (used by dotnet6-runtime)
* `dotnet6-hostfxr` (used by dotnet-host)
* `dotnet6-runtime`
* `dotnet6-targeting-pack`
* `dotnet-host`
## How to build dotnet6 on Alpine
As dotnet is a self-hosting compiler (thus it compiles using itself), it
requires a bootstrap for the initial build. To solve this problem, this package
follows the `stage0` proposal outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E)
The goal of `stage0` is to bootstrap dotnet with as little intervention as
possible, thus allowing seamless Alpine upgrades. Unfortunately, upstream only
builds bootstraps for Alpine on `x86_64`, `aarch64`, and `armv7`. Thus, `stage0`
has also been designed to be crossbuild aware, allowing bootstrapping to other
platforms.
In summary, dotnet6 is built using three different aports.
* `community/dotnet6-stage0`
Builds minimum components for full build of dotnet6, and packages these in an initial
`dotnet6-stage0-bootstrap` package that `dotnet6-build` pulls.
* `community/dotnet6-build`
Builds full and packages dotnet6 fully using either stage0 or previoulsy built
dotnet6 build.
* `community/dotnet6-runtime`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet6-build.
## Crossbuilding with `stage0`
Crossbuilding `stage0` is a three step process:
1. Build sysroot for target platform by using `scripts/bootstrap.sh` in aports repo:
```
./bootstrap.sh $CTARGET_ARCH
```
2. Although not necessary, it is recommended to add Alpine repositories to
`$HOME/sysroot-$CTARGET_ARCH/etc/apk/repositories`, making sure to add required
keys. This makes it so that whatever package is not built in step 1 will
be pulled from package repos
3. Crossbuild `dotnet6-stage0` via:
```
CHOST=$CTARGET_ARCH abuild -r
```
# Specification
This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging),
with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`).
In addition, the package is named `dotnet6` as opposed to `dotnet-6.0`
to match Alpine Linux naming conventions for packages with many installable versions
# Contributing
The steps below are for the final package. Please only contribute to a
pre-release version if you know what you are doing. Original instructions
follow.
## General Changes
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet6-runtime`
3. Make your changes. Don't forget to add a changelog.
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally.
6. Commit the changes to the git repo in a git branch
- `git checkout -b dotnet6/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet6-runtime: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
8. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
## Updating to an new upstream release
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet6-runtime`
3. Build the new upstream source tarball. Update the versions in the
APKBUILD file, and then create a snapshot. After build, update checksum.
- `abuild snapshot`
- `abuild checksum`
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally. Any
patches that are needed at this point should be added to the APKBUILD file
in `_patches` variable.
6. Upload the source archive to a remote location, and update `source` variable.
7. Commit the changes to the git repo in a git branch.
- `git checkout -b dotnet6/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet6-runtime: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.
9. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
# Testing
This package uses CI tests as defined in `check()` function. Creating a
merge-request or running a build will fire off tests and flag any issues.
The tests themselves are contained in this external repository:
https://github.com/redhat-developer/dotnet-regular-tests/

View file

@ -0,0 +1,12 @@
# Set location for AppHost lookup
[ -z "$DOTNET_ROOT" ] && export DOTNET_ROOT=%LIBDIR%
# Add dotnet tools directory to PATH
DOTNET_TOOLS_PATH="$HOME/.dotnet/tools"
case "$PATH" in
*"$DOTNET_TOOLS_PATH"* ) true ;;
* ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;;
esac
# Extract self-contained executables under HOME to avoid multi-user issues from using the default '/var/tmp'
[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"$HOME"/.cache}/dotnet_bundle_extract"

529
user/dotnet7-build/APKBUILD Normal file
View file

@ -0,0 +1,529 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# secfixes:
# 7.0.103-r0:
# - CVE-2023-21808
pkgname=dotnet7-build
pkgver=7.0.104
pkgrel=0
_gittag=v$pkgver
_giturl="https://github.com/dotnet/installer"
_testtag=16c3c04f3ae6620a474fa0474e8b298190e506c1
_bunnytag=v12
_patches="
build_disable-source-link.patch
build_enable-timestamps.patch
build_shutdown-build-servers-at-each-build-step.patch
check_rid-alpine-generation.diff
roslyn-analyzer_disable-apphost.patch
runtime_76500-mono-musl-support.patch
runtime_enable-runtime-marshalling.diff
runtime_enable-system-libunwind.diff
runtime_mono-thread-coop-undefine-fortify-source.patch
sdk_14239-add-zsh-compdef-completion-script.patch
"
_pkgver_macro=${pkgver%.*}
_pkgver_prior=${pkgver%.*.*}
_pkgver_name=${_pkgver_macro//[.0]}
pkgdesc="The .NET $_pkgver_macro bootstrap"
# x86: blocked by https://github.com/dotnet/runtime/issues/77667
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663
# riscv64: port WIP https://github.com/dotnet/runtime/issues/36748
arch="all !x86 !armhf !riscv64"
url=https://dotnet.microsoft.com
license="MIT"
# hack for dotnetx-build to be able to pull itself for bootstrapping
provides="dotnet$_pkgver_name-bootstrap"
provider_priority=$_pkgver_prior
checkdepends="
babeltrace
binutils
coreutils
file
gawk
jq
lttng-tools
npm
procps
sed
strace
util-linux-misc
which
"
makedepends="
bash
clang
cmake
dotnet$_pkgver_name-bootstrap
dotnet$_pkgver_name-bootstrap-artifacts
dotnet$_pkgver_name-stage0
findutils
git
grep
icu-data-full
icu-dev
inetutils-syslogd
krb5-dev
libgit2-dev
libintl
libucontext-dev
libunwind-dev
libxml2-dev
libxml2-utils
linux-headers
lldb-dev
llvm-dev
lttng-ust-dev
nodejs
numactl-dev
openssl-dev
pigz
rsync
samurai
tar
xz
zlib-dev
"
case $CARCH in
s390x|x86) ;;
*) makedepends="$makedepends lld-dev";;
esac
subpackages="
dotnet$_pkgver_name-artifacts:artifacts:noarch
dotnet$_pkgver_name-sdk
dotnet$_pkgver_name-templates:templates:noarch
dotnet-zsh-completion:zshcomp:noarch
dotnet-bash-completion:bashcomp:noarch
dotnet-doc
netstandard21-targeting-pack:netstandard_targeting_pack:noarch
"
source="
https://lab.ilot.io/dotnet/installer/-/releases/$_gittag/downloads/tarball/dotnet-$_gittag.tar.xz
dotnet-testsuite-$_testtag.tar.gz::https://github.com/redhat-developer/dotnet-regular-tests/archive/$_testtag.tar.gz
dotnet-bunny-$_bunnytag.tar.gz::https://github.com/redhat-developer/dotnet-bunny/archive/$_bunnytag.tar.gz
$_patches
"
builddir="$srcdir"/dotnet-$_gittag
_checkdir="$srcdir"/dotnet-bunny-${_bunnytag/v}
_testdir="$srcdir"/dotnet-regular-tests-$_testtag
_cli_root="$srcdir"/bootstrap
_libdir="/usr/lib"
# if true, then within pipeline environment, in which case send logs there
# to be scooped
if [ -d "$APORTSDIR/logs" ]; then
_logdir="$APORTSDIR"/logs/$pkgname
else
_logdir="$srcdir"/logs
fi
case $CARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7) _dotnet_arch="arm";;
armhf) _dotnet_arch="armv6";;
*) _dotnet_arch="$CARCH";;
esac
# Build doesn't set all the right executable bits for the right file types
_fix_executable() {
# add executable bit
find "$1" -type f \( \
-name 'apphost' -o \
-name 'singlefilehost' -o \
-name 'lib*so' \
\) \
-exec chmod +x '{}' \;
# remove executable bit
find "$1" -type f \( \
-name '*.a' -o \
-name '*.dll' -o \
-name '*.h' -o \
-name '*.json' -o \
-name '*.pdb' -o \
-name '*.props' -o \
-name '*.pubxml' -o \
-name '*.targets' -o \
-name '*.txt' -o \
-name '*.xml' \
\) \
-exec chmod -x '{}' \;
}
# generates tarball containing all components built by dotnet
snapshot() {
local _pkg="$srcdir"/${builddir##*/}.tar
ulimit -n 4096
if [ -d "$srcdir" ]; then
cd "$srcdir"
else
mkdir -p "$srcdir" && cd "$srcdir"
fi
if [ -d "installer" ]; then
cd "$srcdir"/installer
else
git clone $_giturl --branch $_gittag && cd "$srcdir"/installer
fi
sed 's|<Exec Command="tar.*|<Exec Command="tar -cf $(TarballFilePath) -C $(TarballDir)/.. $([MSBuild]::MakeRelative($([System.IO.Path]::GetDirectoryName($(TarballDir))), $(TarballDir)))" />|' -i src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets
if [ -d "$_libdir/dotnet/bootstrap" ]; then
local _cli_root="$(find $_libdir/dotnet/bootstrap/${_pkgver_macro}* -maxdepth 0 -type d | sort -r | head -n 1)"
else
local _cli_root=""
fi
_InitializeDotNetCli="$_cli_root" DOTNET_INSTALL_DIR="$_cli_root" DotNetBuildFromSource=true ./build.sh \
/p:ArcadeBuildTarball=true \
/p:TarballDir=$builddir \
/p:TarballFilePath=$_pkg
msg "Compressing ${builddir##*/}.tar to $SRCDEST"
xz -T0 -9 -vv -e -c > "$SRCDEST"/${builddir##*/}.tar.xz < "$_pkg"
cd "$startdir"
abuild checksum
}
prepare() {
default_prepare
# check patches
msg "check_rid-alpine-generation.diff"
patch -p1 -d "$_testdir" -i "$srcdir"/check_rid-alpine-generation.diff
# Parallel restore is broken on mono-based builds since dotnet7
# see https://github.com/dotnet/runtime/issues/77364
# A workaround via runtime_enable-runtime-marshalling.diff
case $CARCH in
s390x|ppc64le)
msg "runtime_enable-runtime-marshalling.diff"
patch -p1 -i "$srcdir"/runtime_enable-runtime-marshalling.diff
;;
esac
# Using system libunwind is broken on aarch64|armv7, and unused on mono-based builds
# see https://github.com/dotnet/source-build/issues/2408,
case $CARCH in
aarch64|armv7) msg "Using bundled libunwind";;
armhf|s390x|ppc64le) msg "No libunwind used";;
*)
msg "Using system libunwind"
patch -p1 -i "$srcdir"/runtime_enable-system-libunwind.diff
;;
esac
# ensure that dotnet does not download artifacts provided by dotnet-artifacts
rm -rf "$builddir"/packages/archive
# links logfiles to pipeline logs for easy pickup in pipelines
mkdir -p "$_logdir" "$builddir"/artifacts
ln -s "$_logdir" "$builddir"/artifacts/logs
ln -s "$_logdir" "$builddir"/artifacts/log
for i in "$builddir"/src/*; do
if [ -f "$i" ]; then
continue
fi
mkdir -p "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts
ln -s "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts/log
done
# dotnet requires its bootstrap to be in a writable dir
msg "Setting up bootstrap"
local _bootstrapdir=$(find $_libdir/dotnet/bootstrap/$_pkgver_macro* -maxdepth 0 | sort -r | head -n 1)
if [ ! -d "$_cli_root" ]; then
cp -r "$_bootstrapdir" "$_cli_root"
fi
}
build() {
msg "Building $pkgname-$pkgver"
ulimit -n 4096
# Disable use of LTTng as tracing on lttng <=2,13,0 is broken
# See https://github.com/dotnet/runtime/issues/57784.
if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then
export DOTNET_LTTng=0
fi
# looks for most recent recent version of _artifactsdir
local _artifactsdir=$(find $_libdir/dotnet/artifacts/$_pkgver_macro* -maxdepth 0 | sort -r | head -n 1)
# ci args, else the output is forwarded to log files which isn't ideal in a
# pipeline environment, and build by defaults uses lots of space
local args="
/v:minimal
/p:LogVerbosity=minimal
/p:MinimalConsoleLogOutput=true
/p:CleanWhileBuilding=true
"
# part of https://github.com/dotnet/installer/pull/14792 that sets this flag
# was not integrated in 7.0.1xx yet
case $CARCH in
s390x|ppc64le) local args="$args /p:SourceBuildUseMonoRuntime=true";;
esac
# Sets TargetRid manually as dotnet cannot be trusted to reliably compute
# the machine's runtime ID between releases.
# shellcheck disable=SC2034
. /etc/os-release
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
while [ ${#VERSION_ID_DOT} -gt 1 ]; do
local VERSION_ID="${VERSION_ID%.*}"
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
done
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
while [ ${#VERSION_ID_DASH} -ge 1 ]; do
local VERSION_ID="${VERSION_ID%_*}"
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
done
local args="$args /p:TargetRid=$ID.$VERSION_ID-$_dotnet_arch"
./build.sh \
--with-sdk "$_cli_root" \
--with-packages "$_artifactsdir" \
-- $args
}
check() {
ulimit -n 4096
# Tests timeout (in seconds)
local _tests_timeout=1000
# Test suite disable flags
# following tests can only work after packaging step
local _disabled_tests="man-pages distribution-package bash-completion install-location release-version-sane"
# test broken: permission issue on lxc / pipelines
local _disabled_tests="$_disabled_tests createdump-aspnet workload"
# liblttng-ust_sys-sdt.h: no 'NT_STAPSDT' on Alpine's lttng-ust package
# lttng: known issue, see https://github.com/dotnet/runtime/issues/57784
local _disabled_tests="$_disabled_tests liblttng-ust_sys-sdt.h lttng"
# {bundled,system}-libunwind: use system version on all but aarch64/armv7, as broken
# see https://github.com/redhat-developer/dotnet-regular-tests/issues/113
# disable on mono-flavored runtime as mono does not use libunwind
case $CARCH in
armv7|aarch64) local _disabled_tests="$_disabled_tests system-libunwind";;
s390x|ppc64le|armhf) local _disabled_tests="$_disabled_tests bundled-libunwind system-libunwind";;
*) local _disabled_tests="$_disabled_tests bundled-libunwind";;
esac
# test unit broken currently
_disabled_tests="$_disabled_tests system-libunwind"
# nativeaot is not supported on armv7
case $CARCH in
armv7) local _disabled_tests="$_disabled_tests nativeaot"
esac
msg "Unpacking produced dotnet"
export DOTNET_ROOT="$_checkdir/release"
if [ ! -d "$DOTNET_ROOT" ]; then
mkdir -p "$DOTNET_ROOT"
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$DOTNET_ROOT" \
--no-same-owner
fi
export PATH="$DOTNET_ROOT:$PATH"
# some files either should or should not have executable bits
# (done again during packaging - this is for tests)
_fix_executable "$DOTNET_ROOT"
msg "Building turkey test suite"
if [ ! -d "$_checkdir"/turkey ]; then
cd "$_checkdir"/Turkey
dotnet publish -f netcoreapp3.1 -c Release -p:VersionPrefix=1 -p:VersionSuffix="$(git rev-parse --short HEAD)" -o "$_checkdir"/turkey
fi
msg "Running test suite"
cd "$_testdir"
for i in $_disabled_tests; do
if [ -d "$i" ]; then
sed -i 's|"enabled": true|"enabled": false|' $i/test.json
fi
done
dotnet "$_checkdir"/turkey/Turkey.dll -t $_tests_timeout || local ERROR=true
if [ $ERROR ]; then
msg "Check error reported, dumping logs"
for i in *.log; do
msg "Dumping $i"
cat "$i"
done
fi
}
package() {
# directory creation
install -dm 755 \
"$pkgdir"/$_libdir/dotnet/bootstrap/$pkgver \
"$pkgdir"/usr/share/man/man1 \
"$pkgdir"/$_libdir/dotnet/artifacts/$pkgver
# unpack sdk to bootstrap
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$pkgdir"/$_libdir/dotnet/bootstrap/$pkgver/ \
--no-same-owner
# extract arch-specific artifacts to artifacts dir for use by future dotnet builds
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz \
-C "$pkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner \
--wildcards \
'*alpine*'
# assemble docs
find "$builddir" -iname 'dotnet*.1' -type f -exec cp '{}' "$pkgdir"/usr/share/man/man1/. \;
# some files either should or should not have executable bits
_fix_executable "$pkgdir"
# Disable use of LTTng as tracing on lttng <=2,13,0 is broken
# See https://github.com/dotnet/runtime/issues/57784.
if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then
rm "$pkgdir"/$_libdir/dotnet/bootstrap/*/shared/Microsoft.NETCore.App/*/libcoreclrtraceptprovider.so
fi
}
sdk() {
pkgdesc="The .NET $_pkgver_macro SDK"
# libucontext isn't automatically detected on all platforms
depends="
aspnetcore$_pkgver_name-runtime
aspnetcore$_pkgver_name-targeting-pack
dotnet$_pkgver_name-apphost-pack
dotnet$_pkgver_name-targeting-pack
dotnet$_pkgver_name-templates
netstandard21-targeting-pack
libucontext
"
provides="
dotnet-sdk-$_pkgver_macro=$pkgver-r$pkgrel
dotnet$_pkgver_name-dev=$pkgver-r$pkgrel
"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
# sdk
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./sdk ./sdk-manifests
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
# See https://github.com/dotnet/source-build/issues/2579
find "$subpkgdir" -type f -name 'testhost.x86' -delete
find "$subpkgdir" -type f -name 'vstest.console' -delete
}
netstandard_targeting_pack() {
pkgdesc="The .NET 2.1 Standard targeting pack"
depends="dotnet-host"
provides="netstandard-targeting-pack-2.1=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./packs/NETStandard.Library.Ref
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
}
templates() {
pkgdesc="The .NET $_pkgver_macro templates"
depends="dotnet-host"
provides="dotnet-templates-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./templates
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
}
artifacts() {
pkgdesc="Internal package for building .NET $_pkgver_macro Software Development Kit"
# hack to allow artifacts to pull itself
provides="dotnet$_pkgver_name-bootstrap-artifacts"
provider_priority=$_pkgver_prior
# directory creation
install -dm 755 \
"$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver \
"$subpkgdir"/usr/share/licenses
# extract arch-agnostic artifacts to artifacts dir for use by future dotnet builds
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner \
--exclude '*Intermediate*' \
--exclude '*alpine*'
}
zshcomp() {
depends=""
pkgdesc="zsh completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack zsh"
depends="dotnet-host"
install -dm 755 "$subpkgdir"/usr/share/zsh/site-functions
install -m 755 "$builddir"/src/sdk/scripts/register-completions.zsh "$subpkgdir"/usr/share/zsh/site-functions/_dotnet
}
bashcomp() {
depends=""
pkgdesc="bash completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack bash-completion"
depends="dotnet-host"
install -dm 755 "$subpkgdir"/usr/share/bash-completion/completions
install -m 755 "$builddir"/src/sdk/scripts/register-completions.bash "$subpkgdir"/usr/share/bash-completion/completions/_dotnet
}
doc() {
default_doc
pkgdesc="Docs for .NET"
# licenses
install -dm 755 "$subpkgdir"/usr/share/licenses/dotnet
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/usr/share/licenses/dotnet/ \
--no-same-owner \
./LICENSE.txt ./ThirdPartyNotices.txt
}
sha512sums="
3adb3cfe451e04c56265306869c3023c281322510d6e0eb182f233e549bdd4b9c738f41bb60470fce09cc386be4d1ea47d78846842f35e4bd9047b04bef16286 dotnet-v7.0.104.tar.xz
81428356e4b9691c54cacd242368a42d3939732918a608c2a5ae3f23fff45af2d9e981ead70a977f34f4e498c422f708e523bfbbf590cfdafb5c16ef1f0fed8a dotnet-testsuite-16c3c04f3ae6620a474fa0474e8b298190e506c1.tar.gz
0028d5d97b814b122d73137b4e0d64ca5d788aa0ae5fde500de722e23522827f2538f06e75acb17cc39b8917961ee78d1f0bbc84b2b624ae0e9bf88adca2ba6f dotnet-bunny-v12.tar.gz
ebab0364deab5d99131e2724b7fbac668bc27ddf74958623af1913e49850df98b2d077d27324b2bbabbbcdf77ea48bf7a7ca83d0ced6f48bdb66cc1e8bbce4a4 build_disable-source-link.patch
86fbaa058f78bba100f534f4c4bd6d7254181909f70d264c0390d3dd89c878a14ba9b5d2de05271b2c07b73ead70e029488c926221f676d59e27e387e3e579e9 build_enable-timestamps.patch
0049b27fad32f35ee99ef620aeee518600c24bde28c7a146261c7ae4313d747f3bdbe3e8b74a3154e025a80d5c62d545aa226c20c9376599e11091a31390abe6 build_shutdown-build-servers-at-each-build-step.patch
941b430b55e323f723bbc5160447f060f40d18ce32e5803ab7dda16bfc60a0f5ec1dccd246e68475d7115ee265a9433824d8a5d997c302531311194a90deeca9 check_rid-alpine-generation.diff
4ac92d2d9190a55ee20d3e145a28a6953c98d3eb838c8acfb808b8839316443cb64da4a2c5787df0171fce7ef96ff6381043085ed90c23ec09ce9ac81571e675 roslyn-analyzer_disable-apphost.patch
7a3291a05c94986d631a37870f573aca8603e9464cb632b3e5b93eca8a358fc7dcc98a8a8017f566885ceafe462bec734b7d31c7a974270e83c6d2ae54f51902 runtime_76500-mono-musl-support.patch
1f7be536c4826638853f110ee88bbd554be015cc88c6491c1066830789be18ad324f8ed2b1b75ed7aad74457dcafc812730059cb25d36d6344bfae8a517c00c4 runtime_enable-runtime-marshalling.diff
293742ab307bef459a21deadcc4ad7c7996cc4b490910a36c2763b8ad25cc8a91c4e03b6290567cd1030f69638d0156c5b6970887858fb091f8482b67356065d runtime_enable-system-libunwind.diff
d732df247c721c9f677baabdd7f36dbf4b564814ff64164361065bb1c196b767494a1d39f634eadf01a23032c7b3e64102614b7213065c81096bbf3f8022e6a0 runtime_mono-thread-coop-undefine-fortify-source.patch
d1b4ebcbb1a6815fc0ce4c471485c232618e60968a879309fb8336821a9351d2e0028d9f7726c0c041c750b497a0baa47400c78c9ceff550b91b4a6c2816fc41 sdk_14239-add-zsh-compdef-completion-script.patch
"

View file

@ -0,0 +1,145 @@
# dotnet7-build
This is the .NET 7.0 package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
# Building info
## Generated packages
* `dotnet7-build` (aimed for internal use as bootstrap)
* `dotnet7-build-artifacts` (aimed for internal use as bootstrap)
* `dotnet7-sdk`
* `dotnet7-templates` (required by sdk)
* `dotnet-zsh-completion`
* `dotnet-bash-completion`
* `dotnet-doc`
* `netstandard21-targeting-pack`
## How to build dotnet7 on Alpine
As dotnet is a self-hosting compiler (thus it compiles using itself), it
requires a bootstrap for the initial build. To solve this problem, this package
follows the `stage0` proposal outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E)
The goal of `stage0` is to bootstrap dotnet with as little intervention as
possible, thus allowing seamless Alpine upgrades. Unfortunately, upstream only
builds bootstraps for Alpine on `x86_64`, `aarch64`, and `armv7`. Thus, `stage0`
has also been designed to be crossbuild aware, allowing bootstrapping to other
platforms.
In summary, dotnet7 is built using three different aports.
* `community/dotnet7-stage0`
Builds minimum components for full build of dotnet7, and packages these in an initial
`dotnet7-stage0-bootstrap` package that `dotnet7-build` pulls.
* `community/dotnet7-build`
Builds full and packages dotnet7 fully using either stage0 or previoulsy built
dotnet7 build.
* `community/dotnet7-runtime`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet7-build.
## Crossbuilding with `stage0`
Crossbuilding `stage0` is a three step process:
1. Build sysroot for target platform by using `scripts/bootstrap.sh` in aports repo:
```
./bootstrap.sh $CTARGET_ARCH
```
2. Although not necessary, it is recommended to add Alpine repositories to
`$HOME/sysroot-$CTARGET_ARCH/etc/apk/repositories`, making sure to add required
keys. This makes it so that whatever package is not built in step 1 will
be pulled from package repos
3. Crossbuild `dotnet7-stage0` via:
```
CHOST=$CTARGET_ARCH abuild -r
```
# Specification
This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging),
with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`).
In addition, the package is named `dotnet7` as opposed to `dotnet-7.0`
to match Alpine Linux naming conventions for packages with many installable versions
# Contributing
The steps below are for the final package. Please only contribute to a
pre-release version if you know what you are doing. Original instructions
follow.
## General Changes
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet7-build`
3. Make your changes. Don't forget to add a changelog.
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally.
6. Commit the changes to the git repo in a git branch
- `git checkout -b dotnet7/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet7-build: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
8. Once the tests in the merge-request pass, and reviewers are happy, your changes
will be merged.
## Updating to an new upstream release
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet7-build`
3. Build the new upstream source tarball. Update the versions in the
APKBUILD file, and then create a snapshot. After build, update checksum.
- `abuild snapshot`
- `abuild checksum`
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally. Any
patches that are needed at this point should be added to the APKBUILD file
in `_patches` variable.
6. Upload the source archive to a remote location, and update `source` variable.
7. Commit the changes to the git repo in a git branch.
- `git checkout -b dotnet7/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet7-build: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.
9. Once the tests in the merge-request pass, and reviewers are happy, your changes
will be merged.
# Testing
This package uses CI tests as defined in `check()` function. Creating a
merge-request or running a build will fire off tests and flag any issues.
The tests themselves are contained in this external repository:
https://github.com/redhat-developer/dotnet-regular-tests/

View file

@ -0,0 +1,20 @@
From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 1 Oct 2022 09:21:58 -0400
Subject: [PATCH] Disable source link
Addresses undiagnosed "Source control information is not available" error
---
diff --git a/repos/installer.proj b/repos/installer.proj
index 3a9756a27b7..4968184b14e 100644
--- a/repos/installer.proj
+++ b/repos/installer.proj
@@ -26,6 +26,7 @@
-->
<BuildCommandArgs>$(BuildCommandArgs) /p:NETCoreAppMaximumVersion=99.9</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:OSName=$(OSNameOverride)</BuildCommandArgs>
+ <BuildCommandArgs>$(BuildCommandArgs) /p:EnableSourceLink=false</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:PortableOSName=$(PortableOS)</BuildCommandArgs>
<BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir)</BuildCommandArgs>

View file

@ -0,0 +1,40 @@
diff --git a/repos/Directory.Build.props b/repos/Directory.Build.props
index b70a3161fef..d57f9393299 100644
--- a/repos/Directory.Build.props
+++ b/repos/Directory.Build.props
@@ -134,6 +134,7 @@
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) $(FlagParameterPrefix)pack</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) $(FlagParameterPrefix)publish</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) -bl</StandardSourceBuildArgs>
+ <StandardSourceBuildArgs>$(StandardSourceBuildArgs) /consoleLoggerParameters:ShowTimestamp</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) /p:ArcadeBuildFromSource=true</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) /p:CopyWipIntoInnerSourceBuildRepo=true</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) /p:DotNetBuildOffline=true</StandardSourceBuildArgs>
diff --git a/src/fsharp/eng/build.sh b/src/fsharp/eng/build.sh
index fff8414b3ef..d470fc6ed56 100755
--- a/src/fsharp/eng/build.sh
+++ b/src/fsharp/eng/build.sh
@@ -144,7 +144,7 @@ while [[ $# > 0 ]]; do
--sourcebuild)
source_build=true
;;
- /p:*)
+ /*)
properties="$properties $1"
;;
*)
diff --git a/src/roslyn/eng/build.sh b/src/roslyn/eng/build.sh
index a08cbea099d..d3ec235732f 100755
--- a/src/roslyn/eng/build.sh
+++ b/src/roslyn/eng/build.sh
@@ -167,7 +167,7 @@ while [[ $# > 0 ]]; do
args="$args $1"
shift
;;
- /p:*)
+ /*)
properties="$properties $1"
;;
*)

View file

@ -0,0 +1,13 @@
diff --git a/repos/Directory.Build.targets.orig b/repos/Directory.Build.targets
index 9a61647b4d5..115cd213641 100644
--- a/repos/Directory.Build.targets.orig
+++ b/repos/Directory.Build.targets
@@ -376,6 +376,7 @@
DependsOnTargets="BuildRepoReferences"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(RepoCompletedSemaphorePath)Build.complete">
+ <Exec Command="$(DotnetToolCommand) build-server shutdown" />
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Building $(ProjectBuildReason)" />
<Message Importance="High" Text="Running command:" />
<Message Importance="High" Text=" $(BuildCommand) $(RepoApiArgs)" Condition="'$(BuildCommand)' != ''" />

View file

@ -0,0 +1,42 @@
From 5bbd0366f3caa6281fbafb49882a226453371b6a Mon Sep 17 00:00:00 2001
From: Antoine Martin (ayakael) <dev@ayakael.net>
Date: Wed, 10 Aug 2022 00:57:30 +0000
Subject: [PATCH 1/1] fix-runtme-id
General fix for RID normalisation in testing suite
---
runtime-id | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/runtime-id b/runtime-id
index 5673bba..7369776 100755
--- a/runtime-id
+++ b/runtime-id
@@ -44,12 +44,15 @@ if [[ ${portable_rid} == 1 ]]; then
echo "linux-${arch}"
fi
else
- case "${ID}" in
- # Remove the minor version
- alpine|ol|rhel|rocky) rid_version=${VERSION_ID%.*} ;;
-
- *) rid_version=${VERSION_ID} ;;
- esac
-
- echo "${ID}.${rid_version}-${arch}"
+ VERSION_ID_DOT="${VERSION_ID//[^.]}"
+ while [[ ${#VERSION_ID_DOT} -gt 1 ]]; do
+ VERSION_ID="${VERSION_ID%.*}"
+ VERSION_ID_DOT="${VERSION_ID//[^.]}"
+ done
+ VERSION_ID_DASH="${VERSION_ID//[^_]}"
+ while [[ ${#VERSION_ID_DASH} -ge 1 ]]; do
+ VERSION_ID="${VERSION_ID%_*}"
+ VERSION_ID_DASH="${VERSION_ID//[^_]}"
+ done
+ echo "${ID}.${VERSION_ID}-${arch}"
fi
--
2.37.1

View file

@ -0,0 +1,28 @@
From 79f02a53316f90543d60269d7c06727c376f423b Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Wed, 24 Aug 2022 18:41:08 +0000
Subject: [PATCH 1/1] disable apphost usage
Roslyn-analyzer can't seem to find apphost produced by runtime build on ppc64le
This disables its use as it isn't necessary
---
diff --git a/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj b/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj
index 044a2aba46..3d37e147b3 100644
--- a/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj
+++ b/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj
@@ -15,6 +15,7 @@
<Configuration>Release</Configuration>
<IsPackable>false</IsPackable>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
+ <UseAppHost>false</UseAppHost>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetVersion)" />
@@ -27,4 +28,4 @@
<ProjectReference Include="..\Utilities\CSharp\CSharpPerfUtilities.csproj" />
<ProjectReference Include="..\Utilities\VisualBasic\VisualBasicPerfUtilities.csproj" />
</ItemGroup>
-</Project>
\ No newline at end of file
+</Project>

View file

@ -0,0 +1,326 @@
From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/pull/76500
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 1 Oct 2022 09:21:58 -0400
Subject: [PATCH] Mono musl support
---
Directory.Build.props | 1 +
eng/common/cross/toolchain.cmake | 38 +++++++++++++++++++-----
eng/native/configurecompiler.cmake | 7 +++++
eng/native/tryrun.cmake | 6 +++-
src/coreclr/pal/src/CMakeLists.txt | 5 ++++
src/coreclr/pal/src/misc/perfjitdump.cpp | 2 +-
src/coreclr/vm/i386/cgenx86.cpp | 4 +++
src/mono/CMakeLists.txt | 33 ++++++++++++++++++++
src/mono/mono.proj | 32 +++++++++++++-------
src/mono/mono/mini/mini-runtime.c | 29 ++++++++++++++++++
src/mono/mono/utils/mono-context.h | 8 +++++
11 files changed, 146 insertions(+), 19 deletions(-)
diff --git a/src/runtime/Directory.Build.props b/src/runtime/Directory.Build.props
index 6f9b97c0a9c..4298a6df1d3 100644
--- a/src/runtime/Directory.Build.props
+++ b/src/runtime/Directory.Build.props
@@ -22,7 +22,6 @@
<TargetOS Condition="'$(TargetOS)' == ''">$(_hostOS)</TargetOS>
<TargetsMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'Browser'">true</TargetsMobile>
<TargetsAppleMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'">true</TargetsAppleMobile>
- <TargetsLinuxBionic Condition="$(OutputRid.StartsWith('linux-bionic'))">true</TargetsLinuxBionic>
</PropertyGroup>
<!-- Platform property is required by RepoLayout.props in Arcade SDK. -->
@@ -154,7 +154,7 @@
<_runtimeOS Condition="'$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant())</_runtimeOS>
<_portableOS>linux</_portableOS>
- <_portableOS Condition="'$(_runtimeOS)' == 'linux-musl'">linux-musl</_portableOS>
+ <_portableOS Condition="'$(_runtimeOS)' == 'linux-musl' or $(_runtimeOS.StartsWith('alpine'))">linux-musl</_portableOS>
<_portableOS Condition="'$(_runtimeOS)' == 'linux-bionic'">linux-bionic</_portableOS>
<_portableOS Condition="'$(_hostOS)' == 'OSX'">osx</_portableOS>
<_portableOS Condition="'$(_runtimeOS)' == 'win' or '$(TargetOS)' == 'windows'">win</_portableOS>
@@ -200,6 +199,9 @@
<OutputRid Condition="'$(OutputRid)' == ''">$(PackageRID)</OutputRid>
<OutputRid Condition="'$(PortableBuild)' == 'true'">$(_portableOS)-$(TargetArchitecture)</OutputRid>
+
+ <TargetsLinuxBionic Condition="$(OutputRid.StartsWith('linux-bionic'))">true</TargetsLinuxBionic>
+ <TargetsLinuxMusl Condition="'$(_portableOS)' == 'linux-musl'">true</TargetsLinuxMusl>
</PropertyGroup>
<PropertyGroup Label="CalculateTargetOSName" Condition="'$(SkipInferTargetOSName)' != 'true'">
diff --git a/src/runtime/eng/native/tryrun.cmake b/src/runtime/eng/native/tryrun.cmake
index 6355b0988f7..056c6606b17 100644
--- a/src/runtime/eng/native/tryrun.cmake
+++ b/src/runtime/eng/native/tryrun.cmake
@@ -8,7 +8,11 @@ endmacro()
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf OR
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf OR
- EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl)
+ EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl OR
+ EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/s390x-alpine-linux-musl OR
+ EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/ppc64le-alpine-linux-musl OR
+ EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl OR
+ EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/riscv64-alpine-linux-musl)
set(ALPINE_LINUX 1)
elseif(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version)
diff --git a/src/runtime/src/coreclr/pal/src/CMakeLists.txt b/src/runtime/src/coreclr/pal/src/CMakeLists.txt
index d9726460ccf..c28563f8619 100644
--- a/src/runtime/src/coreclr/pal/src/CMakeLists.txt
+++ b/src/runtime/src/coreclr/pal/src/CMakeLists.txt
@@ -315,6 +315,11 @@ if(CLR_CMAKE_TARGET_LINUX)
target_link_libraries(coreclrpal ${UNWIND_LIBS})
endif(CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
+ # bundled libunwind requires using libucontext on alpine and x86 and ppc64le
+ if(CLR_CMAKE_TARGET_ALPINE_LINUX AND (CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_POWERPC64))
+ target_link_libraries(coreclrpal ucontext)
+ endif(CLR_CMAKE_TARGET_ALPINE_LINUX AND (CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_POWERPC64))
+
endif(CLR_CMAKE_TARGET_LINUX)
if(CLR_CMAKE_TARGET_NETBSD)
diff --git a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp
index 8d7f79ed3f0..043939ad2da 100644
--- a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp
+++ b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp
@@ -25,7 +25,7 @@
#include <sys/uio.h>
#include <time.h>
#include <unistd.h>
-#include <linux/limits.h>
+#include <limits.h>
#include "../inc/llvm/ELF.h"
diff --git a/src/runtime/src/coreclr/vm/i386/cgenx86.cpp b/src/runtime/src/coreclr/vm/i386/cgenx86.cpp
index 811c84a140d..4e958a44b30 100644
--- a/src/runtime/src/coreclr/vm/i386/cgenx86.cpp
+++ b/src/runtime/src/coreclr/vm/i386/cgenx86.cpp
@@ -1133,6 +1133,7 @@ extern "C" DWORD __stdcall avx512StateSupport()
#else // !TARGET_UNIX
+#if !__has_builtin(__cpuid)
void __cpuid(int cpuInfo[4], int function_id)
{
// Based on the Clang implementation provided in cpuid.h:
@@ -1143,7 +1144,9 @@ void __cpuid(int cpuInfo[4], int function_id)
: "0"(function_id)
);
}
+#endif
+#if !__has_builtin(__cpuidex)
void __cpuidex(int cpuInfo[4], int function_id, int subFunction_id)
{
// Based on the Clang implementation provided in cpuid.h:
@@ -1154,6 +1157,7 @@ void __cpuidex(int cpuInfo[4], int function_id, int subFunction_id)
: "0"(function_id), "2"(subFunction_id)
);
}
+#endif
extern "C" DWORD __stdcall xmmYmmStateSupport()
{
diff --git a/src/runtime/src/mono/CMakeLists.txt b/src/runtime/src/mono/CMakeLists.txt
index cdff32677c0..08a82cd7e83 100644
--- a/src/runtime/src/mono/CMakeLists.txt
+++ b/src/runtime/src/mono/CMakeLists.txt
@@ -216,6 +216,35 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Enable the "full RELRO" options (RELRO & BIND_NOW) at link time
add_link_options(-Wl,-z,relro)
add_link_options(-Wl,-z,now)
+ # Detect Linux ID
+ # TODO: Eventually merge with eng/native/configureplatform.cmake
+ set(LINUX_ID_FILE "/etc/os-release")
+ if(CMAKE_CROSSCOMPILING)
+ set(LINUX_ID_FILE "${CMAKE_SYSROOT}${LINUX_ID_FILE}")
+ endif()
+
+ if(EXISTS ${LINUX_ID_FILE})
+ execute_process(
+ COMMAND bash -c "source ${LINUX_ID_FILE} && echo \$ID"
+ OUTPUT_VARIABLE CLR_CMAKE_LINUX_ID
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND bash -c "if strings \"${CMAKE_SYSROOT}/usr/bin/ldd\" 2>&1 | grep -q musl; then echo musl; fi"
+ OUTPUT_VARIABLE CLR_CMAKE_LINUX_MUSL
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif()
+
+ if(DEFINED CLR_CMAKE_LINUX_ID)
+ if(CLR_CMAKE_LINUX_ID STREQUAL alpine)
+ set(CLR_CMAKE_HOST_ALPINE_LINUX 1)
+ set(CLR_CMAKE_HOST_OS ${CLR_CMAKE_LINUX_ID})
+ endif()
+
+ if(CLR_CMAKE_LINUX_MUSL STREQUAL musl)
+ set(CLR_CMAKE_HOST_LINUX_MUSL 1)
+ endif()
+ endif(DEFINED CLR_CMAKE_LINUX_ID)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(HOST_LINUX 1)
add_definitions(-D_GNU_SOURCE -D_REENTRANT)
@@ -893,6 +922,12 @@ if(HOST_IOS OR HOST_ANDROID OR HOST_MACCAT)
else()
set(DISABLE_DLLMAP 1)
endif()
+
+if(CLR_CMAKE_HOST_ALPINE_LINUX)
+ # On Alpine Linux, we need to ensure that the reported stack range for the primary thread is
+ # larger than the initial committed stack size.
+ add_definitions(-DENSURE_PRIMARY_STACK_SIZE)
+endif()
### End of OS specific checks
include_directories("${CLR_SRC_NATIVE_DIR}")
diff --git a/src/runtime/src/mono/mono.proj b/src/runtime/src/mono/mono.proj
index 59fea4a2f72..5bac7fdf1c6 100644
--- a/src/runtime/src/mono/mono.proj
+++ b/src/runtime/src/mono/mono.proj
@@ -554,19 +560,21 @@
<MonoToolchainPrebuiltOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">darwin-x86_64</MonoToolchainPrebuiltOS>
<MonoToolchainPrebuiltOS Condition="'$(HostOS)' == 'windows'">windows-x86_64</MonoToolchainPrebuiltOS>
<_MonoRuntimeFilePath>$(MonoObjDir)out\lib\$(MonoFileName)</_MonoRuntimeFilePath>
- <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">gnu</_LinuxAbi>
- <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">android</_LinuxAbi>
+ <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true' and '$(TargetsLinuxMusl)' != 'true'">linux-gnu</_LinuxAbi>
+ <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true' and '$(TargetsLinuxMusl)' == 'true'">alpine-linux-musl</_LinuxAbi>
+ <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">linux-android</_LinuxAbi>
<_LinuxFloatAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">hf</_LinuxFloatAbi>
<_Objcopy>objcopy</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'arm'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'armv6'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'arm64'">aarch64-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'riscv64'">riscv64-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 's390x'">s390x-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'ppc64le'">powerpc64le-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'x64'">x86_64-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
- <_Objcopy Condition="'$(Platform)' == 'x86'">i686-linux-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'arm'">arm-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'armv6'">arm-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'arm64'">aarch64-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'riscv64'">riscv64-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 's390x'">s390x-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'ppc64le'">powerpc64le-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'x64'">x86_64-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
+ <_Objcopy Condition="'$(Platform)' == 'x86'">i686-$(_LinuxAbi)-$(_Objcopy)</_Objcopy>
<_Objcopy Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/bin/llvm-objcopy</_Objcopy>
+ <_Objcopy Condition="'$(TargetsLinuxMusl)' == 'true' and '$(CrossBuild)' != 'true'">objcopy</_Objcopy>
<_ObjcopyPrefix Condition="'$(MonoCrossDir)' != '' and '$(Platform)' == 'riscv64'">llvm-objcopy-</_ObjcopyPrefix>
</PropertyGroup>
diff --git a/src/runtime/src/mono/mono/mini/CMakeLists.txt b/src/runtime/src/mono/mono/mini/CMakeLists.txt
index 30df4bac1f7..8698fd81206 100644
--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt
+++ b/src/runtime/src/mono/mono/mini/CMakeLists.txt
@@ -368,6 +368,11 @@ if(NOT DISABLE_SHARED_LIBS)
target_sources(monosgen-shared PRIVATE $<TARGET_OBJECTS:eglib_objects>)
set_target_properties(monosgen-shared PROPERTIES OUTPUT_NAME ${MONO_SHARED_LIB_NAME})
target_link_libraries (monosgen-shared PRIVATE monoapi)
+ # Alpine Linux implements ucontext in a different library
+ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ target_link_libraries(monosgen-shared PRIVATE ucontext)
+ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+
target_include_directories (monosgen-shared PRIVATE monoapi)
if(TARGET_WIN32)
# on Windows the import library for the shared mono library will have the same name as the static library,
@@ -527,6 +532,10 @@ if(NOT DISABLE_EXECUTABLES)
set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross)
endif()
target_link_libraries(mono-sgen PRIVATE monoapi monosgen-static ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS})
+ # Alpine Linux implements ucontext in a different library
+ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
+ target_link_libraries(mono-sgen PRIVATE ucontext)
+ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X)
if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS)
# if components are built statically, link them into runtime.
target_sources(mono-sgen PRIVATE "${mono-components-objects}")
diff --git a/src/runtime/src/mono/mono/mini/mini-runtime.c b/src/runtime/src/mono/mono/mini/mini-runtime.c
index c481f69adc8..4db6c9a0ae7 100644
--- a/src/runtime/src/mono/mono/mini/mini-runtime.c
+++ b/src/runtime/src/mono/mono/mini/mini-runtime.c
@@ -4383,6 +4383,30 @@ mini_llvm_init (void)
#endif
}
+#ifdef ENSURE_PRIMARY_STACK_SIZE
+/*++
+ Function:
+ EnsureStackSize
+
+ Abstract:
+ This fixes a problem on MUSL where the initial stack size reported by the
+ pthread_attr_getstack is about 128kB, but this limit is not fixed and
+ the stack can grow dynamically. The problem is that it makes the
+ functions ReflectionInvocation::[Try]EnsureSufficientExecutionStack
+ to fail for real life scenarios like e.g. compilation of corefx.
+ Since there is no real fixed limit for the stack, the code below
+ ensures moving the stack limit to a value that makes reasonable
+ real life scenarios work.
+
+ --*/
+static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE void
+ensure_stack_size (size_t size)
+{
+ volatile uint8_t *s = (uint8_t *)g_alloca(size);
+ *s = 0;
+}
+#endif // ENSURE_PRIMARY_STACK_SIZE
+
void
mini_add_profiler_argument (const char *desc)
{
@@ -4544,6 +4568,11 @@ mini_init (const char *filename)
mono_w32handle_init ();
#endif
+#ifdef ENSURE_PRIMARY_STACK_SIZE
+ // TODO: https://github.com/dotnet/runtime/issues/72920
+ ensure_stack_size (5 * 1024 * 1024);
+#endif // ENSURE_PRIMARY_STACK_SIZE
+
mono_thread_info_runtime_init (&ticallbacks);
if (g_hasenv ("MONO_DEBUG")) {
diff --git a/src/runtime/src/mono/mono/utils/mono-context.h b/src/runtime/src/mono/mono/utils/mono-context.h
index a1f0fe6f68e..a9db2d336ca 100644
--- a/src/runtime/src/mono/mono/utils/mono-context.h
+++ b/src/runtime/src/mono/mono/utils/mono-context.h
@@ -11,6 +11,14 @@
#ifndef __MONO_MONO_CONTEXT_H__
#define __MONO_MONO_CONTEXT_H__
+/*
+ * Handle non-gnu libc versions with nothing in features.h
+ * We have no idea what they're compatible with, so always fail.
+ */
+#ifndef __GLIBC_PREREQ
+# define __GLIBC_PREREQ(x,y) 0
+#endif
+
#include "mono-compiler.h"
#include "mono-sigcontext.h"
#include "mono-machine.h"
diff --git a/src/runtime/src/native/libs/System.Native/pal_io.c b/src/runtime/src/native/libs/System.Native/pal_io.c
index 0929a0b49ec..86311e19507 100644
--- a/src/runtime/src/native/libs/System.Native/pal_io.c
+++ b/src/runtime/src/native/libs/System.Native/pal_io.c
@@ -1267,7 +1267,7 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd, int64_t
// Try copying data using a copy-on-write clone. This shares storage between the files.
if (sourceLength != 0)
{
- while ((ret = ioctl(outFd, FICLONE, inFd)) < 0 && errno == EINTR);
+ while ((ret = ioctl(outFd, (int)FICLONE, inFd)) < 0 && errno == EINTR);
copied = ret == 0;
}
#endif
--
2.36.3

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
diff --git a/src/runtime/eng/SourceBuild.props b/src/runtime/eng/SourceBuild.props
index 32e6d9c0ba..8e2a7f9931 100644
--- a/src/runtime/eng/SourceBuild.props
+++ b/src/runtime/eng/SourceBuild.props
@@ -51,6 +51,7 @@
<InnerBuildArgs>$(InnerBuildArgs) /p:DisableSourceLink=false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) /p:PrimaryRuntimeFlavor=Mono /p:RuntimeFlavor=Mono</InnerBuildArgs>
+ <InnerBuildArgs>$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</InnerBuildArgs>
</PropertyGroup>
</Target>

View file

@ -0,0 +1,25 @@
From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/issues/82269
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 1 Oct 2022 09:21:58 -0400
Subject: [PATCH] Undefine fortify-source on mono-thread-coop
When _FORTIFY_SOURCE=2, there is a bug relating to memcpy that expresses itself.
See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/14105. Alpine Linux
now sets this by default since https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/43463,
which makes mono-flavored runtime dump its core. This patch offers a workaround
by undefining _FORTIFY_SOURCE in the problematic file.
---
diff --git a/src/runtime/src/mono/mono/utils/mono-threads-coop.c b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
index 4ed659d6605..34bb5785fba 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads-coop.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
@@ -15,6 +15,7 @@
#ifdef TARGET_MACH
#define _DARWIN_C_SOURCE
#endif
+#undef _FORTIFY_SOURCE
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-threads.h>

View file

@ -0,0 +1,35 @@
From 4c74721e1f5da9642adab03075dda2f55719ac7b Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/sdk/pull/14239
From: Esgariot <esgariot@icloud.com>
Date: Mon, 19 Oct 2020 23:42:37 +0200
Subject: [PATCH 1/1] Add zsh compdef completion script.
Continuing off of PR 13384 in upstream.
This commit is ready to be rebased to include appropriate co-authors
before merging PR.
---
scripts/register-completions.zsh | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/sdk/scripts/register-completions.zsh b/src/sdk/scripts/register-completions.zsh
index 8eebe9a867..faa32fef71 100644
--- a/src/sdk/scripts/register-completions.zsh
+++ b/src/sdk/scripts/register-completions.zsh
@@ -1,10 +1,3 @@
-# zsh parameter completion for the dotnet CLI
-
-_dotnet_zsh_complete()
-{
- local completions=("$(dotnet complete "$words")")
-
- reply=( "${(ps:\n:)completions}" )
-}
-
-compctl -K _dotnet_zsh_complete dotnet
+#compdef dotnet
+local completions=("$(dotnet complete "$words")")
+[[ -n "$completions" ]] && compadd -- "${(ps:\n:)completions}"
--
2.34.1

View file

@ -0,0 +1,128 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# secfixes:
# 7.0.3-r0:
# - CVE-2023-21808
pkgname=dotnet7-runtime
pkgver=7.0.4
_bldver=7.0.104-r0
pkgrel=0
# Following for dotnet build version 6.0 and up
_pkgver_macro=${pkgver%.*}
_pkgver_name=${_pkgver_macro//[.0]}
_bldver_ver=${_bldver%%-*}
pkgdesc="The .NET $_pkgver_macro Core runtime"
# x86: blocked by https://github.com/dotnet/runtime/issues/77667
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663
# riscv64: port WIP https://github.com/dotnet/runtime/issues/36748
arch="all !x86 !armhf !riscv64"
url=https://dotnet.microsoft.com
license="MIT"
depends="
dotnet$_pkgver_name-hostfxr
icu-data-full
icu-libs
"
makedepends="dotnet$_pkgver_name-build=$_bldver"
subpackages="
aspnetcore$_pkgver_name-runtime:aspnetcore_runtime:noarch
aspnetcore$_pkgver_name-targeting-pack:aspnetcore_targeting_pack:noarch
dotnet$_pkgver_name-apphost-pack:apphost_pack
dotnet$_pkgver_name-hostfxr
dotnet$_pkgver_name-targeting-pack:targeting_pack:noarch
dotnet-host:host
"
provides="dotnet$_pkgver_name=$pkgver-r$pkgrel"
options="!check" # No test suite
source="dotnet.sh.in"
builddir="$srcdir"
_libdir="/usr/lib"
case $CARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7) _dotnet_arch="arm";;
armhf) _dotnet_arch="armv6";;
*) _dotnet_arch="$CARCH";;
esac
build() {
sed "s|%LIBDIR%|$_libdir/dotnet|" "$srcdir"/dotnet.sh.in > "$srcdir"/dotnet.sh
}
package() {
install -dm 755 "$pkgdir"/$_libdir/dotnet/shared
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/shared/Microsoft.NETCore.App "$pkgdir"/$_libdir/dotnet/shared/.
}
host() {
pkgdesc="A generic driver for the .NET Core Command Line Interface"
depends=""
install -dm 755 \
"$subpkgdir"/etc/profile.d \
"$subpkgdir"/etc/dotnet \
"$subpkgdir"/usr/bin \
"$subpkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/dotnet "$subpkgdir"/$_libdir/dotnet/.
ln -s $_libdir/dotnet/dotnet "$subpkgdir"/usr/bin/dotnet
echo "$_libdir/dotnet" > "$subpkgdir"/etc/dotnet/install_location
echo "$_libdir/dotnet" > "$subpkgdir"/etc/dotnet/install_location_$_dotnet_arch
install -Dm 644 "$srcdir"/dotnet.sh -t "$subpkgdir"/etc/profile.d/
}
hostfxr() {
pkgdesc="The .NET host resolver contains the logic to resolve and select the right version of the .NET SDK or runtime to use."
depends="dotnet-host"
provides="dotnet-hostfxr-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/host "$subpkgdir"/$_libdir/dotnet/.
}
aspnetcore_runtime() {
pkgdesc="The ASP.NET $_pkgver_macro Core runtime"
depends="dotnet$_pkgver_name-runtime"
provides="aspnetcore-runtime-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/shared
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/shared/Microsoft.AspNetCore.App "$subpkgdir"/$_libdir/dotnet/shared/.
}
apphost_pack() {
pkgdesc="The .NET $_pkgver_macro Core apphost pack"
provides="dotnet-apphost-pack-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.NETCore.App.Host.* "$subpkgdir"/$_libdir/dotnet/packs/.
}
targeting_pack() {
pkgdesc="The .NET $_pkgver_macro Core targeting pack"
provides="dotnet-targeting-pack-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.NETCore.App.Ref "$subpkgdir"/$_libdir/dotnet/packs/.
}
aspnetcore_targeting_pack() {
pkgdesc="The ASP.NET $_pkgver_macro Core targeting pack"
provides="aspnetcore-targeting-pack-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
cp -r $_libdir/dotnet/bootstrap/$_bldver_ver/packs/Microsoft.AspNetCore.App.Ref "$subpkgdir"/$_libdir/dotnet/packs/.
}
sha512sums="
c3f31956976b77198e72a3fef3427338b6b2961f8c121416040c1105de0ce8073e46f4c2e9ef22a001aee69cbe39621c2ddac988522693110071dfae42f2e2b7 dotnet.sh.in
"

View file

@ -0,0 +1,144 @@
# dotnet7-runtime
This is the .NET 7.0 package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
# Building info
## Generated packages
* `aspnetcore7-runtime`
* `aspnetcore7-targeting-pack`
* `dotnet7-apphost-pack` (used by dotnet7-runtime)
* `dotnet7-hostfxr` (used by dotnet-host)
* `dotnet7-runtime`
* `dotnet7-targeting-pack`
* `dotnet-host`
## How to build dotnet7 on Alpine
As dotnet is a self-hosting compiler (thus it compiles using itself), it
requires a bootstrap for the initial build. To solve this problem, this package
follows the `stage0` proposal outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E)
The goal of `stage0` is to bootstrap dotnet with as little intervention as
possible, thus allowing seamless Alpine upgrades. Unfortunately, upstream only
builds bootstraps for Alpine on `x86_64`, `aarch64`, and `armv7`. Thus, `stage0`
has also been designed to be crossbuild aware, allowing bootstrapping to other
platforms.
In summary, dotnet7 is built using three different aports.
* `community/dotnet7-stage0`
Builds minimum components for full build of dotnet7, and packages these in an initial
`dotnet7-stage0-bootstrap` package that `dotnet7-build` pulls.
* `community/dotnet7-build`
Builds full and packages dotnet7 fully using either stage0 or previoulsy built
dotnet7 build.
* `community/dotnet7-runtime`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet7-build.
## Crossbuilding with `stage0`
Crossbuilding `stage0` is a three step process:
1. Build sysroot for target platform by using `scripts/bootstrap.sh` in aports repo:
```
./bootstrap.sh $CTARGET_ARCH
```
2. Although not necessary, it is recommended to add Alpine repositories to
`$HOME/sysroot-$CTARGET_ARCH/etc/apk/repositories`, making sure to add required
keys. This makes it so that whatever package is not built in step 1 will
be pulled from package repos
3. Crossbuild `dotnet7-stage0` via:
```
CHOST=$CTARGET_ARCH abuild -r
```
# Specification
This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging),
with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`).
In addition, the package is named `dotnet7` as opposed to `dotnet-7.0`
to match Alpine Linux naming conventions for packages with many installable versions
# Contributing
The steps below are for the final package. Please only contribute to a
pre-release version if you know what you are doing. Original instructions
follow.
## General Changes
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet7-build`
3. Make your changes. Don't forget to add a changelog.
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally.
6. Commit the changes to the git repo in a git branch
- `git checkout -b dotnet7/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet7-build: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
8. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
## Updating to an new upstream release
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet7-build`
3. Build the new upstream source tarball. Update the versions in the
APKBUILD file, and then create a snapshot. After build, update checksum.
- `abuild snapshot`
- `abuild checksum`
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally. Any
patches that are needed at this point should be added to the APKBUILD file
in `_patches` variable.
6. Upload the source archive to a remote location, and update `source` variable.
7. Commit the changes to the git repo in a git branch.
- `git checkout -b dotnet7/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet7-build: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.
9. Once the tests in the pull-request pass, and reviewers are happy, your changes
will be merged.
# Testing
This package uses CI tests as defined in `check()` function. Creating a
merge-request or running a build will fire off tests and flag any issues.
The tests themselves are contained in this external repository:
https://github.com/redhat-developer/dotnet-regular-tests/

View file

@ -0,0 +1,12 @@
# Set location for AppHost lookup
[ -z "$DOTNET_ROOT" ] && export DOTNET_ROOT=%LIBDIR%
# Add dotnet tools directory to PATH
DOTNET_TOOLS_PATH="$HOME/.dotnet/tools"
case "$PATH" in
*"$DOTNET_TOOLS_PATH"* ) true ;;
* ) PATH="$PATH:$DOTNET_TOOLS_PATH" ;;
esac
# Extract self-contained executables under HOME to avoid multi-user issues from using the default '/var/tmp'
[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"$HOME"/.cache}/dotnet_bundle_extract"

514
user/dotnet8-build/APKBUILD Normal file
View file

@ -0,0 +1,514 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=dotnet8-build
pkgver=8.0.100_pre3
pkgrel=0
_gittag=v8.0.100-preview.3.23178.7
_giturl="https://github.com/dotnet/dotnet"
_testtag=e1cc0f181ffd4d755756d30d985513897d592ba4
_bunnytag=v12
_stage0ver=8.0.100_pre3-r0
_patches="
build_enable-timestamps.patch
roslyn-analyzer_disable-apphost.patch
runtime_79856-save-errno-when-using-posix-semaphores.patch
runtime_82269-mono-thread-coop-undefine-fortify-source.patch
runtime_84413-support-adding-rids-with-dash-in-base-part.patch
runtime_enable-system-libunwind.diff
runtime_more-clang-16-suppression.patch
runtime_remove-usage-of-off64-t.patch
sdk_14239-add-zsh-compdef-completion-script.patch
"
_pkgver_macro=${pkgver%.*}
_pkgver_prior=${pkgver%.*.*}
_pkgver_name=${_pkgver_macro//[.0]}
pkgdesc="The .NET $_pkgver_macro bootstrap"
# x86: blocked by https://github.com/dotnet/runtime/issues/77667
# armhf: blocked by https://github.com/dotnet/runtime/issues/77663
# riscv64: port WIP https://github.com/dotnet/runtime/issues/36748
arch="all !x86 !armhf !riscv64"
url=https://dotnet.microsoft.com
license="MIT"
# hack for dotnetx-build to be able to pull itself for bootstrapping
provides="dotnet$_pkgver_name-bootstrap"
provider_priority=$_pkgver_prior
checkdepends="
babeltrace
binutils
coreutils
file
gawk
jq
lttng-tools
npm
procps
sed
strace
util-linux-misc
which
"
# For now package is not tested to build on itself
# To test: replace 'dotnet-stage0-bootstrap' with 'dotnet-bootstrap'
# and 'dotnet-stage0-artifacts' with 'dotnet-bootstrap-artifacts'
makedepends="
bash
clang
cmake
dotnet$_pkgver_name-stage0-bootstrap=$_stage0ver
dotnet$_pkgver_name-stage0-artifacts=$_stage0ver
dotnet$_pkgver_name-stage0=$_stage0ver
findutils
git
grep
icu-data-full
icu-dev
inetutils-syslogd
krb5-dev
libgit2-dev
libintl
libucontext-dev
libunwind-dev
libxml2-dev
libxml2-utils
linux-headers
lldb-dev
llvm-dev
lttng-ust-dev
nodejs
numactl-dev
openssl-dev
pigz
rsync
samurai
tar
xz
zlib-dev
"
case $CARCH in
s390x|x86) ;;
*) makedepends="$makedepends lld-dev";;
esac
subpackages="
dotnet$_pkgver_name-artifacts:artifacts:noarch
dotnet$_pkgver_name-sdk
dotnet$_pkgver_name-templates:templates:noarch
dotnet-zsh-completion:zshcomp:noarch
dotnet-bash-completion:bashcomp:noarch
dotnet-doc
netstandard21-targeting-pack:netstandard_targeting_pack:noarch
"
source="
https://lab.ilot.io/dotnet/dotnet/-/releases/$_gittag/downloads/tarball/dotnet-$_gittag.tar.xz
dotnet-testsuite-$_testtag.tar.gz::https://github.com/redhat-developer/dotnet-regular-tests/archive/$_testtag.tar.gz
dotnet-bunny-$_bunnytag.tar.gz::https://github.com/redhat-developer/dotnet-bunny/archive/$_bunnytag.tar.gz
$_patches
"
builddir="$srcdir"/dotnet-$_gittag
_checkdir="$srcdir"/dotnet-bunny-${_bunnytag/v}
_testdir="$srcdir"/dotnet-regular-tests-$_testtag
_cli_root="$srcdir"/bootstrap
_libdir="/usr/lib"
# if true, then within pipeline environment, in which case send logs there
# to be scooped
if [ -d "$APORTSDIR/logs" ]; then
_logdir="$APORTSDIR"/logs/$pkgname
else
_logdir="$srcdir"/logs
fi
case $CARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7) _dotnet_arch="arm";;
armhf) _dotnet_arch="armv6";;
*) _dotnet_arch="$CARCH";;
esac
# Build doesn't set all the right executable bits for the right file types
_fix_executable() {
# add executable bit
find "$1" -type f \( \
-name 'apphost' -o \
-name 'singlefilehost' -o \
-name 'lib*so' \
\) \
-exec chmod +x '{}' \;
# remove executable bit
find "$1" -type f \( \
-name '*.a' -o \
-name '*.dll' -o \
-name '*.h' -o \
-name '*.json' -o \
-name '*.pdb' -o \
-name '*.props' -o \
-name '*.pubxml' -o \
-name '*.targets' -o \
-name '*.txt' -o \
-name '*.xml' \
\) \
-exec chmod -x '{}' \;
}
# generates tarball containing all components built by dotnet
snapshot() {
local _pkg="$srcdir"/${builddir##*/}.tar
ulimit -n 4096
if [ -d "$srcdir" ]; then
cd "$srcdir"
else
mkdir -p "$srcdir" && cd "$srcdir"
fi
if [ -d "installer" ]; then
cd "$srcdir"/installer
else
git clone $_giturl --branch $_gittag && cd "$srcdir"/installer
fi
sed 's|<Exec Command="tar.*|<Exec Command="tar -cf $(TarballFilePath) -C $(TarballDir)/.. $([MSBuild]::MakeRelative($([System.IO.Path]::GetDirectoryName($(TarballDir))), $(TarballDir)))" />|' -i src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets
if [ -d "$_libdir/dotnet/bootstrap" ]; then
local _cli_root="$(find $_libdir/dotnet/bootstrap/${_pkgver_macro}* -maxdepth 0 -type d | sort -r | head -n 1)"
else
local _cli_root=""
fi
_InitializeDotNetCli="$_cli_root" DOTNET_INSTALL_DIR="$_cli_root" DotNetBuildFromSource=true ./build.sh \
/p:ArcadeBuildTarball=true \
/p:TarballDir=$builddir \
/p:TarballFilePath=$_pkg
msg "Compressing ${builddir##*/}.tar to $SRCDEST"
xz -T0 -9 -vv -e -c > "$SRCDEST"/${builddir##*/}.tar.xz < "$_pkg"
cd "$startdir"
abuild checksum
}
prepare() {
default_prepare
# Using system libunwind is broken on aarch64|armv7, and unused on mono-based builds
# see https://github.com/dotnet/source-build/issues/2408,
case $CARCH in
aarch64|armv7) msg "Using bundled libunwind";;
armhf|s390x|ppc64le) msg "No libunwind used";;
*)
msg "Using system libunwind"
patch -p1 -i "$srcdir"/runtime_enable-system-libunwind.diff
;;
esac
# ensure that dotnet does not download artifacts provided by dotnet-artifacts
rm -rf "$builddir"/packages/archive
# links logfiles to pipeline logs for easy pickup in pipelines
mkdir -p "$_logdir" "$builddir"/artifacts
ln -s "$_logdir" "$builddir"/artifacts/logs
ln -s "$_logdir" "$builddir"/artifacts/log
for i in "$builddir"/src/*; do
if [ -f "$i" ]; then
continue
fi
mkdir -p "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts
ln -s "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts/log
done
# dotnet requires its bootstrap to be in a writable dir
msg "Setting up bootstrap"
local _bootstrapdir=$(find $_libdir/dotnet/bootstrap/$_pkgver_macro* -maxdepth 0 | sort -r | head -n 1)
if [ ! -d "$_cli_root" ]; then
cp -r "$_bootstrapdir" "$_cli_root"
fi
}
build() {
msg "Building $pkgname-$pkgver"
ulimit -n 4096
# Disable use of LTTng as tracing on lttng <=2,13,0 is broken
# See https://github.com/dotnet/runtime/issues/57784.
if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then
export DOTNET_LTTng=0
fi
# looks for most recent recent version of _artifactsdir
local _artifactsdir=$(find $_libdir/dotnet/artifacts/$_pkgver_macro* -maxdepth 0 | sort -r | head -n 1)
# ci args, else the output is forwarded to log files which isn't ideal in a
# pipeline environment, and build by defaults uses lots of space
local args="
/v:minimal
/p:LogVerbosity=minimal
/p:MinimalConsoleLogOutput=true
/p:CleanWhileBuilding=true
"
# part of https://github.com/dotnet/installer/pull/14792 that sets this flag
# was not integrated in 7.0.1xx yet
case $CARCH in
s390x|ppc64le) local args="$args /p:SourceBuildUseMonoRuntime=true";;
esac
# Sets TargetRid manually as dotnet cannot be trusted to reliably compute
# the machine's runtime ID between releases.
# shellcheck disable=SC2034
. /etc/os-release
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
while [ ${#VERSION_ID_DOT} -gt 1 ]; do
local VERSION_ID="${VERSION_ID%.*}"
local VERSION_ID_DOT="${VERSION_ID//[^.]}"
done
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
while [ ${#VERSION_ID_DASH} -ge 1 ]; do
local VERSION_ID="${VERSION_ID%_*}"
local VERSION_ID_DASH="${VERSION_ID//[^_]}"
done
local args="$args /p:TargetRid=$ID.$VERSION_ID-$_dotnet_arch"
./build.sh \
--with-sdk "$_cli_root" \
--with-packages "$_artifactsdir" \
-- $args
}
check() {
ulimit -n 4096
# Tests timeout (in seconds)
local _tests_timeout=1000
# Test suite disable flags
# following tests can only work after packaging step
local _disabled_tests="man-pages distribution-package bash-completion install-location release-version-sane"
# test broken: permission issue on lxc / pipelines
local _disabled_tests="$_disabled_tests createdump-aspnet workload"
# liblttng-ust_sys-sdt.h: no 'NT_STAPSDT' on Alpine's lttng-ust package
# lttng: known issue, see https://github.com/dotnet/runtime/issues/57784
local _disabled_tests="$_disabled_tests liblttng-ust_sys-sdt.h lttng"
# {bundled,system}-libunwind: use system version on all but aarch64/armv7, as broken
# see https://github.com/redhat-developer/dotnet-regular-tests/issues/113
# disable on mono-flavored runtime as mono does not use libunwind
case $CARCH in
armv7|aarch64) local _disabled_tests="$_disabled_tests system-libunwind";;
s390x|ppc64le|armhf) local _disabled_tests="$_disabled_tests bundled-libunwind system-libunwind";;
*) local _disabled_tests="$_disabled_tests bundled-libunwind";;
esac
# test unit broken currently
_disabled_tests="$_disabled_tests system-libunwind"
# nativeaot is not supported on armv7
case $CARCH in
armv7) local _disabled_tests="$_disabled_tests nativeaot"
esac
# debugging-via-dotnet-dump hangs
local _disabled_tests="$_disabled_tests debugging-via-dotnet-dump"
msg "Unpacking produced dotnet"
export DOTNET_ROOT="$_checkdir/release"
if [ ! -d "$DOTNET_ROOT" ]; then
mkdir -p "$DOTNET_ROOT"
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$DOTNET_ROOT" \
--no-same-owner
fi
export PATH="$DOTNET_ROOT:$PATH"
# some files either should or should not have executable bits
# (done again during packaging - this is for tests)
_fix_executable "$DOTNET_ROOT"
msg "Building turkey test suite"
if [ ! -d "$_logdir/check" ]; then
mkdir -p "$_logdir"/check
fi
if [ ! -d "$_checkdir"/turkey ]; then
cd "$_checkdir"/Turkey
dotnet publish -bl:"$_logdir"/check/turkey.binlog -f netcoreapp3.1 -c Release -p:VersionPrefix=1 -p:VersionSuffix="$(git rev-parse --short HEAD)" -o "$_checkdir"/turkey
fi
msg "Running test suite"
cd "$_testdir"
for i in $_disabled_tests; do
if [ -d "$i" ]; then
sed -i 's|"enabled": true|"enabled": false|' $i/test.json
fi
done
dotnet "$_checkdir"/turkey/Turkey.dll -t $_tests_timeout -l "$_logdir"/check || local ERROR=true
if [ $ERROR ]; then
msg "Check error reported, please check logs"
fi
}
package() {
# directory creation
install -dm 755 \
"$pkgdir"/$_libdir/dotnet/bootstrap/$pkgver \
"$pkgdir"/usr/share/man/man1 \
"$pkgdir"/$_libdir/dotnet/artifacts/$pkgver
# unpack sdk to bootstrap
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$pkgdir"/$_libdir/dotnet/bootstrap/$pkgver/ \
--no-same-owner
# extract arch-specific artifacts to artifacts dir for use by future dotnet builds
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz \
-C "$pkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner \
--wildcards \
'*alpine*'
# assemble docs
find "$builddir" -iname 'dotnet*.1' -type f -exec cp '{}' "$pkgdir"/usr/share/man/man1/. \;
# some files either should or should not have executable bits
_fix_executable "$pkgdir"
# Disable use of LTTng as tracing on lttng <=2,13,0 is broken
# See https://github.com/dotnet/runtime/issues/57784.
if [ -f "/usr/lib/liblttng-ust.so.1 " ]; then
rm "$pkgdir"/$_libdir/dotnet/bootstrap/*/shared/Microsoft.NETCore.App/*/libcoreclrtraceptprovider.so
fi
}
sdk() {
pkgdesc="The .NET $_pkgver_macro SDK"
# libucontext isn't automatically detected on all platforms
depends="
aspnetcore$_pkgver_name-runtime
aspnetcore$_pkgver_name-targeting-pack
dotnet$_pkgver_name-apphost-pack
dotnet$_pkgver_name-targeting-pack
dotnet$_pkgver_name-templates
netstandard21-targeting-pack
libucontext
"
provides="
dotnet-sdk-$_pkgver_macro=$pkgver-r$pkgrel
dotnet$_pkgver_name-dev=$pkgver-r$pkgrel
"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
# sdk
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./sdk ./sdk-manifests
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
# See https://github.com/dotnet/source-build/issues/2579
find "$subpkgdir" -type f -name 'testhost.x86' -delete
find "$subpkgdir" -type f -name 'vstest.console' -delete
}
netstandard_targeting_pack() {
pkgdesc="The .NET 2.1 Standard targeting pack"
depends="dotnet-host"
provides="netstandard-targeting-pack-2.1=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet/packs
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./packs/NETStandard.Library.Ref
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
}
templates() {
pkgdesc="The .NET $_pkgver_macro templates"
depends="dotnet-host"
provides="dotnet-templates-$_pkgver_macro=$pkgver-r$pkgrel"
install -dm 755 "$subpkgdir"/$_libdir/dotnet
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/ \
--no-same-owner \
./templates
# some files either should or should not have executable bits
_fix_executable "$subpkgdir"
}
artifacts() {
pkgdesc="Internal package for building .NET $_pkgver_macro Software Development Kit"
# hack to allow artifacts to pull itself
provides="dotnet$_pkgver_name-bootstrap-artifacts"
provider_priority=$_pkgver_prior
# directory creation
install -dm 755 \
"$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver \
"$subpkgdir"/usr/share/licenses
# extract arch-agnostic artifacts to artifacts dir for use by future dotnet builds
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/Private.SourceBuilt.Artifacts.*.tar.gz \
-C "$subpkgdir"/$_libdir/dotnet/artifacts/$pkgver/ \
--no-same-owner \
--exclude '*Intermediate*' \
--exclude '*alpine*'
}
zshcomp() {
depends=""
pkgdesc="zsh completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack zsh"
depends="dotnet-host"
install -dm 755 "$subpkgdir"/usr/share/zsh/site-functions
install -m 755 "$builddir"/src/sdk/scripts/register-completions.zsh "$subpkgdir"/usr/share/zsh/site-functions/_dotnet
}
bashcomp() {
depends=""
pkgdesc="bash completion for .NET"
# netstandard21-targeting-pack will always be pulled by any dotnetx-sdk
# thus pulling this with it for sdk
install_if="netstandard21-targeting-pack bash-completion"
depends="dotnet-host"
install -dm 755 "$subpkgdir"/usr/share/bash-completion/completions
install -m 755 "$builddir"/src/sdk/scripts/register-completions.bash "$subpkgdir"/usr/share/bash-completion/completions/_dotnet
}
doc() {
default_doc
pkgdesc="Docs for .NET"
# licenses
install -dm 755 "$subpkgdir"/usr/share/licenses/dotnet
tar --use-compress-program="pigz" \
-xf "$builddir"/artifacts/$_dotnet_arch/Release/dotnet-sdk-$_pkgver_macro*.tar.gz \
-C "$subpkgdir"/usr/share/licenses/dotnet/ \
--no-same-owner \
./LICENSE.txt ./ThirdPartyNotices.txt
}
sha512sums="
4bc1cbe52fef05e6e343a0b2cc759e6fdbf4479540694676eb095d02fd3a542fc6807bda8ecdbd11f1b60e65180afa217e25c8f47b2c5e7beb53ee2e90118053 dotnet-v8.0.100-preview.3.23178.7.tar.xz
e9f3df13d093fac214778c1137857e065f58d4e0d2a48d540d8ed7bb41e2fd73b2b3f62a0aa5b0e80fa80a5b58ba77ff19b9d10a492802f8539e3a6ed79d299d dotnet-testsuite-e1cc0f181ffd4d755756d30d985513897d592ba4.tar.gz
0028d5d97b814b122d73137b4e0d64ca5d788aa0ae5fde500de722e23522827f2538f06e75acb17cc39b8917961ee78d1f0bbc84b2b624ae0e9bf88adca2ba6f dotnet-bunny-v12.tar.gz
eed7a7481a967f6938de956a6df485efa6dd61bf36ae4a768493cb1f7da0296dc91e0f2f89f7c302083ba9cf0c778e28228ec1b52e902077a00072d7d9957ef3 build_enable-timestamps.patch
4ac92d2d9190a55ee20d3e145a28a6953c98d3eb838c8acfb808b8839316443cb64da4a2c5787df0171fce7ef96ff6381043085ed90c23ec09ce9ac81571e675 roslyn-analyzer_disable-apphost.patch
77fa6d9987a7c43725582c9c493e9d4d5965a611a1d795dad4e3d46cd730caced095f994d93f91a131df7fa4b6a7277bcd3d915bae2dcd869559f22076fbc575 runtime_79856-save-errno-when-using-posix-semaphores.patch
d732df247c721c9f677baabdd7f36dbf4b564814ff64164361065bb1c196b767494a1d39f634eadf01a23032c7b3e64102614b7213065c81096bbf3f8022e6a0 runtime_82269-mono-thread-coop-undefine-fortify-source.patch
2ed962096eb9d8ae61831d224ceb05b8f77f5692f38a3457048d1b4abef705e8e4f676b81bb1a833e338e75ac8dc80b0631b1a45ad9a15c5597740b7320bfbb5 runtime_84413-support-adding-rids-with-dash-in-base-part.patch
293742ab307bef459a21deadcc4ad7c7996cc4b490910a36c2763b8ad25cc8a91c4e03b6290567cd1030f69638d0156c5b6970887858fb091f8482b67356065d runtime_enable-system-libunwind.diff
887112eb2b103eadd6887529ebae7f9a75df2c2cb168e84fd40cc09f9bcd20917d428bbba06968b07b0a463890da82b1b2b1d033a3dd016e6494067464ae6f74 runtime_more-clang-16-suppression.patch
0c25319125ef5b0ad490b37a643c0c5257c796d5ed24f9ac404f698710b07de790bcbb0b6336d4a50025b94c3bff99b214951bd8f0a79a8d6f543ebaa300740f runtime_remove-usage-of-off64-t.patch
d1b4ebcbb1a6815fc0ce4c471485c232618e60968a879309fb8336821a9351d2e0028d9f7726c0c041c750b497a0baa47400c78c9ceff550b91b4a6c2816fc41 sdk_14239-add-zsh-compdef-completion-script.patch
"

View file

@ -0,0 +1,145 @@
# dotnet8-build
This is the .NET 8.0 package for Alpine Linux.
Please report any issues [using Gitlab](https://gitlab.alpinelinux.org/alpine/aports/-/issues/new) and tag @ayakael
# Building info
## Generated packages
* `dotnet8-build` (aimed for internal use as bootstrap)
* `dotnet8-build-artifacts` (aimed for internal use as bootstrap)
* `dotnet8-sdk`
* `dotnet8-templates` (required by sdk)
* `dotnet-zsh-completion`
* `dotnet-bash-completion`
* `dotnet-doc`
* `netstandard21-targeting-pack`
## How to build dotnet8 on Alpine
As dotnet is a self-hosting compiler (thus it compiles using itself), it
requires a bootstrap for the initial build. To solve this problem, this package
follows the `stage0` proposal outlined [here](https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E)
The goal of `stage0` is to bootstrap dotnet with as little intervention as
possible, thus allowing seamless Alpine upgrades. Unfortunately, upstream only
builds bootstraps for Alpine on `x86_64`, `aarch64`, and `armv7`. Thus, `stage0`
has also been designed to be crossbuild aware, allowing bootstrapping to other
platforms.
In summary, dotnet8 is built using three different aports.
* `community/dotnet8-stage0`
Builds minimum components for full build of dotnet8, and packages these in an initial
`dotnet8-stage0-bootstrap` package that `dotnet8-build` pulls.
* `community/dotnet8-build`
Builds full and packages dotnet8 fully using either stage0 or previoulsy built
dotnet8 build.
* `community/dotnet8-runtime`
As abuild does not allow different versions for subpackages, a different aport
is required to package runtime bits from dotnet8-build.
## Crossbuilding with `stage0`
Crossbuilding `stage0` is a three step process:
1. Build sysroot for target platform by using `scripts/bootstrap.sh` in aports repo:
```
./bootstrap.sh $CTARGET_ARCH
```
2. Although not necessary, it is recommended to add Alpine repositories to
`$HOME/sysroot-$CTARGET_ARCH/etc/apk/repositories`, making sure to add required
keys. This makes it so that whatever package is not built in step 1 will
be pulled from package repos
3. Crossbuild `dotnet8-stage0` via:
```
CHOST=$CTARGET_ARCH abuild -r
```
# Specification
This package follows [package naming and contents suggested by upstream](https://docs.microsoft.com/en-us/dotnet/core/build/distribution-packaging),
with two exceptions. It installs dotnet to `/usr/lib/dotnet` (aka `$_libdir`).
In addition, the package is named `dotnet8` as opposed to `dotnet-8.0`
to match Alpine Linux naming conventions for packages with many installable versions
# Contributing
The steps below are for the final package. Please only contribute to a
pre-release version if you know what you are doing. Original instructions
follow.
## General Changes
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
3. Make your changes. Don't forget to add a changelog.
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally.
6. Commit the changes to the git repo in a git branch
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: descriptive description'`
- `git push`
7. Create a merge request with your changes, tagging @ayakael for review.
8. Once the tests in the merge-request pass, and reviewers are happy, your changes
will be merged.
## Updating to an new upstream release
1. Fork the main aports repo.
2. Checkout the forked repository.
- `git clone ssh://git@gitlab.alpinelinux.org/$USER/aports`
- `cd community/dotnet8-build`
3. Build the new upstream source tarball. Update the versions in the
APKBUILD file, and then create a snapshot. After build, update checksum.
- `abuild snapshot`
- `abuild checksum`
4. Do local builds.
- `abuild -r`
5. Fix any errors that come up and rebuild until it works locally. Any
patches that are needed at this point should be added to the APKBUILD file
in `_patches` variable.
6. Upload the source archive to a remote location, and update `source` variable.
7. Commit the changes to the git repo in a git branch.
- `git checkout -b dotnet8/<name>`
- `git add` any new patches
- `git remove` any now-unnecessary patches
- `git commit -m 'community/dotnet8-build: upgrade to <new-version>`
- `git push`
8. Create a merge request with your changes, tagging @ayakael for review.
9. Once the tests in the merge-request pass, and reviewers are happy, your changes
will be merged.
# Testing
This package uses CI tests as defined in `check()` function. Creating a
merge-request or running a build will fire off tests and flag any issues.
The tests themselves are contained in this external repository:
https://github.com/redhat-developer/dotnet-regular-tests/

View file

@ -0,0 +1,40 @@
diff --git a/repo-projects/Directory.Build.props b/repo-projects/Directory.Build.props
index b70a3161fef..d57f9393299 100644
--- a/repo-projects/Directory.Build.props
+++ b/repo-projects/Directory.Build.props
@@ -134,6 +134,7 @@
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) $(FlagParameterPrefix)pack</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) $(FlagParameterPrefix)publish</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) -bl</StandardSourceBuildArgs>
+ <StandardSourceBuildArgs>$(StandardSourceBuildArgs) /consoleLoggerParameters:ShowTimestamp</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) /p:ArcadeBuildFromSource=true</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) /p:CopyWipIntoInnerSourceBuildRepo=true</StandardSourceBuildArgs>
<StandardSourceBuildArgs>$(StandardSourceBuildArgs) /p:DotNetBuildOffline=true</StandardSourceBuildArgs>
diff --git a/src/fsharp/eng/build.sh b/src/fsharp/eng/build.sh
index fff8414b3ef..d470fc6ed56 100755
--- a/src/fsharp/eng/build.sh
+++ b/src/fsharp/eng/build.sh
@@ -144,7 +144,7 @@ while [[ $# > 0 ]]; do
--sourcebuild)
source_build=true
;;
- /p:*)
+ /*)
properties="$properties $1"
;;
*)
diff --git a/src/roslyn/eng/build.sh b/src/roslyn/eng/build.sh
index a08cbea099d..d3ec235732f 100755
--- a/src/roslyn/eng/build.sh
+++ b/src/roslyn/eng/build.sh
@@ -167,7 +167,7 @@ while [[ $# > 0 ]]; do
args="$args $1"
shift
;;
- /p:*)
+ /*)
properties="$properties $1"
;;
*)

View file

@ -0,0 +1,28 @@
From 79f02a53316f90543d60269d7c06727c376f423b Mon Sep 17 00:00:00 2001
From: Antoine Martin <dev@ayakael.net>
Date: Wed, 24 Aug 2022 18:41:08 +0000
Subject: [PATCH 1/1] disable apphost usage
Roslyn-analyzer can't seem to find apphost produced by runtime build on ppc64le
This disables its use as it isn't necessary
---
diff --git a/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj b/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj
index 044a2aba46..3d37e147b3 100644
--- a/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj
+++ b/src/roslyn-analyzers/src/PerformanceTests/Tests/PerformanceTests.csproj
@@ -15,6 +15,7 @@
<Configuration>Release</Configuration>
<IsPackable>false</IsPackable>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
+ <UseAppHost>false</UseAppHost>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetVersion)" />
@@ -27,4 +28,4 @@
<ProjectReference Include="..\Utilities\CSharp\CSharpPerfUtilities.csproj" />
<ProjectReference Include="..\Utilities\VisualBasic\VisualBasicPerfUtilities.csproj" />
</ItemGroup>
-</Project>
\ No newline at end of file
+</Project>

View file

@ -0,0 +1,174 @@
From 50de22c7fa57c687a996bfdf6702871216881c0f Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/pull/79856
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 25 Feb 2023 15:19:00 -0500
Subject: [PATCH 1/1] [threads] Save errno when using posix semaphores for
thread transitions
We already save/restore GetLastError on win32. Do it on posix
platforms, too.
If one thread is in a pinvoke wrapper, while another thread triggers a
STW, the pinvoke wrapper will self-suspend the thread and wait for a
notification to resume. Depending on the platform we can use win32
primitives, Mach semaphores or POSIX semaphores. win32 and posix can
both change the value of last error (errno, respectively) while the
thread is suspended.
That means that code like this (generated by the
LibraryImportAttribute source generator) cannot reliably retrieve the
error from the last pinvoke:
```csharp
__retVal = __PInvoke(__path_native, mode); // there is a pinvoke wrapper here, that transitions from GC Safe to GC Unsafe mode
__lastError = System.Runtime.InteropServices.Marshal.GetLastSystemError();
```
The solution is to explicitly preserve the value of GetLastError/errno
when exiting from GC Safe.
Fixes https://github.com/dotnet/runtime/issues/77364
---
.../src/mono/mono/utils/mono-threads-coop.c | 12 +++---
.../src/mono/mono/utils/mono-threads.c | 4 +-
.../src/mono/mono/utils/mono-threads.h | 43 ++++++++++++++++---
3 files changed, 45 insertions(+), 14 deletions(-)
diff --git a/src/runtime/src/mono/mono/utils/mono-threads-coop.c b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
index 4ed659d66..c562ada67 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads-coop.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
@@ -337,10 +337,10 @@ mono_threads_exit_gc_safe_region_internal (gpointer cookie, MonoStackData *stack
return;
#ifdef ENABLE_CHECKED_BUILD_GC
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
if (mono_check_mode_enabled (MONO_CHECK_MODE_GC))
coop_tls_pop (cookie);
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
#endif
mono_threads_exit_gc_safe_region_unbalanced_internal (cookie, stackdata);
@@ -365,7 +365,7 @@ mono_threads_exit_gc_safe_region_unbalanced_internal (gpointer cookie, MonoStack
/* Common to use enter/exit gc safe around OS API's affecting last error. */
/* This method can call OS API's that will reset last error on some platforms. */
/* To reduce errors, we need to restore last error before exit gc safe. */
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
info = (MonoThreadInfo *)cookie;
@@ -398,7 +398,7 @@ mono_threads_exit_gc_safe_region_unbalanced_internal (gpointer cookie, MonoStack
info->user_data = NULL;
}
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
}
void
@@ -652,14 +652,14 @@ mono_threads_suspend_policy_init (void)
// otherwise if one of the old environment variables is set, use that.
// otherwise use full preemptive suspend.
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
(policy = threads_suspend_policy_getenv ())
|| (policy = threads_suspend_policy_default ())
|| (policy = threads_suspend_policy_getenv_compat ())
|| (policy = MONO_THREADS_SUSPEND_FULL_PREEMPTIVE);
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
g_assert (policy);
mono_threads_suspend_policy_hidden_dont_modify = (char)policy;
diff --git a/src/runtime/src/mono/mono/utils/mono-threads.c b/src/runtime/src/mono/mono/utils/mono-threads.c
index 2ef2fe45b..41dbf3032 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads.c
@@ -1894,7 +1894,7 @@ mono_thread_info_uninstall_interrupt (gboolean *interrupted)
/* Common to uninstall interrupt handler around OS API's affecting last error. */
/* This method could call OS API's on some platforms that will reset last error so make sure to restore */
/* last error before exit. */
- W32_DEFINE_LAST_ERROR_RESTORE_POINT;
+ MONO_DEFINE_LAST_ERROR_RESTORE_POINT;
g_assert (interrupted);
*interrupted = FALSE;
@@ -1917,7 +1917,7 @@ mono_thread_info_uninstall_interrupt (gboolean *interrupted)
THREADS_INTERRUPT_DEBUG ("interrupt uninstall tid %p previous_token %p interrupted %s\n",
mono_thread_info_get_tid (info), previous_token, *interrupted ? "TRUE" : "FALSE");
- W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
+ MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT;
}
static MonoThreadInfoInterruptToken*
diff --git a/src/runtime/src/mono/mono/utils/mono-threads.h b/src/runtime/src/mono/mono/utils/mono-threads.h
index 6a548b183..45353db4e 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads.h
+++ b/src/runtime/src/mono/mono/utils/mono-threads.h
@@ -866,19 +866,50 @@ mono_win32_interrupt_wait (PVOID thread_info, HANDLE native_thread_handle, DWORD
void
mono_win32_abort_blocking_io_call (THREAD_INFO_TYPE *info);
-#define W32_DEFINE_LAST_ERROR_RESTORE_POINT \
+#else
+
+
+#endif
+
+#ifdef USE_WINDOWS_BACKEND
+
+/* APC calls can change GetLastError while a thread is suspended. Save/restore it when doing thread
+ state transitions (for example in m2n wrappers) in order to protect the result of the last
+ pinvoke */
+
+#define MONO_DEFINE_LAST_ERROR_RESTORE_POINT \
const DWORD _last_error_restore_point = GetLastError ();
-#define W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT \
+#define MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT \
/* Only restore if changed to prevent unnecessary writes. */ \
if (GetLastError () != _last_error_restore_point) \
mono_SetLastError (_last_error_restore_point);
+#elif defined(USE_WASM_BACKEND) || defined (USE_POSIX_BACKEND)
+
+#define MONO_DEFINE_LAST_ERROR_RESTORE_POINT \
+ int _last_errno_restore_point = errno;
+
+#define MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT \
+ if (errno != _last_errno_restore_point) \
+ errno = _last_errno_restore_point;
+
+/* Posix semaphores set errno on failure and sporadic wakeup. GC state transitions are done in n2m
+ * and m2n wrappers and may change the value of errno from the last pinvoke. Use these macros to
+ * save/restore errno when doing thread state transitions. */
+
+#elif defined(USE_MACH_BACKEND)
+
+/* Mach semaphores don't set errno on failure. Change this to be the same as POSIX if some other primitives used
+ in thread state transitions pollute errno. */
+
+#define MONO_DEFINE_LAST_ERROR_RESTORE_POINT /* nothing */
+#define MONO_RESTORE_LAST_ERROR_FROM_RESTORE_POINT /* nothing */
+
#else
-
-#define W32_DEFINE_LAST_ERROR_RESTORE_POINT /* nothing */
-#define W32_RESTORE_LAST_ERROR_FROM_RESTORE_POINT /* nothing */
-
+#error "unknown threads backend, not sure how to save/restore last error"
#endif
+
+
#endif /* __MONO_THREADS_H__ */
--
2.38.4

View file

@ -0,0 +1,25 @@
From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/issues/82269
From: Antoine Martin <dev@ayakael.net>
Date: Sat, 1 Oct 2022 09:21:58 -0400
Subject: [PATCH] Undefine fortify-source on mono-thread-coop
When _FORTIFY_SOURCE=2, there is a bug relating to memcpy that expresses itself.
See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/14105. Alpine Linux
now sets this by default since https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/43463,
which makes mono-flavored runtime dump its core. This patch offers a workaround
by undefining _FORTIFY_SOURCE in the problematic file.
---
diff --git a/src/runtime/src/mono/mono/utils/mono-threads-coop.c b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
index 4ed659d6605..34bb5785fba 100644
--- a/src/runtime/src/mono/mono/utils/mono-threads-coop.c
+++ b/src/runtime/src/mono/mono/utils/mono-threads-coop.c
@@ -15,6 +15,7 @@
#ifdef TARGET_MACH
#define _DARWIN_C_SOURCE
#endif
+#undef _FORTIFY_SOURCE
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-threads.h>

View file

@ -0,0 +1,164 @@
From abc761c2c5694e4029fea1a60dc1934951c66e26 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/dotnet/runtime/pull/84413
From: Tom Deseyn <tom.deseyn@gmail.com>
Date: Thu, 6 Apr 2023 13:18:11 +0200
Subject: [PATCH 1/2] Microsoft.NETCore.Platforms: support adding rids with '-'
in the base part.
Currently when trying to add a rid like 'linux-musl-x64'
the rid is not understood to be base = 'linux-musl', arch = 'x64'.
Instead the parser considers a potential optional qualifier.
This causes the rid to be parsed as base = 'linux', arch = 'musl',
and qualifier = 'x64'.
We know the rids being added won't have a qualifier. If we take
this into account while parsing, we can parse the rid correctly.
---
.../Microsoft.NETCore.Platforms/src/RID.cs | 11 +++-
.../src/RuntimeGroupCollection.cs | 2 +-
.../tests/RidTests.cs | 50 +++++++++++++------
3 files changed, 47 insertions(+), 16 deletions(-)
diff --git a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs
index 6457fd29cadf0..b464d5f0f54e3 100644
--- a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs
+++ b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RID.cs
@@ -56,7 +56,7 @@ private enum RIDPart : int
Max = Qualifier
}
- public static RID Parse(string runtimeIdentifier)
+ public static RID Parse(string runtimeIdentifier, bool noQualifier)
{
string[] parts = new string[(int)RIDPart.Max + 1];
bool omitVersionDelimiter = true;
@@ -90,6 +90,15 @@ public static RID Parse(string runtimeIdentifier)
// version might be omitted
else if (current == ArchitectureDelimiter)
{
+ // The qualifier delimiter and architecture delimiter are the same.
+ // When there is no qualifier, there will be one delimiter past the base part
+ // for the architecture.
+ // So if we see another delimiter later in the string (for the architecture),
+ // extend the base part instead of starting the architecture part.
+ if (noQualifier && runtimeIdentifier.IndexOf(ArchitectureDelimiter, i + 1) != -1)
+ {
+ break;
+ }
// ensure there's no version later in the string
if (runtimeIdentifier.IndexOf(VersionDelimiter, i) != -1)
{
diff --git a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
index e069508053105..31009a8d28e5e 100644
--- a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
+++ b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
@@ -34,7 +34,7 @@ public RuntimeGroupCollection(ICollection<RuntimeGroup> runtimeGroups)
/// <param name="parent"></param>
public void AddRuntimeIdentifier(string runtimeIdentifier, string parent)
{
- RID rid = RID.Parse(runtimeIdentifier);
+ RID rid = RID.Parse(runtimeIdentifier, noQualifier: true);
AddRuntimeIdentifier(rid, parent);
}
diff --git a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/tests/RidTests.cs b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/tests/RidTests.cs
index 227bcbdd10d4d..8dee0ebeda17a 100644
--- a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/tests/RidTests.cs
+++ b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/tests/RidTests.cs
@@ -10,35 +10,57 @@ public class RidTests
{
public static IEnumerable<object[]> ValidRIDData()
{
- yield return new object[] { "win10-x64", new RID() { BaseRID = "win", OmitVersionDelimiter = true, Version = new RuntimeVersion("10"), Architecture = "x64" } };
- yield return new object[] { "win10", new RID() { BaseRID = "win", OmitVersionDelimiter = true, Version = new RuntimeVersion("10")} };
- yield return new object[] { "linux", new RID() { BaseRID = "linux" } };
- yield return new object[] { "linux-x64", new RID() { BaseRID = "linux", Architecture = "x64" } };
- yield return new object[] { "linux-x64", new RID() { BaseRID = "linux", Architecture = "x64" } };
- yield return new object[] { "debian.10-x64", new RID() { BaseRID = "debian", Version = new RuntimeVersion("10"), Architecture = "x64" } };
- yield return new object[] { "linuxmint.19.2-x64", new RID() { BaseRID = "linuxmint", Version = new RuntimeVersion("19.2"), Architecture = "x64" } };
- yield return new object[] { "ubuntu.14.04-x64", new RID() { BaseRID = "ubuntu", Version = new RuntimeVersion("14.04"), Architecture = "x64" } };
- yield return new object[] { "foo-bar.42-arm", new RID() { BaseRID = "foo-bar", Version = new RuntimeVersion("42"), Architecture = "arm" } };
- yield return new object[] { "foo-bar-arm", new RID() { BaseRID = "foo", Architecture = "bar", Qualifier = "arm" } }; // demonstrates ambiguity, avoid using `-` in base
- yield return new object[] { "linux-musl-x64", new RID() { BaseRID = "linux", Architecture = "musl", Qualifier = "x64" } }; // yes, we already have ambiguous RIDs
+ yield return new object[] { "win10-x64", new RID() { BaseRID = "win", OmitVersionDelimiter = true, Version = new RuntimeVersion("10"), Architecture = "x64" }, null };
+ yield return new object[] { "win10", new RID() { BaseRID = "win", OmitVersionDelimiter = true, Version = new RuntimeVersion("10")}, null };
+ yield return new object[] { "linux", new RID() { BaseRID = "linux" }, null };
+ yield return new object[] { "linux-x64", new RID() { BaseRID = "linux", Architecture = "x64" }, null };
+ yield return new object[] { "linux-x64", new RID() { BaseRID = "linux", Architecture = "x64" }, null };
+ yield return new object[] { "debian.10-x64", new RID() { BaseRID = "debian", Version = new RuntimeVersion("10"), Architecture = "x64" }, null };
+ yield return new object[] { "linuxmint.19.2-x64", new RID() { BaseRID = "linuxmint", Version = new RuntimeVersion("19.2"), Architecture = "x64" }, null };
+ yield return new object[] { "ubuntu.14.04-x64", new RID() { BaseRID = "ubuntu", Version = new RuntimeVersion("14.04"), Architecture = "x64" }, null };
+ yield return new object[] { "foo-bar.42-arm", new RID() { BaseRID = "foo-bar", Version = new RuntimeVersion("42"), Architecture = "arm" }, null };
+ yield return new object[] { "foo-bar-arm", new RID() { BaseRID = "foo", Architecture = "bar", Qualifier = "arm" }, // demonstrates ambiguity, avoid using `-` in base
+ new RID() { BaseRID = "foo-bar", Architecture = "arm" } };
+ yield return new object[] { "linux-musl-x64", new RID() { BaseRID = "linux", Architecture = "musl", Qualifier = "x64" }, // yes, we already have ambiguous RIDs
+ new RID() { BaseRID = "linux-musl", Architecture = "x64" } };
}
[Theory]
[MemberData(nameof(ValidRIDData))]
- internal void ParseCorrectly(string input, RID expected)
+ internal void ParseCorrectly(string input, RID expected, RID? expectedNoQualifier)
{
- RID actual = RID.Parse(input);
+ _ = expectedNoQualifier; // unused
+
+ RID actual = RID.Parse(input, noQualifier: false);
Assert.Equal(expected, actual);
}
[Theory]
[MemberData(nameof(ValidRIDData))]
- internal void ToStringAsExpected(string expected, RID rid)
+ internal void ParseCorrectlyNoQualifier(string input, RID expected, RID? expectedNoQualifier)
+ {
+ expectedNoQualifier ??= expected;
+
+ RID actual = RID.Parse(input, noQualifier: true);
+
+ Assert.Equal(expectedNoQualifier, actual);
+ }
+
+ [Theory]
+ [MemberData(nameof(ValidRIDData))]
+ internal void ToStringAsExpected(string expected, RID rid, RID? expectedNoQualifierRid)
{
string actual = rid.ToString();
Assert.Equal(expected, actual);
+
+ if (expectedNoQualifierRid is not null)
+ {
+ actual = expectedNoQualifierRid.ToString();
+
+ Assert.Equal(expected, actual);
+ }
}
}
}
From f70da467ca94291039e0ea5b0723cb9db5e090e7 Mon Sep 17 00:00:00 2001
From: Tom Deseyn <tom.deseyn@gmail.com>
Date: Thu, 6 Apr 2023 18:14:31 +0200
Subject: [PATCH 2/2] Update
src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
---
.../Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
index 31009a8d28e5e..ec4762d71424c 100644
--- a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
+++ b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
@@ -34,6 +34,7 @@ public RuntimeGroupCollection(ICollection<RuntimeGroup> runtimeGroups)
/// <param name="parent"></param>
public void AddRuntimeIdentifier(string runtimeIdentifier, string parent)
{
+ // don't parse qualifier since we don't use them and they are ambiguous with `-` in base RID
RID rid = RID.Parse(runtimeIdentifier, noQualifier: true);
AddRuntimeIdentifier(rid, parent);

View file

@ -0,0 +1,12 @@
diff --git a/src/runtime/eng/SourceBuild.props b/src/runtime/eng/SourceBuild.props
index 32e6d9c0ba..8e2a7f9931 100644
--- a/src/runtime/eng/SourceBuild.props
+++ b/src/runtime/eng/SourceBuild.props
@@ -51,6 +51,7 @@
<InnerBuildArgs>$(InnerBuildArgs) /p:DisableSourceLink=false</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS)</InnerBuildArgs>
<InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) /p:PrimaryRuntimeFlavor=Mono /p:RuntimeFlavor=Mono</InnerBuildArgs>
+ <InnerBuildArgs>$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</InnerBuildArgs>
</PropertyGroup>
</Target>

View file

@ -0,0 +1,13 @@
diff --git a/src/runtime/eng/native/configurecompiler.cmake b/src/runtime/eng/native/configurecompiler.cmake
index c9a54547c0a..931da2cae5b 100644
--- a/src/runtime/eng/native/configurecompiler.cmake
+++ b/src/runtime/eng/native/configurecompiler.cmake
@@ -488,6 +488,8 @@ if (CLR_CMAKE_HOST_UNIX)
# other clang 16.0 suppressions
add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
add_compile_options(-Wno-cast-function-type-strict)
+ add_compile_options(-Wno-incompatible-function-pointer-types-strict)
+ add_compile_options(-Wno-ignored-attributes)
else()
add_compile_options(-Wno-uninitialized)
add_compile_options(-Wno-strict-aliasing)

Some files were not shown because too many files have changed in this diff Show more