[PR #55] [CLOSED] Windows (MSVC): no POSIX setenv() - a _putenv_s shim for the --kv int8 call #304

Closed
opened 2026-10-29 21:24:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/55
Author: @noahark
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: win-setenv-shim


📝 Commits (1)

  • 06a08e4 Windows (MSVC): no POSIX setenv(); a _putenv_s shim for the --kv int8 call in generate.cpp

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 src/program/generate.cpp (+7 -0)

📄 Description

What

src/program/generate.cpp calls POSIX setenv() in the new --kv int8 path (#41, v1.0.21). MSVC has no setenv, so v1.0.21 does not compile on Windows:

src\program\generate.cpp(2116): error C3861: "setenv": identifier not found

This adds a small _WIN32 shim (_putenv_s) above the includes. _putenv_s always overwrites, which only differs from setenv(..., 0) when an existing value must survive - not the case at this call site (the value is the constant "1", and the env var is not expected to be preset).

Verified

  • v1.0.21 builds again on Windows 10 21H2: VS Build Tools 2022 (MSVC 14.44.35207), CUDA toolkit 12.4, targeting sm_70 (Tesla V100), ninja via the installer's build step - the engine and the vision encoder both compile and the server runs.
  • Context: this is from what looks like the first Windows + Tesla V100 run of Maya; a full install / speed report follows as an issue (pagefile requirement, calibration, context-tier ladder 32K/128K/256K).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/55 **Author:** [@noahark](https://github.com/noahark) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `win-setenv-shim` --- ### 📝 Commits (1) - [`06a08e4`](https://github.com/mw00/project-maya/commit/06a08e496f05231742a238929d8e20644f5b7d9e) Windows (MSVC): no POSIX setenv(); a _putenv_s shim for the --kv int8 call in generate.cpp ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/program/generate.cpp` (+7 -0) </details> ### 📄 Description ## What `src/program/generate.cpp` calls POSIX `setenv()` in the new `--kv int8` path (#41, v1.0.21). MSVC has no `setenv`, so v1.0.21 does not compile on Windows: ``` src\program\generate.cpp(2116): error C3861: "setenv": identifier not found ``` This adds a small `_WIN32` shim (`_putenv_s`) above the includes. `_putenv_s` always overwrites, which only differs from `setenv(..., 0)` when an existing value must survive - not the case at this call site (the value is the constant `"1"`, and the env var is not expected to be preset). ## Verified - v1.0.21 builds again on Windows 10 21H2: VS Build Tools 2022 (MSVC 14.44.35207), CUDA toolkit 12.4, targeting sm_70 (Tesla V100), `ninja` via the installer's build step - the engine and the vision encoder both compile and the server runs. - Context: this is from what looks like the first Windows + Tesla V100 run of Maya; a full install / speed report follows as an issue (pagefile requirement, calibration, context-tier ladder 32K/128K/256K). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:24:00 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#304
No description provided.