Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Nov 1, 2023
2 parents 932ce6d + 1febc32 commit 244a5c2
Show file tree
Hide file tree
Showing 28 changed files with 2,808 additions and 359 deletions.
81 changes: 0 additions & 81 deletions .cirrus.yml

This file was deleted.

10 changes: 7 additions & 3 deletions .dscanner.ini
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ trust_too_much="enabled"
; For more details, please see https://github.com/dlang/phobos/pull/5501
[analysis.config.ModuleFilters]
; Check for uses of the old-style alias syntax
alias_syntax_check="-std.traits,-std.typecons"
alias_syntax_check="-etc.c.odbc.sql,-etc.c.odbc.sqlext,-etc.c.odbc.sqltypes,-etc.c.odbc.sqlucode,-std.traits,-std.typecons"
; Check allman brace style
allman_braces_check="+disabled"
; Checks for confusing code in inline asm statements
Expand Down Expand Up @@ -220,6 +220,9 @@ function_attribute_check="-std.algorithm.iteration,-std.concurrency,-std.conv,-s
has_public_example="-etc.c.curl,\
-etc.c.sqlite3,\
-etc.c.zlib,\
-etc.c.odbc.sql,\
-etc.c.odbc.sqlext,\
-etc.c.odbc.sqlucode,\
-std.complex,\
-std.concurrency,\
-std.container.array,\
Expand Down Expand Up @@ -274,7 +277,7 @@ has_public_example="-etc.c.curl,\
imports_sortedness="+disabled"
;imports_sortedness="-etc.c.curl,-std.algorithm.comparison,-std.algorithm.internal,-std.algorithm.iteration,-std.algorithm.mutation,-std.algorithm.searching,-std.algorithm.setops,-std.algorithm.sorting,-std.array,-std.bigint,-std.bitmanip,-std.c.freebsd.socket,-std.c.linux.pthread,-std.c.process,-std.complex,-std.concurrency,-std.container.array,-std.container.binaryheap,-std.container.dlist,-std.container.rbtree,-std.container.slist,-std.container.util,-std.conv,-std.datetime,-std.datetime.date,-std.datetime.interval,-std.datetime.systime,-std.datetime.timezone,-std.digest,-std.digest.hmac,-std.exception,-std.experimental.allocator,-std.experimental.allocator.building_blocks,-std.experimental.allocator.building_blocks.affix_allocator,-std.experimental.allocator.building_blocks.allocator_list,-std.experimental.allocator.building_blocks.free_list,-std.experimental.allocator.building_blocks.free_tree,-std.experimental.allocator.building_blocks.kernighan_ritchie,-std.experimental.allocator.building_blocks.region,-std.experimental.allocator.common,-std.experimental.allocator.mallocator,-std.experimental.allocator.mmap_allocator,-std.experimental.allocator.showcase,-std.experimental.allocator.typed,-std.experimental.checkedint,-std.logger.core,-std.file,-std.format,-std.functional,-std.getopt,-std.internal.math.biguintcore,-std.internal.test.dummyrange,-std.json,-std.math,-std.meta,-std.mmfile,-std.net.curl,-std.net.isemail,-std.numeric,-std.outbuffer,-std.parallelism,-std.path,-std.process,-std.random,-std.range,-std.range.primitives,-std.regex,-std.regex.internal.backtracking,-std.regex.internal.generator,-std.regex.internal.kickstart,-std.regex.internal.parser,-std.regex.internal.tests,-std.signals,-std.socket,-std.stdio,-std.string,-std.uni,-std.utf,-std.uuid,-std.variant,-std.windows.charset,-std.windows.registry,-std.windows.syserror,-std.zip"
; Checks for labels with the same name as variables
label_var_same_name_check="-std.algorithm.iteration,-std.algorithm.sorting,-std.array,-std.bigint,-std.bitmanip,-std.conv,-std.encoding,-std.experimental.allocator.building_blocks.segregator,-std.internal.digest.sha_SSSE3,-std.parallelism,-std.process,-std.typecons,-std.utf,-std.traits"
label_var_same_name_check="-std.algorithm.iteration,-std.algorithm.sorting,-std.array,-std.bigint,-std.bitmanip,-std.conv,-std.encoding,-std.experimental.allocator.building_blocks.segregator,-std.internal.digest.sha_SSSE3,-std.parallelism,-std.process,-std.range.primitives,-std.typecons,-std.utf,-std.traits"
; Checks for subtraction from .length properties
length_subtraction_check="+disabled"
;length_subtraction_check="-std.algorithm.internal,-std.algorithm.iteration,-std.algorithm.mutation,-std.algorithm.searching,-std.algorithm.sorting,-std.array,-std.concurrency,-std.container.array,-std.container.binaryheap,-std.conv,-std.datetime.timezone,-std.experimental.allocator.building_blocks.segregator,-std.logger.core,-std.file,-std.format,-std.getopt,-std.internal.math.biguintcore,-std.internal.math.biguintnoasm,-std.internal.math.biguintx86,-std.internal.scopebuffer,-std.math,-std.net.curl,-std.net.isemail,-std.numeric,-std.parallelism,-std.path,-std.process,-std.range,-std.regex,-std.regex.internal.parser,-std.regex.internal.tests,-std.string,-std.uni,-std.windows.charset,-std.windows.registry,-std.zip"
Expand All @@ -297,6 +300,7 @@ opequals_tohash_check="-std.complex,-std.container.array,-std.container.dlist,-s
; Note: DScanner doesn't understand documenting parameters of IFTI/eponymous templates.
properly_documented_public_functions="-etc.c.odbc.sql,\
-etc.c.odbc.sqlext,\
-etc.c.odbc.sqlucode,\
-etc.c.zlib,\
-std.algorithm.comparison,\
-std.algorithm.mutation,\
Expand Down Expand Up @@ -513,4 +517,4 @@ trust_too_much="-std.regex,-std.stdio,-std.uni,-std.internal.cstring"
; Temporarily disable until https://github.com/dlang-community/D-Scanner/issues/593 is fixed
if_else_same_check="-std.typecons"
; Disable checks for generated unicode tables
long_line_check="-std.internal.unicode_decomp,-std.internal.unicode_comp,-std.internal.unicode_grapheme,-std.internal.unicode_norm,-std.internal.unicode_tables"
long_line_check="-etc.c.odbc.sql,-etc.c.odbc.sqlext,-etc.c.odbc.sqltypes,-etc.c.odbc.sqlucode,-std.internal.unicode_decomp,-std.internal.unicode_comp,-std.internal.unicode_grapheme,-std.internal.unicode_norm,-std.internal.unicode_tables"
161 changes: 161 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# very similar to the DMD script: https://github.com/dlang/dmd/blob/master/.github/workflows/main.yml

name: Main
on:
- pull_request # without merge conflicts
- push # branch or tag

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
posix:
strategy:
fail-fast: false
matrix:
include:
# Linux
- job_name: Ubuntu 22.04 x64
os: ubuntu-22.04
- job_name: Ubuntu 22.04 x86
os: ubuntu-22.04
model: 32
# macOS
- job_name: macOS 13 x64
os: macos-13
- job_name: macOS 12 x64
os: macos-12
name: ${{ matrix.job_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 40
env:
# for ci/run.sh:
OS_NAME: ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'darwin' || '') }}
MODEL: ${{ matrix.model || '64' }}
HOST_DMD: dmd
N: ${{ startsWith(matrix.os, 'macos') && '3' || '2' }}
FULL_BUILD: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: Clone DMD
run: |
set -uexo pipefail
ref='${{ github.ref }}'
if [[ "$ref" =~ ^refs/pull/ ]]; then
# PR: clone the DMD head with the same name as this Phobos PR's target branch
# e.g., DMD stable when targeting Phobos stable
REPO_BRANCH="$GITHUB_BASE_REF"
elif [[ "$ref" =~ ^refs/(heads|tags)/(.*)$ ]]; then
# no PR: clone the DMD head with the same name as this Phobos head
# e.g., DMD stable for a push to Phobos stable, or DMD v2.105.2 for Phobos tag v2.105.2
REPO_BRANCH="${BASH_REMATCH[2]}"
else
echo "Error: unexpected GitHub ref '$ref'" >&2
exit 1
fi
git clone --branch "$REPO_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd
- name: Install prerequisites
run: cd ../dmd && ${{ runner.os == 'macOS' && 'ci/cirrusci.sh' || 'sudo -E ci/cirrusci.sh' }}
- name: Install host compiler
run: cd ../dmd && ci/run.sh install_host_compiler
- name: Build
run: cd ../dmd && ci/run.sh build
- name: Test dmd
run: cd ../dmd && ci/run.sh test_dmd
- name: Test druntime
run: cd ../dmd && ci/run.sh test_druntime
- name: Test phobos
run: cd ../dmd && ci/run.sh test_phobos

freebsd-vm:
strategy:
fail-fast: false
matrix:
include:
- job_name: FreeBSD 13.2 x64
freebsd_version: '13.2'
- job_name: FreeBSD 12.4 x64
freebsd_version: '12.4'
name: ${{ matrix.job_name }}
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: Run in VM
uses: cross-platform-actions/action@v0.21.0
with:
operating_system: freebsd
hypervisor: qemu
memory: 8G
sync_files: runner-to-vm
version: ${{ matrix.freebsd_version }}
shell: bash
run: |
set -uexo pipefail
freebsd_version='${{ matrix.freebsd_version }}'
freebsd_major="${freebsd_version:0:2}"
export OS_NAME=freebsd
export MODEL=64
export HOST_DMD=dmd
export N=3
export FULL_BUILD=false
export CI_DFLAGS="-version=TARGET_FREEBSD${freebsd_major}"
#if [[ "$freebsd_major" == 12 ]]; then
# sudo sed -i '' -e 's|pkg.FreeBSD.org|mirrors.xtom.com/freebsd-pkg|' /etc/pkg/FreeBSD.conf
#fi
bash --version
echo '::group::Install git'
sudo pkg install -y git
echo '::endgroup::'
echo '::group::Clone DMD'
ref='${{ github.ref }}'
if [[ "$ref" =~ ^refs/pull/ ]]; then
REPO_BRANCH="$GITHUB_BASE_REF"
elif [[ "$ref" =~ ^refs/(heads|tags)/(.*)$ ]]; then
REPO_BRANCH="${BASH_REMATCH[2]}"
else
echo "Error: unexpected GitHub ref '$ref'" >&2
exit 1
fi
git clone --branch "$REPO_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd
echo '::endgroup::'
cd ../dmd
echo '::group::Install prerequisites'
sudo -E ci/cirrusci.sh
echo '::endgroup::'
echo '::group::Install host compiler'
ci/run.sh install_host_compiler
echo '::endgroup::'
echo '::group::Build'
ci/run.sh build
echo '::endgroup::'
echo '::group::Test dmd'
ci/run.sh test_dmd
echo '::endgroup::'
echo '::group::Test druntime'
ci/run.sh test_druntime
echo '::endgroup::'
echo '::group::Test phobos'
ci/run.sh test_phobos
echo '::endgroup::'
3 changes: 3 additions & 0 deletions changelog/PR8804.dd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Undo etc.c.odbc deprecation and enable usage on non-Windows systems

Previously, the etc.c.odbc bindings were deprecated and forwarded the core.sys.windows versions of the bindings via public import. However, ODBC is supported on all major platforms and the machine translated MinGW bindings in core.sys.windows have version(Windows) specified which results in being unable to use those bindings on non-Windows platforms. The bindings have been returned to etc.c.odbc, undeprecated, and support for non-Windows platforms enabled.
7 changes: 7 additions & 0 deletions changelog/is_input_range_element.dd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
isInputRange now takes an optional element type.

isInputRange now has an optional 2nd template parameter that defaults
to void. If not void, it only evaluates to true if the range's element
type is the same type as this extra argument, modulo const. For
instance, `isInputRange!(int[], const(int))` is true, but
`isInputRange!(int[], string)` is false.
13 changes: 13 additions & 0 deletions changelog/unshared.dd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Add Unshared to std.traits.

`Unshared` is the `shared` equivalent of `Unconst`. It strips off the outer
layer of `shared` from a type. e.g.

```
static assert(Unshared!(shared int) == int);
static assert(Unshared!(shared(int[])) == shared(int)[]);
```

So, `Unconst` strips off the outer layer of `const`, `immutable`, and `inout`;
`Unshared` strips off the outer layer of `shared`; and `Unqual` strips off all
qualifiers from the outer layer of a type.
Loading

0 comments on commit 244a5c2

Please sign in to comment.