codecrafters-io / build-your-own-redis

Definition for the redis challenge.
https://app.codecrafters.io/courses/redis/overview
MIT License
129 stars 37 forks source link

Upgrade csharp project to use dotnet8. #155

Closed Martinii89 closed 6 months ago

Martinii89 commented 6 months ago

Leaving dotnet6 docker file in case old project still has to run against it?

rohitpaulk commented 6 months ago

@Martinii89 nice! I think this is pretty much it, can you try to get course-sdk test csharp to work? That should run a compile step and update the files that are being complained about here: https://github.com/codecrafters-io/build-your-own-redis/actions/runs/8466008904/job/23193897724?pr=155.

Martinii89 commented 6 months ago

@Martinii89 nice! I think this is pretty much it, can you try to get course-sdk test csharp to work? That should run a compile step and update the files that are being complained about here: https://github.com/codecrafters-io/build-your-own-redis/actions/runs/8466008904/job/23193897724?pr=155.

I'm having some issues getting course-sdk installed. Does it not support windows? After cloning the repo and installing bun & make. I get this in the console when running make install

PS C:\Projects\codecrafters\course-sdk> make install
bun build ./cli.ts --compile --outfile ./compiled
  [46ms]  bundle  129 modules
  [46ms] compile  ./compiled.exe
sudo mv ./compiled /usr/local/bin/course-sdk
process_begin: CreateProcess(NULL, sudo mv ./compiled /usr/local/bin/course-sdk, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:3: install] Error 2
Martinii89 commented 6 months ago

I noticed there was a compiled.exe file produced from the make install step. That's the one I assume it tried to move. Running this file didn't work either

PS C:\Projects\codecrafters\build-your-own-redis> ..\course-sdk\compiled.exe test csharp
Compiling... (use --no-compile to skip)
Building js-tools Docker image...

4628 |   };
4629 |   var fileSync = function(options) {
4630 |     const args = _parseArguments(options), opts = args[0];
4631 |     const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
4632 |     const name = tmpNameSync(opts);
4633 |     var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
                    ^
ENOENT: No such file or directory
   errno: -2
 syscall: "open"
   path: "C:\Users\m4rti\AppData\Local\Temp\tmp-27932-0fAf6d5AcgCA"

      at fileSync (B:/~BUN/root/cli.js:4633:14)
      at B:/~BUN/root/cli.js:16627:28
      at buildImage (B:/~BUN/root/cli.js:16626:29)
      at B:/~BUN/root/cli.js:16889:11
      at doRun (B:/~BUN/root/cli.js:16885:17)
      at B:/~BUN/root/cli.js:16871:11
      at run (B:/~BUN/root/cli.js:16870:15)
      at B:/~BUN/root/cli.js:17392:11
      at B:/~BUN/root/cli.js:17386:295
Martinii89 commented 6 months ago

@rohitpaulk Pushed changes after running course-sdk test csharp in wsl The command fails when run on main and my branches though. So idk if it did everything it should have

 - Executing starter repo script

     exec /init.sh: no such file or directory

  - Expected 'Logs from your program will appear here' to be present.

StarterCodeTester failed. Check the logs above for more details.
Martinii89 commented 6 months ago

@rohitpaulk Looks to me like it failed because of the space that course-sdk test added in Server.cs.diff Pushed a commit the reverted that again. If it still fails after this - I'm giving up.

rohitpaulk commented 6 months ago

@Martinii89 thanks so much for this - I think one of us can take it to the finish line from here :) Windows/WSL compatibility isn't something we've tested well for course-sdk, sorry about that!

rohitpaulk commented 6 months ago

@ryan-gang can you help get course-sdk tests passing here please?

rohitpaulk commented 6 months ago

Ah, ignore - looks like it worked!