#1617  Use shorter workspace path to run build
Released
Artem Veschitsky opened 6 months ago

Now we have temp dir as onedev-build3100065178529808779 but in windows this huge and msvc can't compile file fatal error C1083: Cannot open compiler generated file: '': Invalid argument

Maybe you can change to onedev-build-(prj id-job number) etc, as created docker network Creating docker network 'agent-name-prj id-job number-???'...

create temp dir with prefix onedev-build

create temp file and using name as path

Robin Shen commented 6 months ago

Is the path segment onedev-build3100065178529808779 too long for msvc?

Robin Shen commented 6 months ago

I am not familiar with msvc things. If possible, please attach an example project with detailed instructios on how to reproduce the issue so that I can test locally to see if things are fixed.

Artem Veschitsky commented 6 months ago

Is the path segment onedev-build3100065178529808779 too long for msvc?

I think yes its most long section in full path D:\a\onedev-agent\onedev-agent\agent\work\temp\onedev-build3100065178529808779\workspace

I am not familiar with msvc things. If possible, please attach an example project with detailed instructios on how to reproduce the issue so that I can test locally to see if things are fixed.

I think you can have any content in file but path need equal like this D:\a\onedev-agent\onedev-agent\agent\work\temp\onedev-build3100065178529808779\workspace\hl2sdk-cs2\public\tier0\memoverride.cpp

And build system same AMBuild

Install:

python3 -m pip install --upgrade pip setuptools wheel
pip3 install git+https://github.com/alliedmodders/ambuild

Usage:

ambuild --new-project // in project dir

After new prj we have 2 files AMBuildScript and configure.py AMBuildScript have content like this:

# vim: set sts=4 ts=8 sw=4 tw=99 et ft=python:
builder.cxx = builder.DetectCxx()
if builder.cxx.like('gcc'):
    builder.cxx.cflags += [
        '-Wall',
        '-Werror'
    ]

program = builder.cxx.Program('sample')
program.sources += [
    'some-path who lenght equal needed or little bit long if you dont have prefix like this main.cpp', # D:\a\onedev-agent\onedev-agent\agent\work
]
builder.Add(program)

After editing:

python3 configure.py
ambuild objdir

Some main.cpp file:

#include <iostream>

int main()
{
    std::cout << "Some string" << std::endl;
    return 0;
}
Robin Shen commented 6 months ago

Thanks for the detailed guide. Looks like msvc does not like long path. The workspace directory will be changed to use project id and build number combo to make it shorter. But I think this error may still occur when project files are nested deeper...

Robin Shen changed title 6 months ago
Previous Value Current Value
Server Shell Executor: Huge path temp dir
Use shorter workspace path to run build
OneDev changed state to 'Closed' 6 months ago
Previous Value Current Value
Open
Closed
OneDev commented 6 months ago

State changed as code fixing the issue is committed (d6279e5b)

Referenced from commit 6 months ago
OneDev changed state to 'Released' 6 months ago
Previous Value Current Value
Closed
Released
OneDev commented 6 months ago

State changed as build #4264 is successful

issue 1 of 1
Type
Improvement
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
onedev/server#1617
Please wait...
Page is in error, reload to recover