Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting WSL by enabling optional default Database constructors #272

Closed
Naville opened this issue Feb 7, 2020 · 4 comments
Closed

Supporting WSL by enabling optional default Database constructors #272

Naville opened this issue Feb 7, 2020 · 4 comments
Assignees

Comments

@Naville
Copy link

Naville commented Feb 7, 2020

I currently uses the following CMake:

# Detecting WSL
IF(EXISTS "/proc/version")
  file(READ "/proc/version" PROC_VERSION)
  string(FIND "${PROC_VERSION}" "Microsoft" PROC_VERSION_IS_MS)
  if(NOT "${PROC_VERSION_IS_MS}" MATCHES "-1")
      message("WSL Detected. Using workaround for broken fcntl")
      add_compile_definitions("USING_WSL")
  endif()
ENDIF()

and

#ifdef USING_WSL
  Database DB(DBPath,SQLite::OPEN_READWRITE | OPEN_CREATE,"unix-dotfile");
#else
  Database DB(DBPath, SQLite::OPEN_READWRITE | OPEN_CREATE);
#endif

To workaround the lack of fcntl support on Windows WSL. I figured if this could be tested and probably merged into the main project

@SRombauts SRombauts self-assigned this Feb 7, 2020
@SRombauts
Copy link
Owner

Hi, can you tell le what is not working correctly une Windows Subsystem for Linux ?
I was under thé impression that is was working correctly, with all unit tests passing.

What change to the Database constructor are you proposing?

Cheers !

@Naville
Copy link
Author

Naville commented Feb 7, 2020

@SRombauts See microsoft/WSL#2395 and its comments, better than my own words

@Naville
Copy link
Author

Naville commented Feb 7, 2020

What change to the Database constructor are you proposing?

I was hoping that the aVfs argument here defaults to "unix-dotfile" on WSL so library users dont have to explicitly deal with this

const std::string& aVfs = "") :

Although I'll admit I'm an idiot on SQL stuff so this might not be the perfect solution here

@SRombauts
Copy link
Owner

Ah yes, I see !
Let me see how to reproduce the issue first

@Naville Naville closed this as completed Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants