Thank you for your replies.

I tyied `strip -s -o pandoc-small pandoc`, but get the same size pandoc-small.

I try to make_artifacts.sh in haskell docker:

```
docker run -it --rm --entrypoint=/bin/sh haskell:8.10.7
cd
git clone https://github.com/jgm/pandoc.git
cd pandoc
sh linux/make_artifacts.sh
```

but result:

```
/opt/ghc/8.10.7/lib/ghc-8.10.7/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC6ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCgetgrgidzur: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

rts/Linker.c:596:0: error:
     warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - pandoc-2.18 (test:test-pandoc) (ephemeral targets)
Preprocessing test suite 'test-pandoc' for pandoc-2.18..
Building test suite 'test-pandoc' for pandoc-2.18..
Running 1 test suites...
Test suite test-pandoc: RUNNING...
Test suite test-pandoc: PASS
Test suite logged to:
/root/pandoc/dist-newstyle/build/x86_64-linux/ghc-8.10.7/pandoc-2.18/t/test-pandoc/test/pandoc-2.18-test-pandoc.log
1 of 1 test suites (1 of 1 test cases) passed.
cp: cannot create regular file '/artifacts/': Not a directory
linux/make_artifacts.sh: 19: linux/make_artifacts.sh: cannot create /artifacts/DONE: Directory nonexistent
```
It seem not completed, I only find a very large pandoc in `/root/pandoc/dist-newstyle/build/x86_64-linux/ghc-8.10.7/pandoc-2.18/x/pandoc/build/pandoc/`

And, another problem, there's no make_artifacts.sh in pandoc-crossref. 

But I find .github/workflows in pandoc and pandoc-crossref project, maybe I can find out how to thrink the binary by study .github/workflows?

在2022年6月1日星期三 UTC+8 04:16:23<John MacFarlane> 写道:

It could be that the -split-sections option is responsible
for some of the shrinking.

Albert Krewinkel <albert...-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> writes:

> A jeep <aje...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> I'm not familiar with Haskell.
>>
>> In my utuntu 20.04, I `stack install pandoc pandoc-crossref`, the
>> result exec files are very larger then official release:
>>
>> [...]
>>
>> How can I shrink the exec files to pandoc official release file size?
>
> The main trick is to use `strip`, a tool to remove debug symbols and
> other data that's not required.
>
> See also the script linux/make_artifacts.sh, which is used to generate
> the official release binaries.
>
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/871qwa6x1n.fsf%40zeitkraut.de.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ed5f6fb7-80cb-4435-bea9-772fb428e78cn%40googlegroups.com.