From 6639f7e309a9984b2764bf23d05b59de76db14f5 Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 10 Feb 2025 10:35:23 +0100 Subject: [PATCH] Additional fixes --- .github/actions/setup-matlab/action.yml | 2 +- .github/workflows/build-matlab-packages.yml | 4 +- .github/workflows/build-npm-packages.yml | 7 ++- js/gulpfile.js | 1 + matlab/Makefile | 6 +++ matlab/msbuild/ice.proj | 54 +++++++++------------ packaging/rpm/build-package.sh | 8 +-- packaging/rpm/ice.spec | 51 +++++++++---------- 8 files changed, 72 insertions(+), 61 deletions(-) diff --git a/.github/actions/setup-matlab/action.yml b/.github/actions/setup-matlab/action.yml index fa9c7f1a28c..bab92574bb3 100644 --- a/.github/actions/setup-matlab/action.yml +++ b/.github/actions/setup-matlab/action.yml @@ -48,4 +48,4 @@ runs: Invoke-WebRequest https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/win64/run-matlab-command.exe -OutFile C:\Windows\System32\run-matlab-command.exe echo "MATLAB_COMMAND=C:\Windows\System32\run-matlab-command.exe" >> $env:GITHUB_ENV shell: powershell - if: runner.os == 'Windows' && matrix.config == 'matlab' + if: runner.os == 'Windows' diff --git a/.github/workflows/build-matlab-packages.yml b/.github/workflows/build-matlab-packages.yml index 8b8a41ac8e8..d53d31d394d 100644 --- a/.github/workflows/build-matlab-packages.yml +++ b/.github/workflows/build-matlab-packages.yml @@ -25,7 +25,9 @@ jobs: use_matlab: true - name: Build MATLAB ToolBox - run: make -C matlab toolbox + run: | + make -C cpp srcs + make -C matlab toolbox if: runner.os == 'Linux' - name: Build MATLAB ToolBox diff --git a/.github/workflows/build-npm-packages.yml b/.github/workflows/build-npm-packages.yml index d117a00273b..79660280461 100644 --- a/.github/workflows/build-npm-packages.yml +++ b/.github/workflows/build-npm-packages.yml @@ -86,7 +86,12 @@ jobs: working-directory: ice/js - name: Pack npm - run: npm pack + run: | + if [ ! -f "$GITHUB_WORKSPACE/ice/cpp/bin/slice2js" ]; then + echo "Error: slice2js binary is missing in cpp/bin" + exit 1 + fi + npm pack working-directory: ice/js - name: Upload NPM Packages diff --git a/js/gulpfile.js b/js/gulpfile.js index b5d541a55d5..19cf1d2c3e9 100644 --- a/js/gulpfile.js +++ b/js/gulpfile.js @@ -58,6 +58,7 @@ function slice2js(options) { defaults.jsbundle = opts.jsbundle; defaults.tsbundle = opts.tsbundle; defaults.jsbundleFormat = opts.jsbundleFormat; + console.log("Running iceBuilder with defaults", defaults); return iceBuilder(defaults); } diff --git a/matlab/Makefile b/matlab/Makefile index 6ddff780802..b2d079dc573 100644 --- a/matlab/Makefile +++ b/matlab/Makefile @@ -115,9 +115,15 @@ $(icetoolbox_file):: $(icethunk_target) $(slice2matlab_path) $(lang_srcdir)/lib/ cp -rf $(cpp_bindir)/slice2matlab $(lang_srcdir)/toolbox/build/ # Doc files cp -rf $(lang_srcdir)/toolbox/doc $(lang_srcdir)/toolbox/build +ifneq (,$(MATLAB_COMMAND)) + cd $(lang_srcdir)/toolbox && $(MATLAB_COMMAND) "addFolderToPath '`realpath build`'" + cd $(lang_srcdir)/toolbox && $(MATLAB_COMMAND) "buildToolbox '$(version)'" + cd $(lang_srcdir)/toolbox && $(MATLAB_COMMAND) "removeFolderFromPath '`realpath build`'" +else cd $(lang_srcdir)/toolbox && $(MATLAB_HOME)/bin/matlab -nodisplay -r "addFolderToPath '`realpath build`'" cd $(lang_srcdir)/toolbox && $(MATLAB_HOME)/bin/matlab -nodisplay -r "buildToolbox '$(version)'" cd $(lang_srcdir)/toolbox && $(MATLAB_HOME)/bin/matlab -nodisplay -r "removeFolderFromPath '`realpath build`'" +endif clean:: rm -rf $(icetoolbox_file) diff --git a/matlab/msbuild/ice.proj b/matlab/msbuild/ice.proj index 59f4028d5c3..b504e630ecd 100644 --- a/matlab/msbuild/ice.proj +++ b/matlab/msbuild/ice.proj @@ -6,36 +6,30 @@ Release $([System.IO.Path]::GetFullPath( $(MSBuildThisFileDirectory)..\msbuild )) $(MSBuildThisFileDirectory)..\toolbox\build + R2024a + C:\Program Files\MATLAB\$(MatlabVersion) + + $(MATLAB_VERSION) + $(MATLAB_HOME) + + + + $(MATLAB_COMMAND) + + + + + "$(MatlabHome)\bin\matlab.exe" -nodesktop -nosplash -wait -log -minimize + + + + - - - - - - $(MatlabExe.Split(';')[0]) - - - - - - - - - - - - - - - - @@ -47,7 +41,7 @@ Properties="Platform=$(Platform);Configuration=$(Configuration)" /> - + @@ -105,7 +99,7 @@ - + @@ -124,14 +118,14 @@ + Replacements="$(MatlabVersion)"/> - - - diff --git a/packaging/rpm/build-package.sh b/packaging/rpm/build-package.sh index eebcabc22e4..7e48494bb58 100755 --- a/packaging/rpm/build-package.sh +++ b/packaging/rpm/build-package.sh @@ -21,14 +21,16 @@ if [[ -z "${TARGET_ARCH:-}" || ! " ${VALID_ARCHS[@]} " =~ " ${TARGET_ARCH} " ]]; fi # Define common RPM macros -RPM_MACROS="-D '_topdir $RPM_BUILD_ROOT' -D 'vendor ZeroC, Inc.'" +RPM_MACROS=() +RPM_MACROS+=(-D "_topdir $RPM_BUILD_ROOT") +RPM_MACROS+=(-D "vendor ZeroC, Inc.") # Download sources cd "$RPM_BUILD_ROOT/SOURCES" spectool -g "$ICE_SPEC_DEST" || { echo "Error: Failed to download sources."; exit 1; } # Build source RPM -rpmbuild -bs "$ICE_SPEC_DEST" $RPM_MACROS --target="$TARGET_ARCH" +rpmbuild -bs "$ICE_SPEC_DEST" "${RPM_MACROS[@]}" --target="$TARGET_ARCH" # Build binary RPM -rpmbuild -bb "$ICE_SPEC_DEST" $RPM_MACROS --target="$TARGET_ARCH" +rpmbuild -bb "$ICE_SPEC_DEST" "${RPM_MACROS[@]}" --target="$TARGET_ARCH" diff --git a/packaging/rpm/ice.spec b/packaging/rpm/ice.spec index d7e727ab41f..3667427c054 100644 --- a/packaging/rpm/ice.spec +++ b/packaging/rpm/ice.spec @@ -14,8 +14,6 @@ %define archive_dir_suffix main %endif -%define rpmbuildfiles ice-%{archive_dir_suffix}/packaging/rpm - %define shadow shadow-utils %define javapackagestools javapackages-tools # Unfortunately bzip2-devel does not provide pkgconfig(bzip2) as of EL7 @@ -393,7 +391,7 @@ export LDFLAGS="%{?__global_ldflags}" # php ice.ini # mkdir -p %{buildroot}%{_sysconfdir}/php.d -cp -p %{rpmbuildfiles}/ice.ini %{buildroot}%{_sysconfdir}/php.d +cp -p packaging/rpm/ice.ini %{buildroot}%{_sysconfdir}/php.d # # systemd files (for servers) @@ -401,21 +399,22 @@ cp -p %{rpmbuildfiles}/ice.ini %{buildroot}%{_sysconfdir}/php.d mkdir -p %{buildroot}%{_sysconfdir} for i in icegridregistry icegridnode glacier2router do - cp %{rpmbuildfiles}/$i.conf %{buildroot}%{_sysconfdir} - install -m 644 -p -D %{rpmbuildfiles}/$i.service %{buildroot}%{_unitdir}/$i.service + cp packaging/rpm/$i.conf %{buildroot}%{_sysconfdir} + install -m 644 -p -D packaging/rpm/$i.service %{buildroot}%{_unitdir}/$i.service done # # IceGridGUI # mkdir -p %{buildroot}%{_bindir} -cp -p %{rpmbuildfiles}/icegridgui %{buildroot}%{_bindir}/icegridgui +cp -p packaging/rpm/icegridgui %{buildroot}%{_bindir}/icegridgui %else # These directories and files aren't needed in the x86 build. rm -f %{buildroot}%{_libdir}/libGlacier2CryptPermissionsVerifier.so* rm -f %{buildroot}%{_bindir}/slice2* +rm -f %{buildroot}%{_bindir}/ice2slice* rm -rf %{buildroot}%{_includedir} rm -rf %{buildroot}%{_mandir} rm -rf %{buildroot}%{_datadir}/ice @@ -431,15 +430,15 @@ rm -rf %{buildroot}%{_datadir}/ice %files -n %{?nameprefix}ice-slice %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %dir %{_datadir}/ice %{_datadir}/ice/slice %files -n %{?nameprefix}icegridgui %license LICENSE %license ICE_LICENSE -%license %{rpmbuildfiles}/JGOODIES_LICENSE -%doc %{rpmbuildfiles}/README +%license packaging/rpm/JGOODIES_LICENSE +%doc packaging/rpm/README %attr(755,root,root) %{_bindir}/icegridgui %{_javadir}/icegridgui.jar @@ -455,7 +454,7 @@ rm -rf %{buildroot}%{_datadir}/ice %files -n %{?nameprefix}ice-all-runtime %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README # # Generate "ice-all-devel" meta package as arch-specific @@ -463,7 +462,7 @@ rm -rf %{buildroot}%{_datadir}/ice %files -n %{?nameprefix}ice-all-devel %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README # # libice-Mm-c++ package @@ -471,9 +470,9 @@ rm -rf %{buildroot}%{_datadir}/ice %files -n lib%{?nameprefix}ice3.8-c++ %license LICENSE %license ICE_LICENSE -%license %{rpmbuildfiles}/LMDB_LICENSE -%license %{rpmbuildfiles}/MCPP_LICENSE -%doc %{rpmbuildfiles}/README +%license packaging/rpm/LMDB_LICENSE +%license packaging/rpm/MCPP_LICENSE +%doc packaging/rpm/README %{_libdir}/libGlacier2.so.* %{_libdir}/libIce.so.* %{_libdir}/libIceBox.so.* @@ -496,7 +495,7 @@ exit 0 %files -n %{?nameprefix}icebox %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %ifarch %{_host_cpu} %{_bindir}/icebox %{_mandir}/man1/icebox.1* @@ -516,7 +515,7 @@ exit 0 %files -n lib%{?nameprefix}ice-c++-devel %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{_libdir}/libGlacier2.so %{_libdir}/libIce.so %{_libdir}/libIceBox.so @@ -538,7 +537,7 @@ exit 0 %files -n lib%{?nameprefix}icestorm3.8 %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{_libdir}/libIceStormService.so.* %post -n lib%{?nameprefix}icestorm3.8 -p /sbin/ldconfig %postun -n lib%{?nameprefix}icestorm3.8 @@ -553,8 +552,8 @@ exit 0 %files -n %{?nameprefix}ice-compilers %license LICENSE %license ICE_LICENSE -%license %{rpmbuildfiles}/MCPP_LICENSE -%doc %{rpmbuildfiles}/README +%license packaging/rpm/MCPP_LICENSE +%doc packaging/rpm/README %{_bindir}/slice2cpp %{_mandir}/man1/slice2cpp.1* %{_bindir}/slice2cs @@ -573,6 +572,8 @@ exit 0 %{_mandir}/man1/slice2rb.1* %{_bindir}/slice2swift %{_mandir}/man1/slice2swift.1* +%{_bindir}/ice2slice +%{_mandir}/man1/ice2slice.1* # # ice-utils package @@ -580,7 +581,7 @@ exit 0 %files -n %{?nameprefix}ice-utils %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{_bindir}/iceboxadmin %{_mandir}/man1/iceboxadmin.1* %{_bindir}/icestormadmin @@ -602,7 +603,7 @@ exit 0 %files -n %{?nameprefix}icegrid %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{_bindir}/icegridnode %{_mandir}/man1/icegridnode.1* %{_bindir}/icegridregistry @@ -653,7 +654,7 @@ exit 0 %files -n %{?nameprefix}glacier2 %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{_bindir}/glacier2router %{_mandir}/man1/glacier2router.1* %attr(644,root,root) %{_unitdir}/glacier2router.service @@ -692,7 +693,7 @@ exit 0 %files -n %{?nameprefix}icebridge %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{_bindir}/icebridge %{_mandir}/man1/icebridge.1* %post -n %{?nameprefix}icebridge -p /sbin/ldconfig @@ -706,7 +707,7 @@ exit 0 %files -n php-%{?nameprefix}ice %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{phpdir} %{phplibdir}/ice.so %config(noreplace) %{_sysconfdir}/php.d/ice.ini @@ -717,7 +718,7 @@ exit 0 %files -n python3-%{?nameprefix}ice %license LICENSE %license ICE_LICENSE -%doc %{rpmbuildfiles}/README +%doc packaging/rpm/README %{python3_sitearch}/* %endif #%{_host_cpu}