Re: suricata, librsvg : set CARGO_HOME for upcoming lang/rust-1.36

2019-06-30 Thread Sebastien Marie
On Sun, Jun 30, 2019 at 02:02:47PM +0200, Antoine Jacoutot wrote:
> 
> Why not setting PORTHOME=${WRKDIST} by default for cargo ports?

Setting CARGO_HOME is enough for this purpose and should affect only
cargo. At opposite setting PORTHOME could have unwanted side-effects,
and we will not catch write attempt in HOME any more for such ports.

It is why I prefer using CARGO_HOME in environment when possible.

Thanks.
-- 
Sebastien Marie



Re: suricata, librsvg : set CARGO_HOME for upcoming lang/rust-1.36

2019-06-30 Thread Antoine Jacoutot
On Sun, Jun 30, 2019 at 12:41:02PM +0200, Sebastien Marie wrote:
> Hi,
> 
> I am working on updating lang/rust to 1.36.0
> 
> The release ships a new version of cargo which will want to write a file
> in $HOME (a lock file to manage concurrent access on package cache).
> 
> To avoid an error while acquiring package cache lock, CARGO_HOME should
> be defined to a directory writable by the build. The default value of
> CARGO_HOME is "$HOME/.cargo", so alternatively PORTHOME in the port
> could be set too.
> 
> As i think it is less invasive to set CARGO_HOME, I followed this way.
> 
> The following diff takes care of:
> - security/suricata : configure look for CARGO_HOME env var
> - x11/gnome/librsvg : set CARGO_HOME via MAKE_ENV
> 
> Some others ports not using devel/cargo sets PORTHOME (hey firefox o/)
> so the problem doesn't occurs. And ports using devel/cargo modules
> already defines CARGO_HOME by default.
> 
> One possible leftover is devel/meson where lang/rust is a TEST_DEPS. But
> it seems it is directly using rustc compiler and not cargo. So I assume
> it is fine.
> 
> No package bump as it is a build setting that don't affect anything with
> rust-1.35 we have in port.
> 
> Comments or OK ?
> -- 
> Sebastien Marie

Why not setting PORTHOME=${WRKDIST} by default for cargo ports?

> 
> Index: security/suricata/Makefile
> ===
> RCS file: /cvs/ports/security/suricata/Makefile,v
> retrieving revision 1.20
> diff -u -p -r1.20 Makefile
> --- security/suricata/Makefile3 May 2019 06:22:34 -   1.20
> +++ security/suricata/Makefile30 Jun 2019 10:05:52 -
> @@ -49,7 +49,8 @@ CONFIGURE_STYLE =   autoconf
>  AUTOCONF_VERSION =   2.69
>  
>  CONFIGURE_ENV =  ac_cv_path_HAVE_PDFLATEX= \
> - ac_cv_path_HAVE_GIT_CMD=
> + ac_cv_path_HAVE_GIT_CMD= \
> + CARGO_HOME=${WRKBUILD}/cargo-home
>  
>  CONFIGURE_ARGS = --disable-gccmarch-native \
>   --enable-ipfw
> Index: x11/gnome/librsvg/Makefile
> ===
> RCS file: /cvs/ports/x11/gnome/librsvg/Makefile,v
> retrieving revision 1.148
> diff -u -p -r1.148 Makefile
> --- x11/gnome/librsvg/Makefile13 May 2019 22:47:45 -  1.148
> +++ x11/gnome/librsvg/Makefile30 Jun 2019 07:25:33 -
> @@ -19,7 +19,8 @@ SHARED_LIBS +=  rsvg-2   39.
>  GNOME_VERSION=   ${STABLE_VERSION}
>  BUILD_DEPENDS=   lang/rust
>  PKG_ARGS=-Dold=0 -Dstable=1
> -MAKE_ENV+=   CARGO_BUILD_JOBS=${MAKE_JOBS}
> +MAKE_ENV+=   CARGO_BUILD_JOBS=${MAKE_JOBS} \
> + CARGO_HOME=${WRKBUILD}/cargo-home
>  .else
>  ### old
>  REVISION=3
> 

-- 
Antoine



suricata, librsvg : set CARGO_HOME for upcoming lang/rust-1.36

2019-06-30 Thread Sebastien Marie
Hi,

I am working on updating lang/rust to 1.36.0

The release ships a new version of cargo which will want to write a file
in $HOME (a lock file to manage concurrent access on package cache).

To avoid an error while acquiring package cache lock, CARGO_HOME should
be defined to a directory writable by the build. The default value of
CARGO_HOME is "$HOME/.cargo", so alternatively PORTHOME in the port
could be set too.

As i think it is less invasive to set CARGO_HOME, I followed this way.

The following diff takes care of:
- security/suricata : configure look for CARGO_HOME env var
- x11/gnome/librsvg : set CARGO_HOME via MAKE_ENV

Some others ports not using devel/cargo sets PORTHOME (hey firefox o/)
so the problem doesn't occurs. And ports using devel/cargo modules
already defines CARGO_HOME by default.

One possible leftover is devel/meson where lang/rust is a TEST_DEPS. But
it seems it is directly using rustc compiler and not cargo. So I assume
it is fine.

No package bump as it is a build setting that don't affect anything with
rust-1.35 we have in port.

Comments or OK ?
-- 
Sebastien Marie

Index: security/suricata/Makefile
===
RCS file: /cvs/ports/security/suricata/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- security/suricata/Makefile  3 May 2019 06:22:34 -   1.20
+++ security/suricata/Makefile  30 Jun 2019 10:05:52 -
@@ -49,7 +49,8 @@ CONFIGURE_STYLE = autoconf
 AUTOCONF_VERSION = 2.69
 
 CONFIGURE_ENV =ac_cv_path_HAVE_PDFLATEX= \
-   ac_cv_path_HAVE_GIT_CMD=
+   ac_cv_path_HAVE_GIT_CMD= \
+   CARGO_HOME=${WRKBUILD}/cargo-home
 
 CONFIGURE_ARGS =   --disable-gccmarch-native \
--enable-ipfw
Index: x11/gnome/librsvg/Makefile
===
RCS file: /cvs/ports/x11/gnome/librsvg/Makefile,v
retrieving revision 1.148
diff -u -p -r1.148 Makefile
--- x11/gnome/librsvg/Makefile  13 May 2019 22:47:45 -  1.148
+++ x11/gnome/librsvg/Makefile  30 Jun 2019 07:25:33 -
@@ -19,7 +19,8 @@ SHARED_LIBS +=  rsvg-2   39.
 GNOME_VERSION= ${STABLE_VERSION}
 BUILD_DEPENDS= lang/rust
 PKG_ARGS=  -Dold=0 -Dstable=1
-MAKE_ENV+= CARGO_BUILD_JOBS=${MAKE_JOBS}
+MAKE_ENV+= CARGO_BUILD_JOBS=${MAKE_JOBS} \
+   CARGO_HOME=${WRKBUILD}/cargo-home
 .else
 ### old
 REVISION=  3