@james.swaine has joined the channel
Is there anything analogous to a Gemfile or cabal file in the pkg system?
@james.swaine info.rkt is the analagous file
Will that work regardless of whether I’m making a package myself? In other words raco pkg knows to look for that in the current working directory?
@james.swaine I’m not sure what you mean
Racket doesn’t (really) have a concept analagous to cabal build
raco pkg install with no other arguments looks in the current directory
other raco pkg subcommands don’t do things where the current directory is relevant
every other pkg-related command (such as raco setup or raco test) take pkg names as arguments (in their modes where they consult packages)
@james.swaine To add to what @samth said: When developing a package locally, say in a foo directory: From the parent dir of foo, you can do raco pkg install --link foo, once. (Note the --link.) Thereafter, foo is a package name that raco pkg commands will understand, regardless of the current directory. (Maybe you already knew this, but just in case that might be a point of confusion.)
To further add, note that raco pkg install in the foo directory does what @greg says as well, without knowing any options :slightly_smiling_face:
Oh. :slightly_smiling_face: Did it always, even in older Racket versions? Once upon a time, I learned --link as a magic spell.
Anyway, I think my point is, that initial install (with or w/o --link :smile:) will name the package and then you can use that name with raco pkg — in case that wasn’t clear.
@greg it’s possible that there was a release with that behavior
also it infers --link if you type a directory name, so raco pkg install foo/ will work too
the Spanish Inquisition has one main way of naming packages …
sorry, i don’t think i was clear in what i was after before. suppose i’m making a little sample app called thing i want to put on github or whatever. i make a directory called thing and inside it i have main.rkt and helpers.rkt. code in both of those files may use functions from packages A, B, and C. i’m wondering whether i could add an info.rkt file and raco pkg install or some other pkg command could be used to just install all dependencies listed in there. analogous in Ruby to having a Gemfile and running bundle install
Yes, you can.
Yes info.rkt is where pkg dependencies are listed. An easy shortcut to figuring out which dependencies to put in info.rkt first do a raco pkg install inside the thing directory to install your pkg. Once it’s installed and assuming your pkg is implementing a collection also called thing then do raco setup -l thing --fix-pkg-deps which will adjust your thing pkg’s info.rkt to have the missing dependencies raco setup finds
-l thing option tells setup to only limit itself to checking thing collection’s pkg to avoid scanning everything that’s installed