Skip to content

Commit

Permalink
Merge pull request atilaneves#205 from kinke/dub_1.33
Browse files Browse the repository at this point in the history
Bump dub to v1.33.1
  • Loading branch information
atilaneves authored Sep 1, 2023
2 parents 051e7d1 + c5a03d9 commit 3b8b180
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 23 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ jobs:
with:
compiler: ${{ matrix.dc }}

# Work around hardcoded `dmd` compiler in integration tests
- name: "LDC: Symlink dmd to ldmd2"
if: matrix.dc == 'ldc-beta'
shell: bash
run: |
set -ex
ldcBinDir=$(dirname $(which ldmd2))
if [[ '${{ runner.os }}' == 'Windows' ]]; then
cp $ldcBinDir/ldmd2.exe $ldcBinDir/dmd.exe
else
ln -s $ldcBinDir/ldmd2 $ldcBinDir/dmd
fi
- name: "Posix: Run tests"
if: runner.os != 'Windows'
run: dub -q test -- ~@tup ~@travis_oops
Expand Down Expand Up @@ -86,7 +73,12 @@ jobs:
- name: Set OS-specific SCRIPT_CMD environment variable
run: |
if [[ '${{ runner.os }}' == 'Windows' ]]; then
echo "SCRIPT_CMD=./bootstrap.bat" >> $GITHUB_ENV
if [[ '${{ matrix.dc }}' = ldc* ]]; then
# avoid out-of-memory kills by using a single ninja job
echo "SCRIPT_CMD=cmd.exe //c call bootstrap.bat -j1" >> $GITHUB_ENV
else
echo "SCRIPT_CMD=cmd.exe //c call bootstrap.bat" >> $GITHUB_ENV
fi
else
echo "SCRIPT_CMD=./bootstrap.sh" >> $GITHUB_ENV
fi
Expand All @@ -95,5 +87,5 @@ jobs:
run: ${{ env.SCRIPT_CMD }}

- name: "LDC: Bootstrap with DC=ldmd2"
if: matrix.dc == 'ldc-beta'
if: startsWith(matrix.dc, 'ldc')
run: DC=ldmd2 ${{ env.SCRIPT_CMD }}
4 changes: 1 addition & 3 deletions bootstrap.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@echo off
setlocal

set BACKEND=%1
if "%BACKEND%" == "" set BACKEND=ninja

if "%DC%" == "" set DC=dmd

if exist bin rmdir /s /q bin
Expand All @@ -15,4 +13,4 @@ cd bin || exit /b

echo Running bootstrapped reggae with backend %BACKEND%
reggae -b "%BACKEND%" --dc="%DC%" .. || exit /b
%BACKEND% || exit /b
%BACKEND% %* || exit /b
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"excludedSourceFiles": ["payload/reggae/buildgen_main.d"],
"mainSourceFile": "src/reggae/reggae_main.d",
"dependencies": {
"dub": "~>1.32.1"
"dub": "~>1.33.1"
},
"subConfigurations": {
"dub": "library"
Expand Down
2 changes: 1 addition & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileVersion": 1,
"versions": {
"dub": "1.32.1",
"dub": "1.33.1",
"unit-threaded": "2.1.2"
}
}
4 changes: 3 additions & 1 deletion payload/reggae/dub/info.d
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct DubPackage {
string[] dflags;
string[] lflags;
string[] importPaths;
string[] cImportPaths;
string[] stringImportPaths;
string[] files;
TargetType targetType;
Expand Down Expand Up @@ -145,7 +146,8 @@ struct DubInfo {
import std.string: indexOf, stripRight;

const dubPackage = packages[dubPackageIndex];
const importPaths = dubPackage.packagePaths(dubPackage.importPaths);
const importPaths = dubPackage.packagePaths(
dubPackage.importPaths ~ dubPackage.cImportPaths);
const stringImportPaths = dubPackage.packagePaths(dubPackage.stringImportPaths);
const isMainPackage = dubPackageIndex == 0;
//the path must be explicit for the other packages, implicit for the "main"
Expand Down
2 changes: 1 addition & 1 deletion src/reggae/dub/interop/dublib.d
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class InfoGenerator: ProjectGenerator {

enum sameNameProperties = [
"mainSourceFile", "dflags", "lflags", "importPaths",
"stringImportPaths", "versions", "libs",
"cImportPaths", "stringImportPaths", "versions", "libs",
];
static foreach(prop; sameNameProperties) {
mixin(`pkg.`, prop, ` = newBuildSettings.`, prop, `;`);
Expand Down
3 changes: 2 additions & 1 deletion src/reggae/dub/interop/fetch.d
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ private bool pkgExistsOnFS(in VersionedPackage pkg) @safe {

return buildPath(
dubPackagesDir,
pkg.name ~ "-" ~ version_,
pkg.name,
version_,
pkg.name ~ ".lock"
).exists;
}

0 comments on commit 3b8b180

Please sign in to comment.