diff --git a/.github/workflows/build_release_template.yml b/.github/workflows/build_release_template.yml index a7b7f4a1..f01cd35e 100644 --- a/.github/workflows/build_release_template.yml +++ b/.github/workflows/build_release_template.yml @@ -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 @@ -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 @@ -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 # @@ -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 @@ -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 diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index d0531448..c1f28c9a 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -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/ diff --git a/create_dmd_release/build_all.d b/create_dmd_release/build_all.d index b54e8b25..2e9f093a 100644 --- a/create_dmd_release/build_all.d +++ b/create_dmd_release/build_all.d @@ -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"; @@ -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); @@ -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 @@ -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:"); diff --git a/create_dmd_release/create_dmd_release.d b/create_dmd_release/create_dmd_release.d index 6240cc3f..2311fa9b 100644 --- a/create_dmd_release/create_dmd_release.d +++ b/create_dmd_release/create_dmd_release.d @@ -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\" @@ -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) @@ -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) diff --git a/create_dmd_release/extras/all/dmd2/README.TXT b/create_dmd_release/extras/all/dmd2/README.TXT index 88ad3368..77b39d4d 100644 --- a/create_dmd_release/extras/all/dmd2/README.TXT +++ b/create_dmd_release/extras/all/dmd2/README.TXT @@ -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++-' package, -where '' varies by distribution but is usually '33'. - -Ubuntu 6.06+: - -You can get libstdc++.so.5 by installing 'libstdc++5'. - diff --git a/create_dmd_release/extras/windows/dmd2/windows/bin/README.TXT b/create_dmd_release/extras/windows/dmd2/windows/bin/README.TXT index e4845d2c..d34635ff 100644 --- a/create_dmd_release/extras/windows/dmd2/windows/bin/README.TXT +++ b/create_dmd_release/extras/windows/dmd2/windows/bin/README.TXT @@ -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 diff --git a/create_dmd_release/extras/windows/dmd2/windows/bin/sc.ini b/create_dmd_release/extras/windows/dmd2/windows/bin/sc.ini deleted file mode 100644 index ee9293b3..00000000 --- a/create_dmd_release/extras/windows/dmd2/windows/bin/sc.ini +++ /dev/null @@ -1,10 +0,0 @@ -[Version] -version=7.51 Build 020 - -[Environment] -LIB="%@P%\..\lib";\dm\lib -DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import" -LINKCMD=%@P%\link.exe -LINKCMD64=%VCINSTALLDIR%bin\amd64\link.exe -VCINSTALLDIR=%VCINSTALLDIR% -WindowsSdkDir=%WindowsSdkDir% diff --git a/create_dmd_release/extras/windows/dmd2/windows/bin64/README.TXT b/create_dmd_release/extras/windows/dmd2/windows/bin64/README.TXT new file mode 100644 index 00000000..6f9a8248 --- /dev/null +++ b/create_dmd_release/extras/windows/dmd2/windows/bin64/README.TXT @@ -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 diff --git a/create_dmd_release/extras/windows/dmd2/windows/lib/README.TXT b/create_dmd_release/extras/windows/dmd2/windows/lib/README.TXT deleted file mode 100644 index ed40270c..00000000 --- a/create_dmd_release/extras/windows/dmd2/windows/lib/README.TXT +++ /dev/null @@ -1,26 +0,0 @@ - -Windows Libraries ------------------ -phobos.lib D runtime library -snn.lib Digital Mars C/C++ runtime library - -Windows System API Libraries ----------------------------- -ctl3d32.lib -odbc32.lib -ws2_32.lib -oleaut32.lib -comctl32.lib -advapi32.lib -gdi32.lib -shell32.lib -rpcrt4.lib -wsock32.lib -winmm.lib -comdlg32.lib -ole32.lib -uuid.lib -winspool.lib -user32.lib -kernel32.lib - diff --git a/windows/d2-installer-descriptions.nsh b/windows/d2-installer-descriptions.nsh index e5ddb531..84bd43ec 100644 --- a/windows/d2-installer-descriptions.nsh +++ b/windows/d2-installer-descriptions.nsh @@ -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 @@ -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 diff --git a/windows/d2-installer.nsi b/windows/d2-installer.nsi index 33d54059..ce202968 100644 --- a/windows/d2-installer.nsi +++ b/windows/d2-installer.nsi @@ -41,14 +41,10 @@ ; Visual D !define VersionVisualD "1.3.1" -; DMC -!define VersionDMC "857" - ; Update Rarely Needed ; -------------------- ; Files !define VisualDFilename "VisualD-v${VersionVisualD}.exe" -!define DmcFilename "dmc-${VersionDMC}.exe" !define VS2013Filename "vs_community2013.exe" !define VS2017Filename "vs_community2017.exe" !define VS2017BTFilename "vs_BuildTools2017.exe" @@ -58,15 +54,10 @@ !define VCRedistx64Filename "vcredist_x64.exe" ; URLs -!define BaseURL "https://downloads.dlang.org" -!define BaseURLAlt "http://ftp.digitalmars.com" !define VisualDBaseURL "https://github.com/dlang/visuald/releases/download" !define VisualDUrl "${VisualDBaseURL}/v${VersionVisualD}/${VisualDFilename}" -!define DmcUrl "${BaseURL}/other/${DmcFilename}" -!define DmcAltUrl "${BaseURLAlt}/${DmcFilename}" - !define VS2013Url "http://go.microsoft.com/fwlink/?LinkId=517284" !define VS2017Url "https://download.visualstudio.microsoft.com/download/pr/100404311/045b56eb413191d03850ecc425172a7d/vs_Community.exe" !define VS2017BuildToolsUrl "https://download.visualstudio.microsoft.com/download/pr/100404314/e64d79b40219aea618ce2fe10ebd5f0d/vs_BuildTools.exe" @@ -317,11 +308,6 @@ SectionGroup /e "Extras" Section /o "Download Visual D" VisualDDownload !insertmacro DownloadAndRun ${VisualDFilename} ${VisualDUrl} "" SectionEnd - - - Section /o "Download DMC" DmcDownload - !insertmacro DownloadAndRun ${DmcFilename} ${DmcUrl} ${DmcAltUrl} - SectionEnd SectionGroupEnd ;--------------------------------------------------------