"dpkg-buildpackage -rfakeroot -d -us -uc -S"가 성공할 때 "debuild -S"가 "명령을 찾을 수 없음"과 함께 실패하는 원인은 무엇입니까?

"dpkg-buildpackage -rfakeroot -d -us -uc -S"가 성공할 때 "debuild -S"가 "명령을 찾을 수 없음"과 함께 실패하는 원인은 무엇입니까?

다음 스크립트를 고려해보세요.

#!/usr/bin/env bash

set -ex

wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.dsc
wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3.orig.tar.gz
wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.debian.tar.xz
dpkg-source -x ocaml-re_1.7.3-2.dsc
cd ocaml-re-1.7.3
dpkg-buildpackage -rfakeroot -d -us -uc -S || exit $?
debuild -S || exit $?

실행해보면 알겠지만

+ wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.dsc
--2018-10-28 20:29:03--  http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.dsc
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.162, 91.189.88.149, 91.189.91.23, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.162|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘ocaml-re_1.7.3-2.dsc’ not modified on server. Omitting download.

+ wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3.orig.tar.gz
--2018-10-28 20:29:03--  http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3.orig.tar.gz
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.152, 91.189.88.162, 91.189.88.149, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.152|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘ocaml-re_1.7.3.orig.tar.gz’ not modified on server. Omitting download.

+ wget -N http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.debian.tar.xz
--2018-10-28 20:29:03--  http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-re/ocaml-re_1.7.3-2.debian.tar.xz
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.152, 91.189.88.162, 91.189.88.149, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.152|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘ocaml-re_1.7.3-2.debian.tar.xz’ not modified on server. Omitting download.

+ dpkg-source -x ocaml-re_1.7.3-2.dsc
dpkg-source: warning: extracting unsigned source package (ocaml-re_1.7.3-2.dsc)
dpkg-source: info: extracting ocaml-re in ocaml-re-1.7.3
dpkg-source: info: unpacking ocaml-re_1.7.3.orig.tar.gz
dpkg-source: info: unpacking ocaml-re_1.7.3-2.debian.tar.xz
+ cd ocaml-re-1.7.3
+ dpkg-buildpackage -rfakeroot -d -us -uc -S
dpkg-buildpackage: source package ocaml-re
dpkg-buildpackage: source version 1.7.3-2
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Mehdi Dogguy <[email protected]>
 dpkg-source --before-build ocaml-re-1.7.3
 fakeroot debian/rules clean
dh clean --with ocaml
   dh_testdir
   dh_auto_clean
        make -j1 clean
make[1]: Entering directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
make[1]: Leaving directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
   dh_ocamlclean
   dh_clean
 dpkg-source -b ocaml-re-1.7.3
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building ocaml-re using existing ./ocaml-re_1.7.3.orig.tar.gz
dpkg-source: info: building ocaml-re in ocaml-re_1.7.3-2.debian.tar.xz
dpkg-source: info: building ocaml-re in ocaml-re_1.7.3-2.dsc
 dpkg-genchanges -S >../ocaml-re_1.7.3-2_source.changes
dpkg-genchanges: not including original source code in upload
 dpkg-source --after-build ocaml-re-1.7.3
dpkg-buildpackage: binary and diff upload (original source NOT included)
+ debuild -S
 dpkg-buildpackage -rfakeroot -d -us -uc -S
dpkg-buildpackage: source package ocaml-re
dpkg-buildpackage: source version 1.7.3-2
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Mehdi Dogguy <[email protected]>
 dpkg-source --before-build ocaml-re-1.7.3
 fakeroot debian/rules clean
dh clean --with ocaml
   dh_testdir
   dh_auto_clean
        make -j1 clean
make[1]: Entering directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
make[1]: jbuilder: Command not found
Makefile:12: recipe for target 'clean' failed
make[1]: *** [clean] Error 127
make[1]: Leaving directory '/home/jgross/Documents/repos/coq-debian-build-scripts/ocaml-stuff/debian-sources/foo/ocaml-re-1.7.3'
dh_auto_clean: make -j1 clean returned exit code 2
debian/rules:13: recipe for target 'clean' failed
make: *** [clean] Error 2

내가 혼란스러워하는 점은 jbuilder를 (opam을 통해) 설치했지만 제대로 debuild -S실행되고 성공한 것처럼 보이지만 찾을 수 없다는 것입니다 . dpkg-buildpackage -rfakeroot -d -us -uc -S여기서 무슨 일이 일어나고 있는 걸까요?

답변1

내가 찾은 매뉴얼 페이지를 읽은 후환경 변수 정보, 내용은 다음과 같습니다.

환경 변수는 패키지 빌드에 영향을 미칠 수 있기 때문에 디빌드는 종종 TERM, HOME, LOGNAME, GNUPGHOME, PGPPATH, GPG_AGENT_INFO, FAKEROOTKEY, DEB_*, ( C, CPP, CXX및 ) 변수와 해당 변수를 제외한 모든 환경 변수와 로케일 변수 및 환경을 제거하여 실수로 정리합니다. 설정되지 않은 경우 로 설정되고, 설정되지 않은 경우 로 설정됩니다.LDFFLAGS_APPENDLANGLC_*TERMdumbPATH"/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"

[...]

삭제된 PATH 시작 부분에 디렉터리를 추가하는 옵션이 있습니다 --prepend-path . 이는 ccache와 같은 도구를 사용하여 distcc빌드 하려는 경우 유용합니다.

따라서 문제는 opam 바이너리가 존재하므로 PATH여기에서 찾을 수 없다는 것입니다.

관련 정보