-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
Fixes | ||
----- | ||
|
||
**FAB-17725: Omit go.mod and go.sum from package when not in module mode** | ||
|
||
In certain environments, it's possible to package chaincode that is structured | ||
as a module from an active GOPATH. This often happens when the path provided | ||
to the package command is an import path resolvable from the GOPATH instead of | ||
a file system path. | ||
|
||
If the package can successfully build in the packaging environment from the | ||
import path, the chaincode dependencies are calculated and packaged from the | ||
GOPATH for compilation as a traditional go package. | ||
|
||
In this scenario where the code at the import path is structured as a module, | ||
the go.mod would be included in the chaincode package as packaging always | ||
includes all non-hidden files in the top level folder of the import path. | ||
|
||
On the server, the presence of the go.mod implies that the build process | ||
should execute in module mode. When the dependencies have been vendored in the | ||
module, the build uses -mod=vendor flag to indicate the module requirements | ||
should be satisfied from the vendor folder. Unfortunately, since the | ||
chaincode dependencies were packaged using GOPATH mode instead of module mode, | ||
there are some metadata files missing from the vendor folder that are expected | ||
by the module mode build process. | ||
|
||
To help prevent this from occurring, we will explicitly omit go.mod and go.sum | ||
from top level folder of chaincode that is not packaged in module mode. |