You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Patrik Karlström <pa...@trixon.se> on 2020/05/23 08:15:54 UTC

DEFAULT_CACHEDIR_ROOT not propagating to platform application

The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.

While I was about to use the cache dir logic provided by the platform I ran
into this problem.

My cache dir is in
${HOME}/.${APPNAME}/var/cache
and not as expected,
${HOME}/.cache/${APPNAME}

The app.conf contains
default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"

Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set ok,
but not picked up by the application.

When specifying --cachedir it gets picked up by the application.

I created a simple testapp and this problem is there too.

So I guess the question is, Is this related to my doing or the platform?

/Patrik

Re: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Posted by Patrik Karlström <pa...@trixon.se>.
Thanks Eirik for the confirmation and the swift PR!

Den lör 23 maj 2020 kl 20:01 skrev Eirik Bakke <eb...@ultorg.com>:

> And here's a pull request for this...
>
> https://github.com/apache/netbeans/pull/2153
>
> -- Eirik
>
> -----Original Message-----
> From: Eirik Bakke <eb...@ultorg.com>
> Sent: Saturday, May 23, 2020 1:44 PM
> To: dev@netbeans.apache.org
> Subject: RE: DEFAULT_CACHEDIR_ROOT not propagating to platform application
>
> I created JIRA issue https://issues.apache.org/jira/browse/NETBEANS-4367
> for this.
>
> -- Eirik
>
> -----Original Message-----
> From: Patrik Karlström <pa...@trixon.se>
> Sent: Saturday, May 23, 2020 4:16 AM
> To: dev@netbeans.apache.org
> Subject: DEFAULT_CACHEDIR_ROOT not propagating to platform application
>
> The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.
>
> While I was about to use the cache dir logic provided by the platform I
> ran into this problem.
>
> My cache dir is in
> ${HOME}/.${APPNAME}/var/cache
> and not as expected,
> ${HOME}/.cache/${APPNAME}
>
> The app.conf contains
> default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
> default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"
>
> Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set ok,
> but not picked up by the application.
>
> When specifying --cachedir it gets picked up by the application.
>
> I created a simple testapp and this problem is there too.
>
> So I guess the question is, Is this related to my doing or the platform?
>
> /Patrik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Posted by Christian Oyarzun <co...@oyarzun.net>.
Hi Patrik,

I think that netbeans-mavenutils-nbm-maven-harness needs to get updated
with the latest harness.
I've created a JIRA issue
https://issues.apache.org/jira/browse/NETBEANSINFRA-234

You can work around it by putting the launchers in the binDirectory

http://bits.netbeans.org/mavenutilities/nbm-maven-plugin/cluster-app-mojo.html#binDirectory


--Christian

On Tue, Dec 1, 2020 at 10:49 AM Patrik Karlström <pa...@trixon.se> wrote:

> Hi Eirik,
> I just noticed that when using RELEASE121 the cache dir is no longer where
> it used to be when starting the application from the IDE.
> On Linux it used to be "application/target/userdir/var/cache/" but since
> RELEASE121 it's /home/pata/.cache/appname/.
> On Windows it's still "application/target/userdir/var/cache/" for
> RELEASE121.
>
> I think this is related to my original post but I'm not sure.
>
> Den lör 23 maj 2020 kl 20:01 skrev Eirik Bakke <eb...@ultorg.com>:
>
> > And here's a pull request for this...
> >
> > https://github.com/apache/netbeans/pull/2153
> >
> > -- Eirik
> >
> > -----Original Message-----
> > From: Eirik Bakke <eb...@ultorg.com>
> > Sent: Saturday, May 23, 2020 1:44 PM
> > To: dev@netbeans.apache.org
> > Subject: RE: DEFAULT_CACHEDIR_ROOT not propagating to platform
> application
> >
> > I created JIRA issue https://issues.apache.org/jira/browse/NETBEANS-4367
> > for this.
> >
> > -- Eirik
> >
> > -----Original Message-----
> > From: Patrik Karlström <pa...@trixon.se>
> > Sent: Saturday, May 23, 2020 4:16 AM
> > To: dev@netbeans.apache.org
> > Subject: DEFAULT_CACHEDIR_ROOT not propagating to platform application
> >
> > The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.
> >
> > While I was about to use the cache dir logic provided by the platform I
> > ran into this problem.
> >
> > My cache dir is in
> > ${HOME}/.${APPNAME}/var/cache
> > and not as expected,
> > ${HOME}/.cache/${APPNAME}
> >
> > The app.conf contains
> > default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
> > default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"
> >
> > Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set ok,
> > but not picked up by the application.
> >
> > When specifying --cachedir it gets picked up by the application.
> >
> > I created a simple testapp and this problem is there too.
> >
> > So I guess the question is, Is this related to my doing or the platform?
> >
> > /Patrik
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
>

RE: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Posted by Eirik Bakke <eb...@ultorg.com>.
Ah, interesting. The "userdir/var/cache" location is a default location that is used if no cache dir is specified, I think. And previously the launch script did not propagate the cache dir setting properly, so it always ended up there. 

The same behavior occurs on MacOS, where the cache directory ends up being ~/Library/Caches/appname/dev (when run from the IDE).

When running from the IDE it would probably be best to keep it under the "target" directory somewhere, yes, so that it is properly cleaned during a clean build. Though at least I think it still uses the "dev" folder.

Are you using Maven or Ant to run your app? (I'm using Maven myself.) Probably somewhere in the IDE platform app running actions (maven plugin?) the cachedir for IDE runs should be set explicitly, like the userdir is. (I won't have time to work on this now, but feel free to investigate.)

-- Eirik

-----Original Message-----
From: Patrik Karlström <pa...@trixon.se> 
Sent: Tuesday, December 1, 2020 10:48 AM
To: dev@netbeans.apache.org
Subject: Re: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Hi Eirik,
I just noticed that when using RELEASE121 the cache dir is no longer where it used to be when starting the application from the IDE.
On Linux it used to be "application/target/userdir/var/cache/" but since
RELEASE121 it's /home/pata/.cache/appname/.
On Windows it's still "application/target/userdir/var/cache/" for RELEASE121.

I think this is related to my original post but I'm not sure.

Den lör 23 maj 2020 kl 20:01 skrev Eirik Bakke <eb...@ultorg.com>:

> And here's a pull request for this...
>
> https://github.com/apache/netbeans/pull/2153
>
> -- Eirik
>
> -----Original Message-----
> From: Eirik Bakke <eb...@ultorg.com>
> Sent: Saturday, May 23, 2020 1:44 PM
> To: dev@netbeans.apache.org
> Subject: RE: DEFAULT_CACHEDIR_ROOT not propagating to platform 
> application
>
> I created JIRA issue 
> https://issues.apache.org/jira/browse/NETBEANS-4367
> for this.
>
> -- Eirik
>
> -----Original Message-----
> From: Patrik Karlström <pa...@trixon.se>
> Sent: Saturday, May 23, 2020 4:16 AM
> To: dev@netbeans.apache.org
> Subject: DEFAULT_CACHEDIR_ROOT not propagating to platform application
>
> The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.
>
> While I was about to use the cache dir logic provided by the platform 
> I ran into this problem.
>
> My cache dir is in
> ${HOME}/.${APPNAME}/var/cache
> and not as expected,
> ${HOME}/.cache/${APPNAME}
>
> The app.conf contains
> default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
> default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"
>
> Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set 
> ok, but not picked up by the application.
>
> When specifying --cachedir it gets picked up by the application.
>
> I created a simple testapp and this problem is there too.
>
> So I guess the question is, Is this related to my doing or the platform?
>
> /Patrik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Posted by Patrik Karlström <pa...@trixon.se>.
Hi Eirik,
I just noticed that when using RELEASE121 the cache dir is no longer where
it used to be when starting the application from the IDE.
On Linux it used to be "application/target/userdir/var/cache/" but since
RELEASE121 it's /home/pata/.cache/appname/.
On Windows it's still "application/target/userdir/var/cache/" for
RELEASE121.

I think this is related to my original post but I'm not sure.

Den lör 23 maj 2020 kl 20:01 skrev Eirik Bakke <eb...@ultorg.com>:

> And here's a pull request for this...
>
> https://github.com/apache/netbeans/pull/2153
>
> -- Eirik
>
> -----Original Message-----
> From: Eirik Bakke <eb...@ultorg.com>
> Sent: Saturday, May 23, 2020 1:44 PM
> To: dev@netbeans.apache.org
> Subject: RE: DEFAULT_CACHEDIR_ROOT not propagating to platform application
>
> I created JIRA issue https://issues.apache.org/jira/browse/NETBEANS-4367
> for this.
>
> -- Eirik
>
> -----Original Message-----
> From: Patrik Karlström <pa...@trixon.se>
> Sent: Saturday, May 23, 2020 4:16 AM
> To: dev@netbeans.apache.org
> Subject: DEFAULT_CACHEDIR_ROOT not propagating to platform application
>
> The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.
>
> While I was about to use the cache dir logic provided by the platform I
> ran into this problem.
>
> My cache dir is in
> ${HOME}/.${APPNAME}/var/cache
> and not as expected,
> ${HOME}/.cache/${APPNAME}
>
> The app.conf contains
> default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
> default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"
>
> Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set ok,
> but not picked up by the application.
>
> When specifying --cachedir it gets picked up by the application.
>
> I created a simple testapp and this problem is there too.
>
> So I guess the question is, Is this related to my doing or the platform?
>
> /Patrik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

RE: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Posted by Eirik Bakke <eb...@ultorg.com>.
And here's a pull request for this...

https://github.com/apache/netbeans/pull/2153

-- Eirik

-----Original Message-----
From: Eirik Bakke <eb...@ultorg.com> 
Sent: Saturday, May 23, 2020 1:44 PM
To: dev@netbeans.apache.org
Subject: RE: DEFAULT_CACHEDIR_ROOT not propagating to platform application

I created JIRA issue https://issues.apache.org/jira/browse/NETBEANS-4367 for this.

-- Eirik

-----Original Message-----
From: Patrik Karlström <pa...@trixon.se> 
Sent: Saturday, May 23, 2020 4:16 AM
To: dev@netbeans.apache.org
Subject: DEFAULT_CACHEDIR_ROOT not propagating to platform application

The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.

While I was about to use the cache dir logic provided by the platform I ran into this problem.

My cache dir is in
${HOME}/.${APPNAME}/var/cache
and not as expected,
${HOME}/.cache/${APPNAME}

The app.conf contains
default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"

Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set ok, but not picked up by the application.

When specifying --cachedir it gets picked up by the application.

I created a simple testapp and this problem is there too.

So I guess the question is, Is this related to my doing or the platform?

/Patrik

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




RE: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Posted by Eirik Bakke <eb...@ultorg.com>.
I created JIRA issue https://issues.apache.org/jira/browse/NETBEANS-4367 for this.

-- Eirik

-----Original Message-----
From: Patrik Karlström <pa...@trixon.se> 
Sent: Saturday, May 23, 2020 4:16 AM
To: dev@netbeans.apache.org
Subject: DEFAULT_CACHEDIR_ROOT not propagating to platform application

The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.

While I was about to use the cache dir logic provided by the platform I ran into this problem.

My cache dir is in
${HOME}/.${APPNAME}/var/cache
and not as expected,
${HOME}/.cache/${APPNAME}

The app.conf contains
default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"

Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set ok, but not picked up by the application.

When specifying --cachedir it gets picked up by the application.

I created a simple testapp and this problem is there too.

So I guess the question is, Is this related to my doing or the platform?

/Patrik

RE: DEFAULT_CACHEDIR_ROOT not propagating to platform application

Posted by Eirik Bakke <eb...@ultorg.com>.
This is a bug in the default NetBeans platform app launcher script (which is found in the NetBeans sources at netbeans/harness/apisupport.harness/release/launchers/app.sh , and automatically copied into the "bin" directory when you build your platform app). Note that this script is used on Linux and on MacOS, but not on Windows. There is no corresponding problem on Windows.

In my own platform app, I fixed the bug with the patch below.

I should probably open a Pull Request to fix the original template...

-- Eirik

===================================
diff --git a/ app.sh b/ app.sh
index 679ed16..7a291bc 100755
--- a/Other/app.sh
+++ b/Other/app.sh
@@ -79,6 +79,8 @@ while [ $# -gt 0 ] ; do
     shift
 done

+cachedir="${default_cachedir}"
+
 if [ -f "${userdir}/etc/$APPNAME".conf ] ; then
     . "${userdir}/etc/$APPNAME".conf
 fi
@@ -127,6 +129,7 @@ case "`uname`" in
             '"-J-Xdock:icon=$progdir/../../$APPNAME.icns"' \
             --clusters '"$clusters"' \
             --userdir '"${userdir}"' \
+            --cachedir '"${cachedir}"' \
             ${default_options} \
             "$args"
         ;;
@@ -141,6 +144,7 @@ case "`uname`" in
             --jdkhome '"$jdkhome"' \
             --clusters '"$clusters"' \
             --userdir '"${userdir}"' \
+            --cachedir '"${cachedir}"' \
             ${default_options} \
             "$args"
        exit 1
===================================

-----Original Message-----
From: Patrik Karlström <pa...@trixon.se> 
Sent: Saturday, May 23, 2020 4:16 AM
To: dev@netbeans.apache.org
Subject: DEFAULT_CACHEDIR_ROOT not propagating to platform application

The following is done with NB Platform 11.3 and Java 11 on Kubuntu 20.04.

While I was about to use the cache dir logic provided by the platform I ran into this problem.

My cache dir is in
${HOME}/.${APPNAME}/var/cache
and not as expected,
${HOME}/.cache/${APPNAME}

The app.conf contains
default_userdir="${DEFAULT_USERDIR_ROOT}/dev"
default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev"

Did some echoing in the bin/appname and DEFAULT_CACHEDIR_ROOT was set ok, but not picked up by the application.

When specifying --cachedir it gets picked up by the application.

I created a simple testapp and this problem is there too.

So I guess the question is, Is this related to my doing or the platform?

/Patrik