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

How to build the latest 22.01 #274

Closed
mshedsilegx opened this issue Oct 4, 2022 · 8 comments
Closed

How to build the latest 22.01 #274

mshedsilegx opened this issue Oct 4, 2022 · 8 comments

Comments

@mshedsilegx
Copy link

mshedsilegx commented Oct 4, 2022

I'm trying to build the latest master branch with AppVeyor. All goes well until:

resource.rc(35) : error RC2135 : file not found: ../../Archive/Icons/apfs.ico
: fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\rc.EXE"' : return code '0x1'
Stop.

Any idea how to inject those icons in the source tree so that they can be found ?

@mshedsilegx mshedsilegx changed the title New R3 Build How to build the latest 22.01 Oct 14, 2022
@mshedsilegx
Copy link
Author

is there any documentation on the build process for the current main branch ? Any pointers would be appreciated.

@mshedsilegx
Copy link
Author

after removing the missing icon frm resource.rc, the build of Format7zF fails with the error below:

../../Archive\ZstdHandler.cpp(375): error C2220: the following warning is treated as an error
../../Archive\ZstdHandler.cpp(375): warning C4003: not enough arguments for function-like macro invocation 'REGISTER_ARC_IO'
../../Archive\ZstdHandler.cpp(370): error C2440: 'initializing': cannot convert from 'UInt32 (__cdecl *)(const Byte *,size_t)' to 'UInt32'
../../Archive\ZstdHandler.cpp(370): note: There is no context in which this conversion is possible
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.
Command exited with code 2

@rohitab
Copy link

rohitab commented Nov 30, 2022

I ran into the same issue while building the latest version today. I was able to fix the code and successfully build 7z.dll. The issue is due to missing time flags for the REGISTER_ARC_IO macro. I've set the time flags to 0, but most likely they need to be set to proper values using TIME_PREC_TO_ARC_FLAGS_MASK and TIME_PREC_TO_ARC_FLAGS_TIME_DEFAULT.

I'm attaching a zip file that contains the source code patch and the missing icon. Apply the included patch and copy apfs.ico to CPP\7zip\Archive\Icons directory. The source code should build after that.

7-Zip-zstd-22.01-rohitab.patch.zip

@isarrider
Copy link

@rohitab Will you digg deeper for a proper fix n create a PR after that?

@isarrider
Copy link

here is btw a working compile...
https://github.com/SCell555/7-Zip-zstd

@mshedsilegx
Copy link
Author

mshedsilegx commented Jan 5, 2023

Do you think the approach below is correct for example zstd ?

REGISTER_ARC_IO(
  "zstd", "zst tzstd", "* .tar", 0x0e,
  k_Signature,
  0,
  NArcInfoFlags::kKeepName,
  TIME_PREC_TO_ARC_FLAGS_MASK (NFileTimeType::kWindows)
  | TIME_PREC_TO_ARC_FLAGS_MASK (NFileTimeType::kUnix)
  | TIME_PREC_TO_ARC_FLAGS_MASK (NFileTimeType::kDOS)
  | TIME_PREC_TO_ARC_FLAGS_TIME_DEFAULT (NFileTimeType::kWindows),
  IsArc_zstd)

@rohitab
Copy link

rohitab commented Jan 7, 2023

Based on this comment facebook/zstd#1402 (comment)_ by a zstd developer, it appears that zstd does not store the file modification time. In which case, I think that time precision flags are probably not be required.

Take a look at REGISTER_ARC_IO for bzip. You'll see that time precision flags are not set, which makes sense since bzip does not store file time.

REGISTER_ARC_IO(
"bzip2", "bz2 bzip2 tbz2 tbz", "* * .tar .tar", 2,
k_Signature,
0,
NArcInfoFlags::kKeepName
, 0
, IsArc_BZip2)

Now, if you look at REGISTER_ARC_IO for gzip, you'll see that the flags are set. Again, this makes sense since gzip stores the modification time. You can also see that the NArcInfoFlags::kMTime flag is set.

REGISTER_ARC_IO(
"gzip", "gz gzip tgz tpz apk", "* * .tar .tar .tar", 0xEF,
k_Signature, 0,
NArcInfoFlags::kKeepName
| NArcInfoFlags::kMTime
| NArcInfoFlags::kMTime_Default
, TIME_PREC_TO_ARC_FLAGS_MASK (NFileTimeType::kUnix)
| TIME_PREC_TO_ARC_FLAGS_TIME_DEFAULT (NFileTimeType::kUnix)
, IsArc_Gz)

Since zstd does not store the file modification time either, the time flags should be similar to bzip, i.e. the time flags should be set to 0.

Please note that I've only have a cursory look at the code, and I'm not an expert on compression formats. So, I may be wrong.

@isarrider I thought about it, but since I wasn't 100% sure about the change, I didn't want to submit an incorrect PR. Also, there are some other issues with the build. For example, Alone2 does not build, unless you add additional objects to the makefile. The developer is aware that the latest version doesn't build. See #281 (comment). I assume they will release an update when ready.

@isarrider
Copy link

@rohitab I know that the dev is aware, but I thought he doesnt have the time atm to work on it...
Thats why I just wanted to point out the (incorrect?) working fork...

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

No branches or pull requests

4 participants