You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2023/03/14 08:16:55 UTC

[Bug 66529] New: $apr_config --installbuilddir is wrong when crosscompile-ing

https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

            Bug ID: 66529
           Summary: $apr_config --installbuilddir is wrong when
                    crosscompile-ing
           Product: APR
           Version: 1.6.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR-util
          Assignee: bugs@apr.apache.org
          Reporter: cassie.q.wang@gmail.com
  Target Milestone: ---

I'm trying to crosscompile dev-libs/apr-util-1.6.3 from portage, but I'm
hitting an error trying to configure it.

The error message is (with some lines removed for brevity):

```
apr-util-1.6.3: Applying apr-util hints file rules for x86_64-cros-linux-gnu    
apr-util-1.6.3: checking for APR... yes                                         
apr-util-1.6.3: ./configure: line 12198: cd:
/build/octopus//build/octopus/usr/share/apr/build: No such file or directory    
apr-util-1.6.3:   setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"     

 <elided ...>                                                                   

apr-util-1.6.3: checking for explicit_bzero support... no                       
apr-util-1.6.3:   adding "-L/build/octopus//usr/lib64" to APRUTIL_LIBS          
apr-util-1.6.3:   adding "-lapr-1" to APRUTIL_LIBS                              
apr-util-1.6.3: cp: cannot stat '/apr_rules.mk': No such file or directory      
apr-util-1.6.3: configure: creating ./config.status                             
apr-util-1.6.3: config.status: creating Makefile                                

 <elided ...>                                                                   

apr-util-1.6.3: config.status: executing libtool commands                       
apr-util-1.6.3: config.status: executing default commands                       
apr-util-1.6.3: sed: can't read build/rules.mk: No such file or directory       
apr-util-1.6.3:  * ERROR: dev-libs/apr-util-1.6.3::portage-stable failed
(configure phase):                                                              
apr-util-1.6.3:  *   (no error message)                                         
apr-util-1.6.3:  *                                                              
apr-util-1.6.3:  * Call stack:                                                  
apr-util-1.6.3:  *               ebuild.sh, line  125:  Called src_configure    
apr-util-1.6.3:  *             environment, line 2468:  Called die              
apr-util-1.6.3:  * The specific snippet of code:                                
apr-util-1.6.3:  *       sed -i -r -e
"/^(apr_builddir|apr_builders|top_builddir)=/s:=:=${SYSROOT}:" -e
"/^CC=/s:=.*:=$(tc-getCC):" -e '/^LTFLAGS/s:--silent::' build/rules.mk || die   
apr-util-1.6.3:  * 
```

The ${installbuilddir} is "/build/octopus//build/octopus/usr/share/apr/build",
but incorrectly includes a duplicate "/build/octopus" (which is the SYSROOT in
my environment) in front. 

The apr-1-config has the following lines:
```
installbuilddir="${SYSROOT}/usr/share/apr/build"


    --installbuilddir)
    if test "$location" = "installed"; then
        echo "${installbuilddir}"
    elif test "$location" = "crosscompile"; then
        echo "$APR_TARGET_DIR/${installbuilddir}"
 ```

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #11 from cassie.q.wang@gmail.com ---
Ah sorry, for apr it's:

./configure 
  --prefix=/usr 
  --build=x86_64-pc-linux-gnu 
  --host=x86_64-cros-linux-gnu 
  --mandir=/usr/share/man 
  --infodir=/usr/share/info 
  --datadir=/usr/share 
  --sysconfdir=/etc 
  --localstatedir=/var/lib 
  --docdir=/usr/share/doc/apr-1.7.2 
  --htmldir=/usr/share/doc/apr-1.7.2/html 
  --with-sysroot=/build/octopus 
  --libdir=/usr/lib64 
  --enable-layout=gentoo 
  --enable-nonportable-atomics 
  --enable-posix-shm 
  --enable-threads 
  --disable-static 
  --with-installbuilddir=/usr/share/apr/build 
  --with-devrandom=/dev/urandom

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

cassie.q.wang@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |---

--- Comment #4 from cassie.q.wang@gmail.com ---
Ah thanks for the pointer. I patched the attachment from bug 66510 into APR and
APR builds fine. But I'm still running into the same issue where it looks like
`installbuilddir` is misformatted and looks like it has a duplicate SYS_ROOT
(e.g. 
"/build/octopus//build/octopus/usr/share/apr/build" where "/build/octopus"
would be the SYSROOT). 

It looks like it's more than just a double //? although I'm not sure where the
extra "build/octopus" is coming from.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

cassie.q.wang@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cassie.q.wang@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #12 from Ruediger Pluem <rp...@apache.org> ---
(In reply to cassie.q.wang from comment #11)
> Ah sorry, for apr it's:
> 
> ./configure 
>   --prefix=/usr 
>   --build=x86_64-pc-linux-gnu 
>   --host=x86_64-cros-linux-gnu 
>   --mandir=/usr/share/man 
>   --infodir=/usr/share/info 
>   --datadir=/usr/share 
>   --sysconfdir=/etc 
>   --localstatedir=/var/lib 
>   --docdir=/usr/share/doc/apr-1.7.2 
>   --htmldir=/usr/share/doc/apr-1.7.2/html 
>   --with-sysroot=/build/octopus 
>   --libdir=/usr/lib64 
>   --enable-layout=gentoo 
>   --enable-nonportable-atomics 
>   --enable-posix-shm 
>   --enable-threads 
>   --disable-static 
>   --with-installbuilddir=/usr/share/apr/build 
>   --with-devrandom=/dev/urandom

As you are crosscompiling cross_compiling is correctly set to yes. I cannot
reproduce that installbuilddir is set to "${SYSROOT}/usr/share/apr/build" and I
don't have a gentoo layout.
Do you use the sources downloaded from here:
https://apr.apache.org/download.cgi?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.6.3                       |1.7.2
          Component|APR-util                    |APR

--- Comment #8 from Ruediger Pluem <rp...@apache.org> ---
(In reply to cassie.q.wang from comment #7)
> Some other variables from my apr-1-config are:
> 
> cross_compiling = yes
> $normalized_bindir = /usr/bin
> $normalized_location = /build/octopus/usr/bin/apr-1-config
> 
> which I guess causes my $location to be set to "crosscompile" ?

How did you call configure? Did you specify and --host or --build parameters?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #7 from cassie.q.wang@gmail.com ---
Some other variables from my apr-1-config are:

cross_compiling = yes
$normalized_bindir = /usr/bin
$normalized_location = /build/octopus/usr/bin/apr-1-config

which I guess causes my $location to be set to "crosscompile" ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #10 from Ruediger Pluem <rp...@apache.org> ---
(In reply to cassie.q.wang from comment #9)
> I'm running:
> 
> ./configure 
>   --prefix=/usr 
>   --build=x86_64-pc-linux-gnu 
>   --host=armv7a-cros-linux-gnueabihf 
>   --mandir=/usr/share/man 
>   --infodir=/usr/share/info 
>   --datadir=/usr/share 
>   --sysconfdir=/etc 
>   --localstatedir=/var/lib 
>   --docdir=/usr/share/doc/apr-util-1.6.3 
>   --htmldir=/usr/share/doc/apr-util-1.6.3/html 
>   --with-sysroot=/build/jacuzzi 
>   --libdir=/usr/lib 
>   --datadir=/usr/share/apr-util-1 
>   --with-apr=/build/jacuzzi/usr 
>   --with-expat=/usr 
>   --without-sqlite2 
>   --without-gdbm 
>   --without-ldap 
>   --without-mysql 
>   --without-nss 
>   --without-odbc 
>   --without-openssl 
>   --without-pgsql 
>   --without-sqlite3 
>   --without-berkeley-db

This is the configure call for apr-util. Which one did you use for apr?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #3 from Ruediger Pluem <rp...@apache.org> ---
(In reply to cassie.q.wang from comment #2)
> Thanks! I'm unable to verify the patch since gentoo is only up to 1.6.3

1.6.3 is the version of APR-UTIL you are using. The bug is in APR 1.7.2.
Hence you need to patch your APR, not your APR-UTIL.

> right now. I saw that the fix was backported to 1.7.x, do you know if it
> might get backported even further?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #5 from cassie.q.wang@gmail.com ---
It looks like the duplicate "build/octopus" is coming from this line in
apr-1-config:
```
    elif test "$location" = "crosscompile"; then
        echo "$APR_TARGET_DIR/${installbuilddir}"
```

$APR_TARGET = /build/octopus

installbuilddir = "${SYSROOT}/usr/share/apr/build"
${SYSROOT} = /build/octopus
${installbuilddir} = /build/octopus/usr/share/apr/build

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #6 from Ruediger Pluem <rp...@apache.org> ---
(In reply to cassie.q.wang from comment #5)
> It looks like the duplicate "build/octopus" is coming from this line in
> apr-1-config:
> ```
>     elif test "$location" = "crosscompile"; then
>         echo "$APR_TARGET_DIR/${installbuilddir}"
> ```
> 
> $APR_TARGET = /build/octopus
> 
> installbuilddir = "${SYSROOT}/usr/share/apr/build"
> ${SYSROOT} = /build/octopus
> ${installbuilddir} = /build/octopus/usr/share/apr/build

With the patch applied $location should no longer be set to "crosscompile".
This makes me wonder if the apr-1-config you were using was still unpatched.
Please check if the apr-1-config you use has the variable cross_compiling set.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #14 from Ruediger Pluem <rp...@apache.org> ---
(In reply to cassie.q.wang from comment #13)
> > Do you use the sources downloaded from here:
> > https://apr.apache.org/download.cgi?
> 
> I'm not sure, my sources should be pulled from gentoo upstream
> (https://packages.gentoo.org/packages/www-servers/apache)? I'm not sure if
> it points to the same sources?

Likely not. It likely contains custom Gentoo patches. Hence you should address
the issue to the Gentoo maintainers.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #2 from cassie.q.wang@gmail.com ---
Thanks! I'm unable to verify the patch since gentoo is only up to 1.6.3 right
now. I saw that the fix was backported to 1.7.x, do you know if it might get
backported even further?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #1 from Ruediger Pluem <rp...@apache.org> ---


*** This bug has been marked as a duplicate of bug 66510 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

--- Comment #13 from cassie.q.wang@gmail.com ---
> Do you use the sources downloaded from here:
> https://apr.apache.org/download.cgi?

I'm not sure, my sources should be pulled from gentoo upstream
(https://packages.gentoo.org/packages/www-servers/apache)? I'm not sure if it
points to the same sources?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 66529] $apr_config --installbuilddir is wrong when crosscompile-ing

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66529

cassie.q.wang@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|APR                         |APR-util
            Version|1.7.2                       |1.6.3

--- Comment #9 from cassie.q.wang@gmail.com ---
I'm running:

./configure 
  --prefix=/usr 
  --build=x86_64-pc-linux-gnu 
  --host=armv7a-cros-linux-gnueabihf 
  --mandir=/usr/share/man 
  --infodir=/usr/share/info 
  --datadir=/usr/share 
  --sysconfdir=/etc 
  --localstatedir=/var/lib 
  --docdir=/usr/share/doc/apr-util-1.6.3 
  --htmldir=/usr/share/doc/apr-util-1.6.3/html 
  --with-sysroot=/build/jacuzzi 
  --libdir=/usr/lib 
  --datadir=/usr/share/apr-util-1 
  --with-apr=/build/jacuzzi/usr 
  --with-expat=/usr 
  --without-sqlite2 
  --without-gdbm 
  --without-ldap 
  --without-mysql 
  --without-nss 
  --without-odbc 
  --without-openssl 
  --without-pgsql 
  --without-sqlite3 
  --without-berkeley-db

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org