public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
@ 2013-04-14  9:40 Pacho Ramos
  2013-04-14  9:45 ` Michał Górny
  2013-05-19 10:31 ` Pacho Ramos
  0 siblings, 2 replies; 10+ messages in thread
From: Pacho Ramos @ 2013-04-14  9:40 UTC (permalink / raw
  To: gentoo-dev; +Cc: dotnet

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

Due reasons explained here:
https://bugs.gentoo.org/show_bug.cgi?id=462052#c1

We would like to start a process of simplifying dotnet maintained
eclasses a lot because they are currently really hard to maintain. As a
start point, we will need a simple eclass simply to export some
variables needed to build most of dotnet packages. That variables are
currently being exported by mono.eclass, the idea would be to split the
"environment exporting" part out of it (and deprecate current
mono.eclass in the future)



[-- Attachment #2: mono-env.eclass --]
[-- Type: text/plain, Size: 1181 bytes --]

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: mono-env.eclass
# @MAINTAINER:
# dotnet@gentoo.org
# @BLURB: Set environment variables commonly used by dotnet packages.
# @DESCRIPTION:
# Set environment variables commonly used by dotnet packages.

# >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
# shared dir to ${T} so that ${T}/.wapi can be used during the install process.
export MONO_SHARED_DIR="${T}"

# export more variables as needed by other dotnet packages
export MONO_REGISTRY_PATH="${T}/registry"
export XDG_DATA_HOME="${T}/data"
export HOME="${T}/home"

# Building mono, nant and many other dotnet packages is known to fail if LC_ALL
# variable is not set to C. To prevent this all mono related packages will be
# build with LC_ALL=C (see bugs #146424, #149817)
export LC_ALL=C

# Monodevelop-using applications need this to be set or they will try to create config
# files in the user's ~ dir.
export XDG_CONFIG_HOME="${T}"

# Fix bug 83020:
# "Access Violations Arise When Emerging Mono-Related Packages with MONO_AOT_CACHE"
unset MONO_AOT_CACHE

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14  9:40 [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages Pacho Ramos
@ 2013-04-14  9:45 ` Michał Górny
  2013-04-14  9:59   ` Pacho Ramos
  2013-04-14 10:00   ` Pacho Ramos
  2013-05-19 10:31 ` Pacho Ramos
  1 sibling, 2 replies; 10+ messages in thread
From: Michał Górny @ 2013-04-14  9:45 UTC (permalink / raw
  To: gentoo-dev; +Cc: pacho, dotnet

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

On Sun, 14 Apr 2013 11:40:03 +0200
Pacho Ramos <pacho@gentoo.org> wrote:

> # >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
> # shared dir to ${T} so that ${T}/.wapi can be used during the install process.
> export MONO_SHARED_DIR="${T}"

Don't use ${T} in global scope. And just don't export them
in the global scope either.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14  9:45 ` Michał Górny
@ 2013-04-14  9:59   ` Pacho Ramos
  2013-04-14 10:08     ` Michał Górny
  2013-04-14 21:02     ` Zac Medico
  2013-04-14 10:00   ` Pacho Ramos
  1 sibling, 2 replies; 10+ messages in thread
From: Pacho Ramos @ 2013-04-14  9:59 UTC (permalink / raw
  To: gentoo-dev; +Cc: dotnet

El dom, 14-04-2013 a las 11:45 +0200, Michał Górny escribió:
> On Sun, 14 Apr 2013 11:40:03 +0200
> Pacho Ramos <pacho@gentoo.org> wrote:
> 
> > # >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
> > # shared dir to ${T} so that ${T}/.wapi can be used during the install process.
> > export MONO_SHARED_DIR="${T}"
> 
> Don't use ${T} in global scope. And just don't export them
> in the global scope either.
> 

Why not?



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14  9:45 ` Michał Górny
  2013-04-14  9:59   ` Pacho Ramos
@ 2013-04-14 10:00   ` Pacho Ramos
  1 sibling, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2013-04-14 10:00 UTC (permalink / raw
  To: gentoo-dev; +Cc: dotnet

El dom, 14-04-2013 a las 11:45 +0200, Michał Górny escribió:
> On Sun, 14 Apr 2013 11:40:03 +0200
> Pacho Ramos <pacho@gentoo.org> wrote:
> 
> > # >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
> > # shared dir to ${T} so that ${T}/.wapi can be used during the install process.
> > export MONO_SHARED_DIR="${T}"
> 
> Don't use ${T} in global scope. And just don't export them
> in the global scope either.
> 

Maybe setting a custom pkg_setup could be an option :/



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14  9:59   ` Pacho Ramos
@ 2013-04-14 10:08     ` Michał Górny
  2013-04-14 10:25       ` Pacho Ramos
  2013-04-14 21:02     ` Zac Medico
  1 sibling, 1 reply; 10+ messages in thread
From: Michał Górny @ 2013-04-14 10:08 UTC (permalink / raw
  To: gentoo-dev; +Cc: pacho, dotnet

[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]

On Sun, 14 Apr 2013 11:59:14 +0200
Pacho Ramos <pacho@gentoo.org> wrote:

> El dom, 14-04-2013 a las 11:45 +0200, Michał Górny escribió:
> > On Sun, 14 Apr 2013 11:40:03 +0200
> > Pacho Ramos <pacho@gentoo.org> wrote:
> > 
> > > # >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
> > > # shared dir to ${T} so that ${T}/.wapi can be used during the install process.
> > > export MONO_SHARED_DIR="${T}"
> > 
> > Don't use ${T} in global scope. And just don't export them
> > in the global scope either.
> 
> Why not?

Let's start with the fact that ${T} is only partially persistent
by the words of PMS. I don't know if it's really relevant here but
you're exporting persistent variables with value based on
an non-persistent one.

Thinking about it more, it probably would work. As long as you don't
assume anything about those directories on pkg_*rm() where ${T} would
have changed already and your variables wouldn't.

Also, why are you exporting HOME? PMS does that already...

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14 10:08     ` Michał Górny
@ 2013-04-14 10:25       ` Pacho Ramos
  2013-04-14 10:40         ` Michał Górny
  0 siblings, 1 reply; 10+ messages in thread
From: Pacho Ramos @ 2013-04-14 10:25 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-dev, dotnet

El dom, 14-04-2013 a las 12:08 +0200, Michał Górny escribió:
> On Sun, 14 Apr 2013 11:59:14 +0200
> Pacho Ramos <pacho@gentoo.org> wrote:
> 
> > El dom, 14-04-2013 a las 11:45 +0200, Michał Górny escribió:
> > > On Sun, 14 Apr 2013 11:40:03 +0200
> > > Pacho Ramos <pacho@gentoo.org> wrote:
> > > 
> > > > # >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
> > > > # shared dir to ${T} so that ${T}/.wapi can be used during the install process.
> > > > export MONO_SHARED_DIR="${T}"
> > > 
> > > Don't use ${T} in global scope. And just don't export them
> > > in the global scope either.
> > 
> > Why not?
> 
> Let's start with the fact that ${T} is only partially persistent
> by the words of PMS. I don't know if it's really relevant here but
> you're exporting persistent variables with value based on
> an non-persistent one.
> 
> Thinking about it more, it probably would work. As long as you don't
> assume anything about those directories on pkg_*rm() where ${T} would
> have changed already and your variables wouldn't.
> 

Yes, they will be needed at compile time, that would explain why no
problem raised for now :/ Thanks for the info

> Also, why are you exporting HOME? PMS does that already...
> 

Probably because it's inherited from current mono.eclass, but, are you
sure PMS does that already? There are more examples in the tree (in
eclasses and ebuilds) exporting HOME in similar way (vim.eclass for
example) :/ Or maybe it was started to be exported more recently and
this is only a relic :|



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14 10:25       ` Pacho Ramos
@ 2013-04-14 10:40         ` Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2013-04-14 10:40 UTC (permalink / raw
  To: gentoo-dev; +Cc: pacho, dotnet

[-- Attachment #1: Type: text/plain, Size: 2332 bytes --]

On Sun, 14 Apr 2013 12:25:27 +0200
Pacho Ramos <pacho@gentoo.org> wrote:

> El dom, 14-04-2013 a las 12:08 +0200, Michał Górny escribió:
> > On Sun, 14 Apr 2013 11:59:14 +0200
> > Pacho Ramos <pacho@gentoo.org> wrote:
> > 
> > > El dom, 14-04-2013 a las 11:45 +0200, Michał Górny escribió:
> > > > On Sun, 14 Apr 2013 11:40:03 +0200
> > > > Pacho Ramos <pacho@gentoo.org> wrote:
> > > > 
> > > > > # >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
> > > > > # shared dir to ${T} so that ${T}/.wapi can be used during the install process.
> > > > > export MONO_SHARED_DIR="${T}"
> > > > 
> > > > Don't use ${T} in global scope. And just don't export them
> > > > in the global scope either.
> > > 
> > > Why not?
> > 
> > Let's start with the fact that ${T} is only partially persistent
> > by the words of PMS. I don't know if it's really relevant here but
> > you're exporting persistent variables with value based on
> > an non-persistent one.
> > 
> > Thinking about it more, it probably would work. As long as you don't
> > assume anything about those directories on pkg_*rm() where ${T} would
> > have changed already and your variables wouldn't.
> > 
> 
> Yes, they will be needed at compile time, that would explain why no
> problem raised for now :/ Thanks for the info

Well, I am a bit worried about metadata regen but I guess even having
invalid values there doesn't hurt anyone. Well, assuming that the
eclass will always be sourced before running the build and noone will
try to use a pre-cached environment.

> > Also, why are you exporting HOME? PMS does that already...
> > 
> 
> Probably because it's inherited from current mono.eclass, but, are you
> sure PMS does that already? There are more examples in the tree (in
> eclasses and ebuilds) exporting HOME in similar way (vim.eclass for
> example) :/ Or maybe it was started to be exported more recently and
> this is only a relic :|

It's on the list [1], and I think I've seen 'home' subdirs in the build
root for a long time. I guess people may be resetting it 'just to be
sure'.

One thing should be noted though: $HOME may and usually will be
different than $T.

[1]:http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-11800011.1

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14  9:59   ` Pacho Ramos
  2013-04-14 10:08     ` Michał Górny
@ 2013-04-14 21:02     ` Zac Medico
  1 sibling, 0 replies; 10+ messages in thread
From: Zac Medico @ 2013-04-14 21:02 UTC (permalink / raw
  To: gentoo-dev; +Cc: Pacho Ramos, dotnet

On 04/14/2013 02:59 AM, Pacho Ramos wrote:
> El dom, 14-04-2013 a las 11:45 +0200, Michał Górny escribió:
>> On Sun, 14 Apr 2013 11:40:03 +0200
>> Pacho Ramos <pacho@gentoo.org> wrote:
>>
>>> # >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
>>> # shared dir to ${T} so that ${T}/.wapi can be used during the install process.
>>> export MONO_SHARED_DIR="${T}"
>>
>> Don't use ${T} in global scope. And just don't export them
>> in the global scope either.
>>
> 
> Why not?

It's more flexible if you put it in a function and call it from
pkg_setup. That way, if it turns out that you need to do something that
can't be done in global scope, you're already prepared.
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-04-14  9:40 [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages Pacho Ramos
  2013-04-14  9:45 ` Michał Górny
@ 2013-05-19 10:31 ` Pacho Ramos
  2013-05-24 19:18   ` Pacho Ramos
  1 sibling, 1 reply; 10+ messages in thread
From: Pacho Ramos @ 2013-05-19 10:31 UTC (permalink / raw
  To: gentoo-dev; +Cc: dotnet

[-- Attachment #1: Type: text/plain, Size: 651 bytes --]

El dom, 14-04-2013 a las 11:40 +0200, Pacho Ramos escribió:
> Due reasons explained here:
> https://bugs.gentoo.org/show_bug.cgi?id=462052#c1
> 
> We would like to start a process of simplifying dotnet maintained
> eclasses a lot because they are currently really hard to maintain. As a
> start point, we will need a simple eclass simply to export some
> variables needed to build most of dotnet packages. That variables are
> currently being exported by mono.eclass, the idea would be to split the
> "environment exporting" part out of it (and deprecate current
> mono.eclass in the future)
> 
> 

Updated eclass taking care of previous suggestions

[-- Attachment #2: mono-env.eclass --]
[-- Type: text/plain, Size: 1386 bytes --]

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: mono-env.eclass
# @MAINTAINER:
# dotnet@gentoo.org
# @BLURB: Set environment variables commonly used by dotnet packages.
# @DESCRIPTION:
# Set environment variables commonly used by dotnet packages.

inherit multilib

EXPORT_FUNCTIONS pkg_setup

if [[ ! ${_MONO_ENV} ]]; then

mono-env_pkg_setup() {
	# >=mono-0.92 versions using mcs -pkg:foo-sharp require shared memory, so we set the
	# shared dir to ${T} so that ${T}/.wapi can be used during the install process.
	export MONO_SHARED_DIR="${T}"

	# export more variables as needed by other dotnet packages
	export MONO_REGISTRY_PATH="${T}/registry"
	export XDG_DATA_HOME="${T}/data"

	# Building mono, nant and many other dotnet packages is known to fail if LC_ALL
	# variable is not set to C. To prevent this all mono related packages will be
	# build with LC_ALL=C (see bugs #146424, #149817)
	export LC_ALL=C

	# Monodevelop-using applications need this to be set or they will try to create config
	# files in the user's ~ dir.
	export XDG_CONFIG_HOME="${T}"

	# Fix bug 83020:
	# "Access Violations Arise When Emerging Mono-Related Packages with MONO_AOT_CACHE"
	unset MONO_AOT_CACHE

	# mono libs can live on /usr/lib as they are not arch specific
	QA_MULTILIB_PATHS="usr/lib/"
}

_MONO_ENV=1
fi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages
  2013-05-19 10:31 ` Pacho Ramos
@ 2013-05-24 19:18   ` Pacho Ramos
  0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2013-05-24 19:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: dotnet

El dom, 19-05-2013 a las 12:31 +0200, Pacho Ramos escribió:
> El dom, 14-04-2013 a las 11:40 +0200, Pacho Ramos escribió:
> > Due reasons explained here:
> > https://bugs.gentoo.org/show_bug.cgi?id=462052#c1
> > 
> > We would like to start a process of simplifying dotnet maintained
> > eclasses a lot because they are currently really hard to maintain. As a
> > start point, we will need a simple eclass simply to export some
> > variables needed to build most of dotnet packages. That variables are
> > currently being exported by mono.eclass, the idea would be to split the
> > "environment exporting" part out of it (and deprecate current
> > mono.eclass in the future)
> > 
> > 
> 
> Updated eclass taking care of previous suggestions

Added



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-05-24 19:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-14  9:40 [gentoo-dev] mono-env.eclass: new eclass to be used by most of dotnet packages Pacho Ramos
2013-04-14  9:45 ` Michał Górny
2013-04-14  9:59   ` Pacho Ramos
2013-04-14 10:08     ` Michał Górny
2013-04-14 10:25       ` Pacho Ramos
2013-04-14 10:40         ` Michał Górny
2013-04-14 21:02     ` Zac Medico
2013-04-14 10:00   ` Pacho Ramos
2013-05-19 10:31 ` Pacho Ramos
2013-05-24 19:18   ` Pacho Ramos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox