Skip to content

Commit

Permalink
Merge pull request #6208 from kit-ty-kate/make-opam-stripped
Browse files Browse the repository at this point in the history
Simplify the making of stripped binaries by introducing the 'make opam-stripped' target
  • Loading branch information
kit-ty-kate authored Sep 30, 2024
2 parents b812814 + 575e916 commit 7130814
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/main/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ $OPAM_UPGRADE -eq 1 ]; then
fi
# Disable implicit transitive deps
sed -i -e '/(implicit_transitive_deps /s/true/false/' dune-project
make all admin
make all admin opam-stripped
sed -i -e '/(implicit_transitive_deps /s/false/true/' dune-project

rm -f "$PREFIX/bin/opam"
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ ifneq ($(MANIFEST_ARCH),)
@cd Opam.Runtime.$(MANIFEST_ARCH) && $(LN_S) -f ../_build/install/default/bin/Opam.Runtime.$(MANIFEST_ARCH)/$(RUNTIME_GCC_S).dll .
endif

opam-stripped: $(DUNE_DEP) build-opam processed-opam.install
@cp -f _build/default/src/client/opamMain.exe "$@$(EXE)"
@chmod 755 "$@$(EXE)"
strip "$@$(EXE)"

opam-installer: $(DUNE_DEP) build-opam-installer processed-opam-installer.install
@$(LN_S) -f _build/default/src/tools/opam_installer.exe $@$(EXE)

Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ users)
* Fix the release script after the bump of dune lang to 2.6 [#6204 @kit-ty-kate]
* Fix the release script after the introduction of opam\_core\_stubs [#6204 @kit-ty-kate]
* Improve the release script by ignoring interactive questions asked by the FreeBSD package manager [#6204 @kit-ty-kate]
* Simplify the making of stripped binaries by introducing the `make opam-stripped` target [#6208 @kit-ty-kate]

## Install script
* Add 2.3.0\~alpha1 to the install scripts [#6203 @kit-ty-kate]
Expand Down
6 changes: 2 additions & 4 deletions release/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ CMD { tar xz && \
cd opam-full-${VERSION} && \
./configure --with-vendored-deps --with-mccs && \
echo "(${LINKING})" > src/client/linking.sexp && \
make opam && \
chmod u+w _build/default/src/client/opamMain.exe && \
strip opam ; \
make opam-stripped ; \
} >&2 && \
cat opam
cat opam-stripped
6 changes: 2 additions & 4 deletions release/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ host: $(OUTDIR)/opam-full-$(VERSION).tar.gz build/$(HOST).env
cd build/opam-full-$(VERSION) && \
./configure --with-vendored-deps --with-mccs && \
echo "$(call LINKING,$(HOST_OS))" >src/client/linking.sexp && \
$(MAKE) opam; \
$(MAKE) opam-stripped; \
)
chmod u+w build/opam-full-$(VERSION)/_build/default/src/client/opamMain.exe
cp build/opam-full-$(VERSION)/opam $(OUTDIR)/opam-$(VERSION)-$(HOST)
strip $(OUTDIR)/opam-$(VERSION)-$(HOST)
cp build/opam-full-$(VERSION)/opam-stripped $(OUTDIR)/opam-$(VERSION)-$(HOST)
$(OUTDIR)/opam-$(VERSION)-$(HOST) --version
rm -rf build/opam-full-$(VERSION)

Expand Down

0 comments on commit 7130814

Please sign in to comment.