Simplify build procedure - #62
Conversation
|
It's mostly OK, there are a few details that I think need to be addressed.
Does it mean modifying the shell script ? Does it work with the new script ?
|
I had the same idea actually, but I was hesitant because the added complexity of the parsing, but I should do it.
I've used the style of the help of the core utils. But I'm ok either way.
Calling Also note that the user can custumized it with the CC environment variable. It is a convention in POSIX systems but I should probably document it.
Yes, I think I should refactor it a little bit more. In the current moment
It is simply because they aren't set as executable, I'm currently on Windows so I can't fix it directly but we could just call the script |
eff7038 to
06ab464
Compare
|
Hi, sorry for the delay. There are still a few things to address and somethings we'll need to discuss with other maintainers.
SET VC_PATH=C:\Program Files\Microsoft Visual Studio\18\Community
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))
SET VC_PATH=C:\Program Files\Microsoft Visual Studio\18\Professional
IF NOT DEFINED LIB (IF EXIST "%VC_PATH%" (call "%VC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %1))In
@echo off
set start_directory=%cd%
...
if %ERRORLEVEL% neq 0 (goto END)
...
:END
cd /D "%start_directory%"
In In
|
It is only a problem when dealing with cmd on windows if you are using either powershell or a POSIX shell changing the directory doesn't change it in the top process. But I'll fix it for those that still use cmd.exe.
Yes, I was saying in the discord that the
Not sure if it is a good idea seems but I can do it. |
Jack-Punter
left a comment
There was a problem hiding this comment.
Looks pretty good on the whole, got a few comments here and there but nothing super major I dont think.
mrmixer
left a comment
There was a problem hiding this comment.
Almost good to go on my side.
I'm sorry if there is a comment that just say "test", but github didn't show the comment above without it (or more likely I messed up something).
- In previous commits, you removed the
-m64and-m32flags from linux and Mac builds. I couldn't find what those flags are for. Aren't they necessary any more ? - You also removed the part about
realpathfor older mac version from the README. Isn't that an issue ? - I didn't check the linux and Mac bash issues from Jack as I don't know anything about that.
- Like Jack, I'd prefer to have the README contain the parameters for the build. I understand that they can go out of sync, but I don't think that's hard to fix or a big issue.
| rem Make sure we are at the root of the project | ||
| cd /D "%~dp0" | ||
|
|
||
| set root=%cd% |
There was a problem hiding this comment.
root is not used in the script.
The changed I was asking for is a bit different that what you changed.
What I'd like is that when you run that script, if it succeed of fail, you stay in the folder you were when you ran it.
For example if I'm in C:\temp and 4cc is in C:\4cc, after executing the script I want to still be in C:\temp.
So I'd do something like this.
@echo off
set directory_to_restore=%cd%
rem Make sure we are at the root of the project
cd /D "%~dp0"
set src_root=%cd%\code
set custom_root=%src_root%\custom
set build_root=%cd%\build
rem If the user want's 32 bits they need to setup MSVC before calling the script.
call %custom_root%\bin\setup_cl_x64.bat
set opts=/nologo /FC /Zi /I%src_root% /I%custom_root%
if not exist "%build_root%" mkdir %build_root%
pushd %build_root%
call cl %opts% %src_root%\4ed_build.cpp /Febuild
popd
if %ERRORLEVEL% neq 0 (goto END)
%build_root%\build.exe %*
:END
cd /D "%directory_to_restore%"There was a problem hiding this comment.
%root% is never used, we can remove it.
No it isn't. It will work on macos no problem About the executable bit @Jack-Punter I don't have a linux machine right now so I can't set the executable bit myself. |
I've just pushed this and reverted the explicit bash calls in the workflow file. I'll try and take a look at the other changes later. As a quick side note, can you avoid force-pushing when updating a PR, it makes it harder to link up old comments with new changes (and forces us to delete our checkouts and re-pull as you overwrite the history) |
| rem Make sure we are at the root of the project | ||
| cd /D "%~dp0" | ||
|
|
||
| set root=%cd% |
There was a problem hiding this comment.
%root% is never used, we can remove it.
| } break; | ||
| case MODE_RELEASE: { | ||
| string_list_push(arena, &defines, SCchar("SHIP_MODE")); | ||
| string_list_push(arena, &defines, SCchar("NDEBUG")); |
There was a problem hiding this comment.
Any particular reason you added NDEBUG ?
I'm fine with it (it's a probably a good thing to have it).
There was a problem hiding this comment.
It is only a convention some STD function check for it I think assert.h is one of them. But other than that doesn't do anything else.
mrmixer
left a comment
There was a problem hiding this comment.
Everything looks good to me. I only tested on Windows.
|
Im happy with these changes and it seems to work fine on my linux machine, however either because i've commited to the PR, or because the commit i requested changes on no longer exists in the tree (due to force push) i can't update my review to be approved. If we're all happy with this i have the power to bypass our rules and merge regardless of the open requested changes |
|
NVM It was hidden in a wierd place |
Hi,
this is my attempt to simplify the build procedure so you can just go to the root of the folder and execute the build script and you are good to go.
In this PR I would also like to reduce the volume of the
4ed_build.cppso it can be a little more manageable. We can also talk about thecustom_layerproposal made in the discord some time ago.