@mcc@mastodon.social
@mcc@mastodon.social avatar

mcc

@mcc@mastodon.social

glitch girl

This profile is from a federated server and may be incomplete. Browse more on the original instance.

mcc, to random
@mcc@mastodon.social avatar

I am (CURSED! CURSED! CURSED!) writing a batch file.

I want to prematurely exit the batch file with a success code.

This page https://ss64.com/nt/exit.html
claims the way you do this is to type "exit". Quote: "When used in a batch script, this option will exit only the script (or subroutine) but not CMD.EXE. If executed on the command-line it will close CMD.exe"

I execute my batch script on the command line like .\build.bat. It reaches the line "exit". My CMD.exe terminal closes.

What happened?

mcc, to random
@mcc@mastodon.social avatar

Listens to calming drum&bass music, angrily

mcc, to random
@mcc@mastodon.social avatar

Cursed??? C# question:

We have a ProjectName.csproj with a <PropertyGroup><OutputType>Exe</OutputType></PropertyGroup>. Running at the command line, we can successfully run it with dotnet run on Mac, Linux and Windows. On Mac, we can open it in VS Code, hit "Run", and it runs.

On Windows in VS Code only, if we open it and click the run button, it builds a .DLL instead of a .EXE as its final build output and then fails with a message that you cannot run a .DLL.

Why, and how do we not?

mcc,
@mcc@mastodon.social avatar

Hmm, somewhat to our surprise, we're realizing if we do a git clean -xffd and then do a dotnet build from the command line, at least on Windows, it creates both a ProjectName.dll and a ProjectName.exe.

So it appears the issue in vscode is not that it is building the wrong thing, but that vscode is running the wrong thing?

mcc,
@mcc@mastodon.social avatar
mcc,
@mcc@mastodon.social avatar

Microsoft's like yeah I don't do EXEs anymore… EXEs are so 90s, I'm avant garde now… I do everything with DLLs…

mcc,
@mcc@mastodon.social avatar

@gsuberland This makes no sense to me! Pre CoreCLR they would just distribute the .exe file and mono or whatever would run the .exe since it's all just PE to begin with and PE to a non-Windows OS is just another file

mcc,
@mcc@mastodon.social avatar

@gsuberland the thing is it is generating an exe which serves as a wrapper/launcher for the dll, just for some unknown reason vscode has decided to ignore the exe and run the dll. we're currently trying to figure out if this is because we used the "run c# project" template instead of the "Run .net project" template

mcc,
@mcc@mastodon.social avatar

@gsuberland is that a variable in msbuild or in vscode?

mcc,
@mcc@mastodon.social avatar

@xgranade It's true, but I'm completely baffled how Microsoft managed to twist themselves in a pretzel with dotnet core where

  1. They decided to break the stub and the PE into different files
  2. Their own tools then get confused about which one to try to run
mcc,
@mcc@mastodon.social avatar

@gsuberland At the moment, we're not deploying, we're just trying to run in a debugger and VS code is acting weird. we're aware of the difference between dotnet build and dotnet publish.

mcc,
@mcc@mastodon.social avatar

@whitequark @gsuberland i think you can get around this by running dotnet publish, which transforms what you've already built into a normal double clickable thingy. but i'm not quite sure if i'm right about that.

mcc,
@mcc@mastodon.social avatar

Okay, so we have a handle on this, but we still don't understand what happened.

We got both VSCode mac and VSCode Windows to work by rigging this launch.json:

https://gist.github.com/mcclure/3cd5a025f9abae60076c8e3d19648557

(This also required a .vscode/tasks.json containing a "build" step, which Mac had not required.)

You'll notice to make it work, we had to make two different build configurations. One is a template vscode spat out on mac, the other is a template vscode spat out on windows. Neither works on the other OS. (1/2)

jalcine, to random
@jalcine@todon.eu avatar

How does Brandon Sanderson write so much!?

mcc,
@mcc@mastodon.social avatar

@jalcine I heard a rumor that he's got ghostwriters but just now I looked it up and found out no, that's not true, whoever told me that heard he's got a team doing continuity/editing and got confused, but what google DID reveal is HE GHOSTWRITES FOR OTHER AUTHORS, THERE ARE MORE BRANDON SANDERSON BOOKS THAN WE THOUGHT THERE WERE wtf

donni, to random
@donni@mastodon.social avatar

Women wanted him. Men wanted to be him. Birds mocked him. Fish disliked him tremendously

mcc,
@mcc@mastodon.social avatar

@donni Trucker hats, denying all materialistic logic, made serious attempts to transform themselves into physical copies of him, a grotesque process that produced disturbing firms when it was at its half-way mark

mcc, to random
@mcc@mastodon.social avatar

Man… "Sheriff" (Nintendo, 1979) is a really good video game. It makes me want to hear Jeremy Parish spend 16 minutes describing it in low, dulcet tones like he is speaking the words of a lullaby

mcc,
@mcc@mastodon.social avatar

@ieure I have seen neither of these things!!

mcc, to random
@mcc@mastodon.social avatar

Who do you think would win in a fight. Moss or Tunic

mcc, (edited )
@mcc@mastodon.social avatar

For purposes of fairness Moss* gets like a real sword not a grass sword. This is a test of skill not gear.

  • Wait I guess her name is actually Quill.
mcc,
@mcc@mastodon.social avatar

@aeva ok so how do the chances change if we realistically size Quill and Tunic Fox to the irl size of a mouse and a fox

mcc, to random
@mcc@mastodon.social avatar

So, despite what rational sense as well as several dictates would seem to demand, we are attempting to use the "Cmake Projects in Visual Studio" feature of MSVS https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170

We have… questions, which the docs don't seem to answer.

  1. Many places in the VS docs refer to "the project" as if it were a singular file ( see screenshot of https://learn.microsoft.com/en-us/cpp/build/reference/common-macros-for-build-commands-and-properties?view=msvc-170 ). In the case of a CMake Target Project, what is "the project" in this sense? The CMakeLists.txt? The The CMakeSettings.json?
mcc,
@mcc@mastodon.social avatar

@bruxisma My goal is to have a CSProj mark "run this cmake file" as a dependency. There is an existing project for mac/linux where a Task invokes a build.sh that runs the cmake. I could make a build.bat for Windows. But if on Windows I could instead set a Task/Project up for "run this cmake first" without leaving msbuild, that would be real nice. The goal is to not require separate, duplicative CMakeLists.txt and Project.vcxproj for the same handful of C files.

mcc,
@mcc@mastodon.social avatar
mcc,
@mcc@mastodon.social avatar

@bruxisma Okay. Great. That's very useful as it means I can avoid wasting anymore time on this lol

I was hoping it would be as simple as putting a <ProjectReference> in my csproj target that would invoke the but it doesn't seem to be possible to refer to cmake targets / cmake target "projects" in this way (there is ONE ui pane where it uses the word "projects" but it's unclear if it means the same thing as in msbuild)

mcc,
@mcc@mastodon.social avatar

@bruxisma The script solution works okay. There is also some risk that building for [platform I can only mention in PMs] will specifically require a vcxproj.

mcc, to random
@mcc@mastodon.social avatar

C# question that doesn't seem particularly cursed, for once:

In MSBuild (a .csproj) I can tell a target to run at a certain time using BeforeTargets= and AfterTargets=. I know that there are certain built-in targets; one, the C# compilation step, is CoreCompile. I know this works, but I found out about it by rumor.

Where can I find documented, or how can I get msbuild/dotnet to tell me, the full list of "built-in" targets? I am esp interested in what target/step CopyToOutputDirectory occurs on

mcc,
@mcc@mastodon.social avatar

@rainer Thanks for the perspective. Yeah, I think the way I was trying to use the cmake integration yesterday was not what it was designed for

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • magazineikmin
  • cubers
  • InstantRegret
  • cisconetworking
  • Youngstown
  • vwfavf
  • slotface
  • Durango
  • rosin
  • everett
  • kavyap
  • DreamBathrooms
  • provamag3
  • mdbf
  • khanakhh
  • modclub
  • tester
  • ethstaker
  • osvaldo12
  • GTA5RPClips
  • ngwrru68w68
  • Leos
  • anitta
  • tacticalgear
  • normalnudes
  • JUstTest
  • All magazines