# \`raco pkg migrate\` for \`--link\` and \`--no-setup\` packages

**URL:** <https://racket.discourse.group/t/raco-pkg-migrate-for-link-and-no-setup-packages/926>\
**Category:** Questions & Answers\
**Tags:** package, raco\
**Created:** [April 26, 2022, 4:16pm UTC](https://racket.discourse.group/t/raco-pkg-migrate-for-link-and-no-setup-packages/926 "2022-04-26T16:16:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [April 26, 2022, 4:16pm UTC](https://racket.discourse.group/t/raco-pkg-migrate-for-link-and-no-setup-packages/926/1 "2022-04-26T16:16:20Z")

</div>

1. How does `raco pkg migrate` handle linked packages (those originally installed with `--link` from a directory package source)?

2. What if someone originally installs with `raco pkg install --no-setup`? Does `raco pkg migrate` respect that for the new version's copy, OR, go ahead and do setup?

I could just experiment. But in addition to being lazy, I think it's likely I'll learn more by asking. Like maybe my questions already show some misunderstanding.

* * *

Why I ask: I'm contemplating having Racket Mode's back end Racket code be defined as a package, i.e. add an `info.rkt`. But _not_ a package on the Racket package server. Racket Mode would continue to be an Emacs package, a subdirectory of which has its "back end" process Racket files (and now also an `info.rkt`).

The idea would be to `raco pkg install` it as a directory package source, using `--link`. But maybe it needs to be `--copy`, ala question 1 above?

And for some users, it's nicer never to compile the Racket Mode back end. Startup is still quite fast, and it simplifies moving around various versions of Racket, no .zo mismatch. So that's background on my question 2. If `raco pkg migrate` always did setup, I suppose it wouldn't be horrible to tell these users they'd need to e.g. `raco setup --clean racket-mode`, but, I'd need to know to document that.

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [April 26, 2022, 4:25pm UTC](https://racket.discourse.group/t/raco-pkg-migrate-for-link-and-no-setup-packages/926/2 "2022-04-26T16:25:47Z")

</div>

TL;DR attempt: It seems that Racket packages combine at least two aspects: Installing dependencies, and compiling.

The dependencies aspect seems always desirable for all users.

The compilation aspect is only desirable for some users.

So I guess I'm wondering how to juggle both.

Maybe the answer is something like: "Define two packages. One is 'normal', for the people who want compilation. Another is just a meta package, in the sense of `(define compile-omit-files 'all)`."

Probably that is the only way to guarantee that various `raco setup` or `raco pkg _` commands don't just go ahead and compile the package anyway?

---

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [April 26, 2022, 4:36pm UTC](https://racket.discourse.group/t/raco-pkg-migrate-for-link-and-no-setup-packages/926/3 "2022-04-26T16:36:53Z")

</div>

> [@greghendershott](#):
>
> How does `raco pkg migrate` handle linked packages (those originally installed with `--link` from a directory package source)?

It uses the same mode as the source install. So, if the package was installed with `--link` before, it will be installed with `--link` in the migration target.

> [@greghendershott](#):
>
> What if someone originally installs with `raco pkg install --no-setup` ? Does `raco pkg migrate` respect that for the new version's copy, OR, go ahead and do setup?

The `--no-setup` flag is not recorded, so the migrated package would be set up by default.

> [@greghendershott](#):
>
> it's nicer never to compile the Racket Mode back end

It sounds like declaring `compile-omit-paths` may be the way to go. You could document `raco make` (and `raco make` again after migrating) as a way to force compilation.

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [April 26, 2022, 4:48pm UTC](https://racket.discourse.group/t/raco-pkg-migrate-for-link-and-no-setup-packages/926/4 "2022-04-26T16:48:34Z")

</div>

Thanks for the advice! That's a reasonably small step from the status quo, where I provide `racket-mode-start-{faster slower}` commands to help users do the `raco make` and clean, respectively.

I'm guessing `(define compile-omit-paths 'all)` means I can't use that same `info.rkt` to take advantage of `raco setup --check-pkg-deps --unused-pkg-deps` to validate the deps. But I can seek some side hack for that. Even it can't be checked automatically on every CI run, and instead needs to be some periodic hands-on involving temporarily editing the `info.rkt` to check, it should be fine, and would still be a net improvement over the status quo.
