I have bootstraped an EPREFIX installation on the system described at http://wiki.gentoo.org/wiki/Raspberry_Pi_Quick_Install_Guide During the bootstrap, `use prefix` returns false; and IUSE is empty. I have patched =app-admin/eselect-python-20111108.ebuild (and also portage*.ebuild) to work around this problem. The patch is attached. My $EPREFIX/etc/make.conf contains only one line, which is LDFLAGS="-Wl,-dynamic-linker=$EPREFIX/lib/ld-linux-armhf.so.3,-O1,--as-needed" The exact line running emerge is: CONFIG_SHELL=/data/data/com.spartacusrex.spartacuside/gentoo_armv6l/bin/sh FEATURES=-sandbox emerge -v eselect-python Please tell me if this patch is the correct way to go (which I doubt), or not. Reproducible: Always Steps to Reproduce: 1. Prepare the system described at http://wiki.gentoo.org/wiki/Raspberry_Pi_Quick_Install_Guide 2. bootstrap a EPREFIX installation following http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/bootstrap-prefix.sh?format=txt 3. the condition "use prefix" is false when building =app-admin/eselect-python-20111108 Actual Results: `use prefix` returns false. Expected Results: use prefix should return true. Context: I am developping a working portage installation on unrooted Android jelly bean (see gentooandroid.sourceforge.net for an early version) in alpha stage.
Created attachment 353010 [details, diff] patch to =app-admin/eselect-python-20111108.ebuild The variable EPREFIX is set so I test it.
Created attachment 353012 [details] emerge --info '=app-admin/eselect-python-20111108' on the raspberry powered by gentoo This emerge --invo is abount one installation on which I had to correct this bug.
Created attachment 353014 [details] emerge --info on another system (gentoo on android) where I had to correct the same bug.
If the EPREFIX has exactly 110 characters, eselect-python will miss the "O" in "-O" and will result in the following bug: ebuild app-admin/eselect-python/eselect-python-20111108.ebuild manifest Python 2.7.3 (default, May 29 2013, 04:51:33) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> KeyboardInterrupt (reverse-i-search)`': KeyboardInterrupt >>> >>> quit() This is how I stumbled on the bug reported here. Would it be good to add a warning in the .ebuild about the length of $EPREFIX ?
prefix should be set in the profiles I don't understand your comment about -O being ignored. Can you show what exactly you're doing that causes the misbehaviour?
What do you have in your "prefix-with-glibc" overlay? Does it have a profile?
Fabian@ https://bugs.gentoo.org/show_bug.cgid=476398#c5 "I don't understand your comment about -O being ignored. Can you show what exactly you're doing that causes the misbehaviour" Assume the string $EPREFIX is 110 bytes long. As the first line of `which ebuild` is '#!$EPREFIX/usr/bin/python -O', the command ebuild app-admin/eselect-python/eselect-python-20111108.ebuild manifest calls [see note 1 below] $EPREFIX/usr/bin/python - $EPREFIX/usr/bin/ebuild app-admin/eselect-python/eselect-python-20111108.ebuild manifest which execs python-wrapper with argv set according to previous line which executes $EPREFIX/usr/bin/python2.7 - $EPREFIX/usr/bin/ebuild app-admin/eselect-python/eselect-python-20111108.ebuild manifest which displays the same thing as $EPREFIX/usr/bin/python2.7 alone: the welcome prompt line of python about copyright, which is Type "help", "copyright", "credits" or "license" for more information. >>> You may guess I had hard time understanding and solving this issue. Note [1]: it happens only if $EPREFIX has a length of 110. Because then the first line of `which ebuild` is something linke 128 bytes long, and the O of '-O' is eaten out. Then $EPREFIX/usr/bin/python - $EPREFIX/usr/bin/ebuild app-admin/eselect-python/eselect-python-20111108.ebuild manifest is called instead of $EPREFIX/usr/bin/python -O $EPREFIX/usr/bin/ebuild app-admin/eselect-python/eselect-python-20111108.ebuild manifest Fabian@ https://bugs.gentoo.org/show_bug.cgid=476398#c5 "prefix should be set in the profiles" - Can you give me the full path to the file containing the relevant profiles ? - 'prefix' should be in the variable USE ? - 'prefix' it is not in the IUSE of app-admin/eselect-python/eselect-python-20111108.ebuild. Benda@ https://bugs.gentoo.org/show_bug.cgid=476398#c6 "What do you have in your "prefix-with-glibc" overlay ?" It is obtained by patching https://github.com/redlizard/gentoo-prefix-libc ; the patches are included in the patchset http://sourceforge.net/projects/gentooandroid/files/packages/packages/usr_portage.patch_v2 Benda@ https://bugs.gentoo.org/show_bug.cgid=476398#c6 "Does it have a profile ?" I am not sure to understand clearly the question. Can you be more specific, now that I gave answer to you previous question ? Thank you very much to you both to help me in my project (current state: xorg-server is now installed on my unrooted android, but I must patch and rebuild it, as /tmp does not exist).
so, the prefix is too long for the shebang on the platform you're using, it seems
1) I still have `use prefix` returning false, even after echo prefix >> $EPREFIX/etc/portage/make.profile/use.force (make.profile is $PORTDIR/profiles/default/linux/arm/13.0/armv6j/) I found such a use.force in $PORTDIR/profiles/prefix/linux/ but this profiled is marked deprecated. I will retry, adding prefix to IUSE when needed. 2) It would be nice to explain how to choose a profile, in http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/bootstrap-prefix.sh?format=txt 3) Do you think I should nevertheless use $PORTDIR/profiles/prefix/linux/ ?
1) I think that echo '-prefix' >> $PORTDIR/etc/portage/make.profile/use.mask echo 'prefix' >> $PORTDIR/etc/portage/make.profile/use.mask should be in http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/bootstrap-prefix.sh?format=txt It will be the best solution to fix and resolve this bug. What is you opinion ? 2) Other bug: http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/bootstrap-prefix.sh?format=txt is incompatible with profile $PORTDIR/profiles/default/linux/arm/13.0/armv6j//developer : is it documented ?kkkkkk
oops, typo: echo '-prefix' >> $PORTDIR/etc/portage/make.profile/use.mask echo 'prefix' >> $PORTDIR/etc/portage/make.profile/use.force is what solved the bug on =app-admin/eselect-python-20111108.ebuild.
I don't understand really, you're bootstrapping a native gentoo on a Raspberry Pi, where does Prefix come into play here? (I have a Raspberry Pi running vnilla Gentoo myself with no such problems.)
@Fabian Groffen: "I don't understand really, you're bootstrapping a native gentoo on a Raspberry Pi, where does Prefix come into play here?" I built it to bootstrap gentooandroid.sourceforge.net ; bootstrapping directly on Android did not work because I didn't find a working linker.
(In reply to Daa Jaa from comment #13) > @Fabian Groffen: "I don't understand really, you're bootstrapping a native > gentoo on a Raspberry Pi, where does Prefix come into play here?" > > I built it to bootstrap gentooandroid.sourceforge.net ; bootstrapping > directly on Android did not work because I didn't find a working linker. I'm not familiar with that project. Frankly, I don't understand its description, in particular about IDEs and EPREFIX.
I updated the description of GentooAndroid to take you comments in account. md5sum d127df34b70923470a6608ea608bee0f, sha1sum 2c07ff43d2c8c8095fc0139adc93edbdcdece60e for gentoo_armv6l_unrooted_unlocked_android_v5.tar.bz2
(In reply to Daa Jaa from comment #7) > Benda@ https://bugs.gentoo.org/show_bug.cgid=476398#c6 "What do you have in > your "prefix-with-glibc" overlay ?" > It is obtained by patching https://github.com/redlizard/gentoo-prefix-libc ; > the patches are included in the patchset > http://sourceforge.net/projects/gentooandroid/files/packages/packages/ > usr_portage.patch_v2 Nice job! Would you like to refine your patch to get it included in Gentoo and upstream? I am eager to help. > Benda@ https://bugs.gentoo.org/show_bug.cgid=476398#c6 "Does it have a > profile ?" > I am not sure to understand clearly the question. Can you be more specific, What's the output of $ ls -l $EPREFIX/etc/portage/make.profile $EPREFIX/etc/make.profile
(In reply to Daa Jaa from comment #10) > 2) Other bug: > http://overlays.gentoo.org/proj/alt/browser/trunk/prefix-overlay/scripts/ > bootstrap-prefix.sh?format=txt is incompatible with profile > $PORTDIR/profiles/default/linux/arm/13.0/armv6j//developer : is it > documented ?kkkkkk Please don't off topic. Open another bug please. How incompatible is that?
(In reply to Fabian Groffen from comment #8) > so, the prefix is too long for the shebang on the platform you're using, it > seems Yeah, I think so, too. http://stackoverflow.com/questions/10813538/shebang-line-limit-in-bash-and-linux-kernel
> @Benda "Nice job!" Thank you. > @Benda "Would you like to refine your patch to get it included in Gentoo and upstream?" Are you talking about everything in usr_portage.patch_v2 (dedicated to port Gentoo EPREFIX to Android, I just uploaded newest version http://sourceforge.net/projects/gentooandroid/files/packages/packages/usr_portage.patch_v6 for your information) ? Or just the part of it which is relevant to gentoo-prefix-libc ? @Benda "I am eager to help." My employer and my family life do not let me enough time to be able to pass http://www.gentoo.org/proj/en/devrel/quiz/ebuild-quiz.txt So I have questions: (1) how to modify bootstrap-prefix.sh so that it applies automatically my suggestions of adding prefix and -prefix, as specified in my comment #11 ? This is essential to close this bug. (2) how to patch bin/misc-functions.sh, around message "prefixing shebang", so that it issues warnings when the prefixed shebang is larger than BINPRM_BUF_SIZE ? (3) what script should write LDFLAGS="-Wl,-dynamic-linker=$EPREFIX/lib/ld-linux-armhf.so.3,-O1,--as-needed" to /etc/make.conf ? (4) I have conflict between sys-apps/baselayout-2.2 and sys-apps/baselayout-prefix-2.2-r2, I need elements from both because of prefixed glibc, what should I do ? (5) should bootstrap-prefix.sh be used on newest profile or on profile tested whose URL is given in bootstrap-prefix.sh ? I have unfortunately temporarily lost access to my Android device, because of failed Android upgrade. If you have more time than just answer to (1)-(4) above, you may contributes to step 4 and 6 of my project as explained in http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/daajaa/1 ; In practice: please take a random patch from http://sourceforge.net/projects/gentooandroid/files/packages/packages/usr_portage.patch_v6 and test it on an arm prefix installation (based on my gentooandroid, or not), to see compiler errors without my patch. Then try to port my patch to the up-to-date ebuild, then try again without then with that patch. > Benda@ "What's the output of $ ls -l $EPREFIX/etc/portage/make.profile $EPREFIX/etc/make.profile" /data/data/com.spartacusrex.spartacuside/gentoo_armv6l/etc $ ls -l make.profile ls: cannot access make.profile: No such file or directory /data/data/com.spartacusrex.spartacuside/gentoo_armv6l/etc $ ls -l portage/make.profile lrwxrwxrwx 1 10098 10098 105 Jun 18 13:23 portage/make.profile -> /data/data/com.spartacusrex.spartacuside/gentoo_armv6l/usr/portage/profiles/default/linux/arm/13.0/armv6j > @Benda "How incompatible is that?" bootstrap-prefix.sh fails earlier and a lot more than with profile $PORTDIR/profiles/default/linux/arm/13.0/armv6j > @Benda "Please don't off topic. Open another bug please." I think I will reported that bug after $PORTDIR/profiles/default/linux/arm/13.0/armv6j bootstraps nicely.
(In reply to Daa Jaa from comment #19) > > @Benda "Would you like to refine your patch to get it included in Gentoo and upstream?" > > Are you talking about everything in usr_portage.patch_v2 (dedicated to port > Gentoo EPREFIX to Android, I just uploaded newest version > http://sourceforge.net/projects/gentooandroid/files/packages/packages/ > usr_portage.patch_v6 for your information) ? Or just the part of it which is > relevant to gentoo-prefix-libc ? Is there anything that is not relavent to gentoo-prefix-libc? > @Benda "I am eager to help." > > So I have questions: > > (1) how to modify bootstrap-prefix.sh so that it applies automatically my > suggestions of adding prefix and -prefix, as specified in my comment #11 ? > This is essential to close this bug. See my last reply below. > (2) how to patch bin/misc-functions.sh, around message "prefixing shebang", > so that it issues warnings when the prefixed shebang is larger than > BINPRM_BUF_SIZE ? Go ahead and figure it out yourself, and then submit it to the portage maintainers. > (3) what script should write > LDFLAGS="-Wl,-dynamic-linker=$EPREFIX/lib/ld-linux-armhf.so.3,-O1,--as- > needed" to /etc/make.conf ? Never, it is implemented in toolchain.eclass, in the gentoo-prefix-libc overlay. > (4) I have conflict between sys-apps/baselayout-2.2 and > sys-apps/baselayout-prefix-2.2-r2, I need elements from both because of > prefixed glibc, what should I do ? Use openrc and baselayout together. > (5) should bootstrap-prefix.sh be used on newest profile or on profile > tested whose URL is given in bootstrap-prefix.sh ? The latter. But use the one in gentoo-prefix-libc instead of that in Prefix overlay. > If you have more time than just answer to (1)-(4) above, you may contributes > to step 4 and 6 of my project as explained in > http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/daajaa/1 ; "This proposal is not made public, and you are not the student who submitted the proposal, nor are you a mentor for the organization it was submitted to." BTW, I have a similar project this year. http://www.awa.tohoku.ac.jp/~benda/projects/android.html under gsoc. We should have known each other before to avoid duplicate effort. > In practice: please take a random patch from > http://sourceforge.net/projects/gentooandroid/files/packages/packages/ > usr_portage.patch_v6 and test it on an arm prefix installation (based on my > gentooandroid, or not), to see compiler errors without my patch. Then try to > port my patch to the up-to-date ebuild, then try again without then with > that patch. This implies too much work for me to carry it out. Would you like to break the patch into logical units and explain the purposes, so that everyone will benefit from it easiser? It's easier for you than I to do so. > > Benda@ "What's the output of $ ls -l $EPREFIX/etc/portage/make.profile $EPREFIX/etc/make.profile" > > /data/data/com.spartacusrex.spartacuside/gentoo_armv6l/etc $ ls -l > make.profile > ls: cannot access make.profile: No such file or directory > /data/data/com.spartacusrex.spartacuside/gentoo_armv6l/etc $ ls -l > portage/make.profile > lrwxrwxrwx 1 10098 10098 105 Jun 18 13:23 portage/make.profile -> > /data/data/com.spartacusrex.spartacuside/gentoo_armv6l/usr/portage/profiles/ > default/linux/arm/13.0/armv6j See the bottom reply > > @Benda "How incompatible is that?" > > bootstrap-prefix.sh fails earlier and a lot more than with profile > $PORTDIR/profiles/default/linux/arm/13.0/armv6j See the latest reply > > @Benda "Please don't off topic. Open another bug please." > > I think I will reported that bug after > $PORTDIR/profiles/default/linux/arm/13.0/armv6j bootstraps nicely. default/linux/arm/13.0/armv6j is not a Prefix profile. That's why it does not define USE prefix. Use default/linux/arm/13.0/armv6j/rap from gentoo-prefix-libc overlay intead. If it does not exist, copy one from default/linux/arm/13.0/armv7a/rap and customize yourself. Patch welcome.
this should be fixed by latest version which was redone for Prefix