Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ieboilstart, adopath() - make sure command works with net set #337

Open
kbjarkefur opened this issue Apr 13, 2023 · 4 comments
Open

ieboilstart, adopath() - make sure command works with net set #337

kbjarkefur opened this issue Apr 13, 2023 · 4 comments
Assignees
Labels
minor bug Bug unlikely to lead to incorrect analysis

Comments

@kbjarkefur
Copy link
Contributor

This feedback was orginally provided by Daniel Klein here.

Investigate how net set relates to the settings done in ieboilstart, adopath().

If the two features cannot be made to work together, then at least make sure that it is well documented that adopath() is cannot be used together with net set.

@kbjarkefur kbjarkefur added the minor bug Bug unlikely to lead to incorrect analysis label Apr 13, 2023
@kbjarkefur kbjarkefur self-assigned this Apr 13, 2023
@kbjarkefur
Copy link
Contributor Author

I was able to reproduce this problem. This example confirms that someone that has set net set ado to something else than PLUS will be able to install commands after using adopath() but the commands are not made available. See reproducible example here:

. * Show default setting
. sysdir
   STATA:  C:\Program Files\Stata17\
    BASE:  C:\Program Files\Stata17\ado\base\
    SITE:  C:\Program Files\Stata17\ado\site\
    PLUS:  c:\ado\plus\
PERSONAL:  c:\ado\personal\
OLDPLACE:  c:\ado\

. adopath
  [1]  (BASE)      "C:\Program Files\Stata17\ado\base/"
  [2]  (SITE)      "C:\Program Files\Stata17\ado\site/"
  [3]              "."
  [4]  (PERSONAL)  "c:\ado\personal/"
  [5]  (PLUS)      "c:\ado\plus/"
  [6]  (OLDPLACE)  "c:\ado/"

. net query
from    http://www.stata.com
ado     c:\ado\plus\
other   (current directory)

. 
. * Simulate user with special folder set in "net set ado" 
. local notplus "C:\ado\not-plus-folder"

. cap rmdir "`notplus'"

. cap mkdir "`notplus'"

. sysdir set  OLDPLACE "`notplus'"

. net set ado OLDPLACE

. 
. * Show current setting
. net query
from    http://www.stata.com
ado     C:\ado\not-plus-folder\
other   (current directory)

. adopath
  [1]  (BASE)      "C:\Program Files\Stata17\ado\base/"
  [2]  (SITE)      "C:\Program Files\Stata17\ado\site/"
  [3]              "."
  [4]  (PERSONAL)  "c:\ado\personal/"
  [5]  (PLUS)      "c:\ado\plus/"
  [6]  (OLDPLACE)  "C:\ado\not-plus-folder/"

. 
. * Use adopath()
. ieboilstart, v(14.1) adopath("C:\ado\project-ado",strict) veryquietly

. 
. * Show current setting
. adopath
  [1]  (BASE)      "C:\Program Files\Stata17\ado\base/"
  [2]  (PLUS)      "C:\ado\project-ado/"

. net query
from    http://www.stata.com
ado     C:\ado\not-plus-folder\
other   (current directory)

. 
. * Install iefieldkit
. ssc install iefieldkit
checking iefieldkit consistency and verifying not already installed...
all files already exist and are up to date.

. 
. * command not availible despite just installed.
. iefieldkit
command iefieldkit is unrecognized
r(199);

@kbjarkefur
Copy link
Contributor Author

kbjarkefur commented Apr 13, 2023

All these settings including net set ado do indeed reset after restarting Stata. Here is output after restarting Stata after running the code above.

* Show default setting
. sysdir
   STATA:  C:\Program Files\Stata17\
    BASE:  C:\Program Files\Stata17\ado\base\
    SITE:  C:\Program Files\Stata17\ado\site\
    PLUS:  c:\ado\plus\
PERSONAL:  c:\ado\personal\
OLDPLACE:  c:\ado\

. adopath
  [1]  (BASE)      "C:\Program Files\Stata17\ado\base/"
  [2]  (SITE)      "C:\Program Files\Stata17\ado\site/"
  [3]              "."
  [4]  (PERSONAL)  "c:\ado\personal/"
  [5]  (PLUS)      "c:\ado\plus/"
  [6]  (OLDPLACE)  "c:\ado/"

. net query
from    http://www.stata.com
ado     c:\ado\plus\
other   (current directory)

@kbjarkefur
Copy link
Contributor Author

Solution is probable to include net set ado PLUS before these lines:

* If strict is used, the replace plus
sysdir set PLUS `"`apath'"'
adopath ++ PLUS
adopath ++ BASE

I will test when we are done reorganizing the run folder here: #336

@kbjarkefur
Copy link
Contributor Author

I will keep the minor bug label despite this is a breaking bug because the case is rare. Since the bug is possible we should address, but I do not see a reason for a hotfix release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor bug Bug unlikely to lead to incorrect analysis
Projects
None yet
Development

No branches or pull requests

1 participant