question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestions for load script generation

See original GitHub issue

@sylvanc and I have been using the amazing package-load-script-generation feature. It’s fantastic

Here are some suggestions for how it can be adjusted

  • Always generate the package load scripts by default. They are just too useful to not do it
  • Always generate by assuming the latest .NET Framework by default (net462) unless told otherwise.
  • Always generate “paket-refs.fsx” (or “paket-refs.csx”) next to paket.dependencies that references all the package loads.
  • If there is a non-main group of references then generate paket-build-refs.fsx
  • Never generate a #r on FSharp.Core. I think @tpetricek is adding a separate issue on this.

This would make the feature really, really usable. Right now putting things deep in paket-files makes things hard.

thanks don

cc @dungpa

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:24 (24 by maintainers)

github_iconTop GitHub Comments

2reactions
smoothdevelopercommented, Feb 12, 2017

The changes have been released in latest paket 4 alpha release:

  • files have moved to .paket/load folder
  • the include. file name prefix is gone
  • when we can assume a default framework, we don’t generate a subfolder with framework name (in practice that mean having framework: single-framework-here in the paket.dependencies file)
1reaction
cloudRoutinecommented, Dec 3, 2016

root directory pollution is becoming an increasing problem as every CI, editor, extension, build tool, and their father, mother, sister and brother has decided they must be at the root to work. I wish people would start adopting the convention that all of this could go in /.config/ at root instead.

Let’s not contribute to this issue by default.

@isaacabraham while /paket-files/include-scripts/net46/include.main.group.fsx is definitely onerous wouldn’t something like /load-scripts/main.fsx or /paket-files/load.fsx or /paket-files/load-refs.fsx be easy enough?

As far as discoverability goes, an easy way to let people know where the load script is located

λ» paket generate-load-scripts
Paket version 4.0.0-alpha030
generating scripts for framework net46
+ load script generated @
+ ./load-scripts/main.fsx

is just to tell them where the script was generated

(I’m not clear there is such thing as “highest framework version”, in the context of different platforms).

@smoothdeveloper looking backward I’m not sure how to approach it, but moving forward the netstandard library version compatibility is the way to set this

But I do agree that at the very least the current convention should really be changed (maybe for paket4 so it can be breaking 😈 )

First and foremost why are they called include scripts? It’s not a term that’s used in common F# or .Net parlance, in oth .fsx and .csx files you #load scripts so why not just call it generate-load-scripts?

/paket-files/include-scripts/net46/include.fsharp.compiler.service.fsx

^ why does it need to say include twice?

^ this is already kind of a mess, and as more people start using netcore it’s only going to get worse.

Some conventions that could clean this up would be:

  • a specific directory for load scripts like /load-scripts/ at repo root
  • don’t put the framework in path of the default scripts generated
  • generate the default script by using the lockfile to determine the lowest compatible framework to load the entire group (unless this has some problems I’m overlooking?)
  • add the framework that’s being used by default to the print message for the default generated scripts
Loaded group Main, framework - net46
  • put the load scripts for each group in /load-scripts/ e.g.
/load-scripts/main.fsx
/load-scripts/group1.fsx
/load-scripts/group2.fsx
  • put the load scripts for specific packages in a group in a directory with the same name as that group
/load-scripts/main.fsx
/load-scripts/main/fsharp.compiler.service.fsx
/load-scripts/main/system.buffers.fsx
/load-scripts/main/system.collections.fsx
  • print warning messages when some packages in a group can’t have a load script generated for a particular framework
  • print warning/error message when no load scripts can be generated for a particular framework
  • don’t create a directory for a framework when no load scripts could be generated for it
  • when generating load scripts for frameworks other then the default put them in a subdirectory with the framework name in the path following the same convention as the defaults
/load-scripts/net40/main.fsx
/load-scripts/net40/main/fsharp.compiler.service.fsx
/load-scripts/net40/group1.fsx
/load-scripts/net40/group2.fsx
Read more comments on GitHub >

github_iconTop Results From Across the Web

Script Optimization
This script will load and execute when any route in your application is accessed. Next.js will ensure the script will only load once,...
Read more >
How can I automate the "generate scripts" task in SQL ...
Right click on my database, Tasks, "Generate Scripts..." manually select all the export options I need, and hit select all on the "select...
Read more >
MS SQL Canvas Data Database Generation and Load Scripts
1) Create a storage account and blob container - load unzipped CD1 files · 2) Get the URL and Shared accesses signature to...
Read more >
Why You Should Always Load-Test Scripts & Plugins
The best way to ensure optimal performance over time is to incorporate load tests into your development processes. Before each deploy, run a...
Read more >
Generative AI script recommendations
Generate scripts using AI · 1. From Admin, click Scripts. · 2. Click Create script. · 3. Enter the script name and select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found