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 Jul 1, 2024
2 parents bd13bfa + 764e4d9 commit ff722ae
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 216 deletions.
57 changes: 25 additions & 32 deletions .github/workflows/build_release_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
for REPO in dmd phobos
do
REV=$( git -C $REPO rev-parse HEAD )
echo "::set-output name=$REPO-revision::$REV"
echo "$REPO-revision=$REV" >> $GITHUB_OUTPUT
done
runs-on: ubuntu-latest
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
set -euox pipefail
# Fetch GPG key used to sign the generated binaries
curl https://dlang.org/d-keyring.gpg -o d-keyring.gpg
curl -fsS https://dlang.org/d-keyring.gpg -o d-keyring.gpg
gpg --import d-keyring.gpg
# Compile release builder
Expand All @@ -227,40 +227,33 @@ jobs:
# Determine installed LDC version
LDC=$(head -n 1 < <(ldc2 --version) | cut -d'(' -f2 | cut -d')' -f1)
# WINDOWS: Fetch additional DM tools
# Windows: set LDC_VSDIR
if [[ "${{ matrix.target }}" == "windows" ]]
then
# Fetch DMC (incl. DM make and sppn.exe)
curl https://downloads.dlang.org/other/dm857c.zip -o dmc.zip
7z x dmc.zip
curl http://ftp.digitalmars.com/sppn.zip -o sppn.zip
7z x -odm/bin sppn.zip
# Fetch implib
curl http://ftp.digitalmars.com/bup.zip -o bup.zip
7z x bup.zip dm/bin/implib.exe
# Add DM binaries to the path
export PATH="$PWD/dm/bin;$PATH"
# Export VS dir
export LDC_VSDIR='C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise'
fi
# Workaround: Provide ldmd2 as dmd replacement as some tools assume DMD is present:
mkdir .pathext
ln -s "$(which ldmd2)" .pathext/dmd
if [[ "${{ matrix.target }}" == "windows" ]]
then
PATH="$PATH;$PWD/.pathext"
else
PATH="$PATH:$PWD/.pathext"
fi
# Build the release
./build_all --targets=${{ matrix.target }} "v$LDC" ${{ inputs.release_branch }}
- name: 'Windows: Build NSIS installer'
if: matrix.target == 'windows'
shell: cmd
run: |
:: install NSIS plugin from https://nsis.sourceforge.io/Inetc_plug-in
curl -fsSL https://nsis.sourceforge.io/mediawiki/images/c/c9/Inetc.zip -o inetc.zip || exit /b
7z x inetc.zip -y -bb1 "-oc:\Program Files (x86)\NSIS" || exit /b
:: unpack release .7z generated in previous step
7z x create_dmd_release\build\dmd.${{ inputs.release_branch }}.windows.7z -odmd.windows || exit /b
@echo on
"c:\Program Files (x86)\NSIS\makensis" /version
for /f %%v in (dmd.windows\dmd2\src\VERSION) do set ver=%%v
cd windows || exit /b
"c:\Program Files (x86)\NSIS\makensis" /DVersion2=%ver% /DEmbedD2Dir=..\dmd.windows\dmd2 d2-installer.nsi || exit /b
copy dmd-*.exe ..\create_dmd_release\build || exit /b
#################################################################
# FREEBSD: Build for the current target using build_all.d from installer
#
Expand All @@ -280,11 +273,11 @@ jobs:
sudo pkg install -y curl curlpp git gmake pkgconf gnupg rsync llvm
# Import key used to sign binaries
curl https://dlang.org/d-keyring.gpg -o d-keyring.gpg
curl -fsS https://dlang.org/d-keyring.gpg -o d-keyring.gpg
gpg d-keyring.gpg
# Install ldc
curl https://dlang.org/install.sh -o install.sh
curl -fsS https://dlang.org/install.sh -o install.sh
bash install.sh ldc -p .
# Use absolute paths because activate doesn't work correctly
Expand All @@ -310,8 +303,8 @@ jobs:
with:
name: dmd-release-${{ matrix.target }}
path: |
${{ github.workspace }}/create_dmd_release/build/*
!${{ github.workspace }}/create_dmd_release/build/*.zip
create_dmd_release/build/*
!create_dmd_release/build/*.zip
retention-days: 1
if-no-files-found: error

Expand Down
94 changes: 0 additions & 94 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,97 +72,3 @@ jobs:
with:
name: curl
path: artifacts/

build_docs:
name: Build docs
runs-on: ubuntu-20.04
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Clone repos
run: |
set -eux
git clone --branch $BRANCH https://github.com/dlang/dlang.org.git work/dlang.org
git clone --branch $BRANCH https://github.com/dlang/dmd.git work/dmd
git clone --branch $BRANCH https://github.com/dlang/phobos.git work/phobos
- name: Build docs
run: make -C work/dlang.org -f posix.mak release
- name: Zip
run: |
set -eux
mkdir -p work/docs
zip -r work/docs/docs.zip work/dlang.org/web
- uses: actions/upload-artifact@v4
with:
name: docs
path: work/docs

build_release:
name: Build release
runs-on: windows-2019
timeout-minutes: 120
needs: build_docs
env:
LDC_VSDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
HOST_LDC_VERSION: 1.23.0
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs
path: docs/
- name: Install prerequisites
shell: bash
run: |
set -eux
powershell -command "& { iwr https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-windows-multilib.7z -OutFile ldc.7z }"
7z x ldc.7z
mv ldc2-$HOST_LDC_VERSION-windows-multilib ldc2
powershell -command "& { iwr https://downloads.dlang.org/other/dm857c.zip -OutFile dmc.zip }"
7z x dmc.zip
powershell -command "& { iwr http://ftp.digitalmars.com/sppn.zip -OutFile sppn.zip }"
7z x -odm/bin sppn.zip
powershell -command "& { iwr http://ftp.digitalmars.com/bup.zip -OutFile bup.zip }"
7z x bup.zip dm/bin/implib.exe
powershell -command "& { iwr https://nsis.sourceforge.io/mediawiki/images/c/c9/Inetc.zip -OutFile inetc.zip }"
7z x inetc.zip -y -bb1 '-oc:\Program Files (x86)\NSIS'
- name: Unzip docs
shell: bash
run: |
set -eux
unzip docs/docs.zip
mv work/dlang.org/web create_dmd_release/docs
- name: Build release
shell: bash
run: |
set -eux
powershell -command "& { iwr https://dlang.org/d-keyring.gpg -OutFile d-keyring.gpg }"
gpg --import d-keyring.gpg
export PATH="$PWD/dm/bin:$PATH"
cd create_dmd_release
../ldc2/bin/ldmd2 -g build_all.d common.d -version=NoVagrant
cp ../ldc2/bin/libcurl.dll .
./build_all v$HOST_LDC_VERSION $BRANCH
- name: Unzip build
shell: bash
run: 7z x create_dmd_release/build/dmd.$BRANCH.windows.zip -odmd.$BRANCH.windows
- name: Build installer
shell: cmd
run: |
@echo on
"c:\Program Files (x86)\NSIS\makensis" /version
for /f %%v in (dmd.%BRANCH%.windows\dmd2\src\version) do set ver=%%v
cd windows || exit /b
"c:\Program Files (x86)\NSIS\makensis" /DVersion2=%ver% /DEmbedD2Dir=..\dmd.%BRANCH%.windows\dmd2 d2-installer.nsi || exit /b
cd .. || exit /b
mkdir artifacts || exit /b
copy windows\*.exe artifacts || exit /b
- uses: actions/upload-artifact@v4
with:
name: win_release
path: artifacts/
8 changes: 1 addition & 7 deletions create_dmd_release/build_all.d
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ int main(string[] args)
immutable isPreRelease = isBranch || !verMatch.captures[4].empty;
immutable dubTag = isBranch ? gitTag : getDubTag(isPreRelease);

enum libC = "snn.lib";
enum libCurl = "libcurl-7.68.0-WinSSL-zlib-x86-x64.zip";
enum mingwtag = "mingw-libs-8.0.0";
enum mingwlibs = mingwtag ~ ".zip"; enum mingw_sha = hexString!"8c1619234ca8370b742a08a30b13bf9bdb333f842ed0ea02cafe9054c68adc97";
Expand All @@ -598,7 +597,6 @@ int main(string[] args)
const hasWindows = platforms.any!(p => p.os == OS.windows);
if (hasWindows)
{
fetchFile("http://ftp.digitalmars.com/"~libC, cacheDir~"/"~libC);
fetchFile("https://downloads.dlang.org/other/"~libCurl, cacheDir~"/"~libCurl, verifySignature);
fetchFile("https://downloads.dlang.org/other/"~lld, cacheDir~"/"~lld, verifySignature, lld_sha);
fetchFile("https://downloads.dlang.org/other/"~lld64, cacheDir~"/"~lld64, verifySignature, lld64_sha);
Expand Down Expand Up @@ -626,10 +624,6 @@ int main(string[] args)

if (hasWindows)
{
if (exists(workDir~"/windows/extraBins/dmd2/windows/bin/link.exe"))
remove(workDir~"/windows/extraBins/dmd2/windows/bin/link.exe");
// add latest dmc libC (snn.lib)
copyFile(cacheDir~"/"~libC, workDir~"/windows/extraBins/dmd2/windows/lib/"~libC);
// add libcurl build for windows
extract(cacheDir~"/"~libCurl, workDir~"/windows/extraBins/");
// add mingw coff libraries
Expand All @@ -656,7 +650,7 @@ int main(string[] args)
scp(toCopy, "default:");
if (os != OS.linux && !skipDocs) scp(workDir~"/docs", "default:");
// copy create_dmd_release.d and dependencies
scp("create_dmd_release.d common.d", "default:");
scp("create_dmd_release.d common.d extras", "default:");
version (CodeSign) if (!isBranch)
scp(workDir~"/codesign codesign", "default:");

Expand Down
12 changes: 6 additions & 6 deletions create_dmd_release/create_dmd_release.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ Prerequisites to Run:
- Git
- Posix: Working gcc toolchain, including GNU make which is not installed on
FreeBSD by default. On OSX, you can install the gcc toolchain through Xcode.
- Windows: Working DMC (incl. sppn.exe and implib.exe) and 32/64-bit MSVC
toolchains. dmc.exe, DM lib.exe, sppn.exe and implib.exe must be found in PATH,
so it's recommended to set the DMC bin dir as *first* dir in PATH.
Also, this environment variable must be set:
- Windows: Working 32/64-bit MSVC toolchains. Also, this environment variable
must be set:
LDC_VSDIR: Visual Studio directory containing the MSVC toolchains
Examples:
set LDC_VSDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\"
Expand Down Expand Up @@ -277,8 +275,8 @@ void init(string branch)
releaseLib32Dir = osDir ~ "/lib" ~ suffix32;
releaseBin64Dir = osDir ~ "/bin" ~ suffix64;
releaseLib64Dir = osDir ~ "/lib" ~ suffix64;
allExtrasDir = cloneDir ~ "/installer/create_dmd_release/extras/all";
osExtrasDir = cloneDir ~ "/installer/create_dmd_release/extras/" ~ osDirName;
allExtrasDir = origDir ~ "/extras/all";
osExtrasDir = origDir ~ "/extras/" ~ osDirName;
}

void cleanAll(string branch)
Expand Down Expand Up @@ -510,6 +508,8 @@ void createRelease(string branch)
if(do32Bit)
{
copyFile(cloneDir~"/dmd/generated/"~osDirName~"/release/32/dmd"~exe, releaseBin32Dir~"/dmd"~exe);
version(Windows)
copyFile(cloneDir~"/dmd/compiler/ini/windows/bin/sc.ini", releaseBin32Dir~"/sc.ini");
copyDir(cloneDir~"/tools/generated/"~osDirName~"/32", releaseBin32Dir, file => !file.endsWith(obj));
copyFile(cloneDir~"/dub/bin/dub32"~exe, releaseBin32Dir~"/dub"~exe);
if (codesign)
Expand Down
21 changes: 0 additions & 21 deletions create_dmd_release/extras/all/dmd2/README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,3 @@
Digital Mars D Compiler Package
-------------------------------

Windows Programmers:
--------------------

Be sure and also download and install the Digital Mars C/C++ compiler
toolset ftp://ftp.digitalmars.com/dmc.zip, which contains the linker
and necessary libraries.

Linux Programmers:
------------------

You may need to install libstdc++.so.5.

Fedora 6+:

You can get libstdc++.so.5 by installing the 'compat-libstdc++-<XX>' package,
where '<XX>' varies by distribution but is usually '33'.

Ubuntu 6.06+:

You can get libstdc++.so.5 by installing 'libstdc++5'.

4 changes: 0 additions & 4 deletions create_dmd_release/extras/windows/dmd2/windows/bin/README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ sc.ini D compiler configuration file http://dlang.org/dmd-windows.html#sc_ini
ddemangle.exe D symbol demangler
dub.exe D's package manager https://github.com/dlang/dub
dustmite.exe D source code minimizer https://github.com/CyberShadow/DustMite
lib.exe Librarian http://www.digitalmars.com/ctg/lib.html
libcurl.dll Curl Library https://curl.haxx.se/
lld-link.exe LLVM Linker https://lld.llvm.org/
make.exe Make program http://www.digitalmars.com/ctg/make.html
rdmd.exe Run D program as a script http://dlang.org/rdmd.html
replace.exe Find/replace text in file(s)
shell.exe Test script runner http://www.digitalmars.com/ctg/shell.html
10 changes: 0 additions & 10 deletions create_dmd_release/extras/windows/dmd2/windows/bin/sc.ini

This file was deleted.

12 changes: 12 additions & 0 deletions create_dmd_release/extras/windows/dmd2/windows/bin64/README.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

Win64 files
-----------

dmd.exe D compiler http://dlang.org/dmd-windows.html
sc.ini D compiler configuration file http://dlang.org/dmd-windows.html#sc_ini
ddemangle.exe D symbol demangler
dub.exe D's package manager https://github.com/dlang/dub
dustmite.exe D source code minimizer https://github.com/CyberShadow/DustMite
libcurl.dll Curl Library https://curl.haxx.se/
lld-link.exe LLVM Linker https://lld.llvm.org/
rdmd.exe Run D program as a script http://dlang.org/rdmd.html
26 changes: 0 additions & 26 deletions create_dmd_release/extras/windows/dmd2/windows/lib/README.TXT

This file was deleted.

2 changes: 0 additions & 2 deletions windows/d2-installer-descriptions.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ LangString DESC_SMShortcuts ${LANG_ENGLISH} "Add Shortcuts to the Start Menu to
LangString DESC_AddD2ToPath ${LANG_ENGLISH} "Modify the PATH environment variable so DMD can be used from any command prompt"

LangString DESC_VisualDDownload ${LANG_ENGLISH} "Visual Studio package providing both project management and language services. It works with Visual Studio 2008-2017 (and the free VS Shells)"
LangString DESC_DmcDownload ${LANG_ENGLISH} "Digital Mars C/C++ compiler"


; Shortcuts
Expand All @@ -23,5 +22,4 @@ LangString SHORTCUT_Uninstall ${LANG_ENGLISH} "Uninstall"
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortcuts} $(DESC_SMShortcuts)
!insertmacro MUI_DESCRIPTION_TEXT ${AddD2ToPath} $(DESC_AddD2ToPath)
!insertmacro MUI_DESCRIPTION_TEXT ${VisualDDownload} $(DESC_VisualDDownload)
!insertmacro MUI_DESCRIPTION_TEXT ${DmcDownload} $(DESC_DmcDownload)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Loading

0 comments on commit ff722ae

Please sign in to comment.