Skip to content

Commit 7130814

Browse files
authored
Merge pull request #6208 from kit-ty-kate/make-opam-stripped
Simplify the making of stripped binaries by introducing the 'make opam-stripped' target
2 parents b812814 + 575e916 commit 7130814

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

.github/scripts/main/main.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if [ $OPAM_UPGRADE -eq 1 ]; then
4242
fi
4343
# Disable implicit transitive deps
4444
sed -i -e '/(implicit_transitive_deps /s/true/false/' dune-project
45-
make all admin
45+
make all admin opam-stripped
4646
sed -i -e '/(implicit_transitive_deps /s/false/true/' dune-project
4747

4848
rm -f "$PREFIX/bin/opam"

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ ifneq ($(MANIFEST_ARCH),)
7171
@cd Opam.Runtime.$(MANIFEST_ARCH) && $(LN_S) -f ../_build/install/default/bin/Opam.Runtime.$(MANIFEST_ARCH)/$(RUNTIME_GCC_S).dll .
7272
endif
7373

74+
opam-stripped: $(DUNE_DEP) build-opam processed-opam.install
75+
@cp -f _build/default/src/client/opamMain.exe "$@$(EXE)"
76+
@chmod 755 "$@$(EXE)"
77+
strip "$@$(EXE)"
78+
7479
opam-installer: $(DUNE_DEP) build-opam-installer processed-opam-installer.install
7580
@$(LN_S) -f _build/default/src/tools/opam_installer.exe $@$(EXE)
7681

master_changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ users)
7878
* Fix the release script after the bump of dune lang to 2.6 [#6204 @kit-ty-kate]
7979
* Fix the release script after the introduction of opam\_core\_stubs [#6204 @kit-ty-kate]
8080
* Improve the release script by ignoring interactive questions asked by the FreeBSD package manager [#6204 @kit-ty-kate]
81+
* Simplify the making of stripped binaries by introducing the `make opam-stripped` target [#6208 @kit-ty-kate]
8182

8283
## Install script
8384
* Add 2.3.0\~alpha1 to the install scripts [#6203 @kit-ty-kate]

release/Dockerfile.in

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ CMD { tar xz && \
2626
cd opam-full-${VERSION} && \
2727
./configure --with-vendored-deps --with-mccs && \
2828
echo "(${LINKING})" > src/client/linking.sexp && \
29-
make opam && \
30-
chmod u+w _build/default/src/client/opamMain.exe && \
31-
strip opam ; \
29+
make opam-stripped ; \
3230
} >&2 && \
33-
cat opam
31+
cat opam-stripped

release/Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,9 @@ host: $(OUTDIR)/opam-full-$(VERSION).tar.gz build/$(HOST).env
121121
cd build/opam-full-$(VERSION) && \
122122
./configure --with-vendored-deps --with-mccs && \
123123
echo "$(call LINKING,$(HOST_OS))" >src/client/linking.sexp && \
124-
$(MAKE) opam; \
124+
$(MAKE) opam-stripped; \
125125
)
126-
chmod u+w build/opam-full-$(VERSION)/_build/default/src/client/opamMain.exe
127-
cp build/opam-full-$(VERSION)/opam $(OUTDIR)/opam-$(VERSION)-$(HOST)
128-
strip $(OUTDIR)/opam-$(VERSION)-$(HOST)
126+
cp build/opam-full-$(VERSION)/opam-stripped $(OUTDIR)/opam-$(VERSION)-$(HOST)
129127
$(OUTDIR)/opam-$(VERSION)-$(HOST) --version
130128
rm -rf build/opam-full-$(VERSION)
131129

0 commit comments

Comments
 (0)